命令行方式利用私钥连接sftp

sftp -oIdentityFile=私钥地址 -oPort=端口 用户名@ip 
样例 
sftp -oIdentityFile=/data/id_rsa -oPort=222 [email protected]

连接过程中如果出现

Permissions 0644 for '/data/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

说明私钥文件权限太大,需要修改权限 

chmod 600  /data/id_rsa

重新连接即可

你可能感兴趣的:(linux,linux,运维)