ubuntu中配置ssh无密码登入的基本步骤

来源:互联网 发布:诺基亚java阅读器 编辑:程序博客网 时间:2024/06/09 16:52
首先在Ubantu系统中已经安装好了ssh服务。
具体的指令如下仅供参考
1.sudo apt-get install openssh-server
2.sudo apt-get install rsync 
一般第二步时,ubantu系统已经默认装好了一般是可以不用重新配置的。
1.产生本地的公钥,私钥对2.修改私钥权限为600,只能本人访问。3.上传公钥到服务器4.将公钥内容附加到远程主机主目录的/.ssh/authorized_keys文件内。    修改authorized_keys权限为600    删除上传的公钥。5.在本地的密钥环中导入新建的密钥对。命令如下:1.ssh-keygen -t rsa#中途提示输入passphraze,不要输入,直接enter前进到底。结果:产生密钥对Your identification has been saved in /home/Lynn/.ssh/id_rsa.Your public key has been saved in /home/Lynn/.ssh/id_rsa.pub.2.chmod 600 /home/Lynn/.ssh/id_rsa3.cd ~/.sshsftp Capricorn@192.168.1.100sftp> put id_rsa.pubexit4.ssh Capricorn@192.168.1.100cat  id_rsa.pub >> ./.ssh/authorized_keyschmod 600 ./.ssh/authorized_keysrm id_rsa.pubexit5.#客户机导入keygen产生的新私钥 # ssh-add — adds private key identities to the authentication agentssh-add完成。
0 0
原创粉丝点击