For this, install SSH Agent Plugin.
Add your identity to the credentials: Manage Jenkins -> Credentials -> System -> Global credentials
Kind: SSH username with private key
Scope: Global
Enter username and Enter directly Private key
Enter Passphrase if you have it and hit Create
Next, create pipeline like this:
pipeline {
agent any
stages {
stage ('Deploy') {
steps {
sh 'echo test > artifact.txt'
sshagent(['debian']) {
sh 'scp -o StrictHostKeyChecking=no artifact.txt dmitritelinov@192.168.122.138:/tmp/artifact.txt'
}
}
}
}
}