sftp -oIdentityFile=私钥地址 -oPort=端口 用户名@ip
样例
sftp -oIdentityFile=/data/id_rsa -oPort=222 zhangsan@10.87.56.43
连接过程中如果出现
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
重新连接即可
版权声明:本文为danxiaodeshitou原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。