SFTP 自动输入密码短语
如果你的创建的密钥对设置了密码短语,使用ssh或者sftp命令时,提示手动输入密码短语。 这时候如果是自动化的脚本作业,应该如何写呢? 网上的方案有使用sshpass,但是如果服务器是AIX系统,很不幸,大概率是找不到这个命令的。 ssh.com官网的 ssh-add 有提及用到密码短语的密钥使用情况。 Keys with Passphrases If the key being added has a passphrase , ssh-add will run the ssh-askpass program to obtain the passphrase from the user. If the SSH_ASKPASS environment variable is set, the program given by that environment variable is used instead. Some people use the SSH_ASKPASS environment variable in scripts to provide a passphrase for a key. The passphrase might then be hard-coded into the script, or the script might fetch it from