设置SFTP以使用公钥身份验证 [英] Setup SFTP to use public-key authentication
本文介绍了设置SFTP以使用公钥身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将服务器到服务器SFTP设置为使用公钥身份验证而不是用户帐户和密码?
How do you setup server to server SFTP to use public-key authentication instead of user account and password?
推荐答案
在客户端中,您需要生成其公共密钥并将其添加到服务器的授权密钥列表中.
In the client you need to generate its public key and add it to server's authorized key list.
以下是您可以使用的命令.
The following are the commands you can use.
在客户端计算机上
ssh-keygen -t dsa -f id_dsa
mv id_dsa* ~/.ssh/
scp ~/.ssh/id_dsa.pub USER_NAME@SERVER:~/.ssh/HOST_NAME.key
在服务器上
cat ~/.ssh/HOST_NAME.key >> ~/.ssh/authorized_keys2
这篇关于设置SFTP以使用公钥身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文