配置Linux 免密码登陆
2016-05-08 23:50
447 查看
配置Linux 免密码登陆
1 生成秘钥对,一路回车就好
2 修改公钥名称为authorized_keys
3 修改权限为600
4 修改sshd配置文件
5 重启sshd服务
如果需要实现xshell 等终端工具实现免密码登陆的,在生成密钥对的时候,务必先把id_rsa就拷贝出来,不然到时候你配置好了的时候,通过xftp等工具拷贝文件出来,发现本地没有密钥文件,到时候就是死循环了。切记切记!!
1 生成秘钥对,一路回车就好
2 修改公钥名称为authorized_keys
3 修改权限为600
4 修改sshd配置文件
5 重启sshd服务
配置Linux 免密码登陆
友情提示:如果需要实现xshell 等终端工具实现免密码登陆的,在生成密钥对的时候,务必先把id_rsa就拷贝出来,不然到时候你配置好了的时候,通过xftp等工具拷贝文件出来,发现本地没有密钥文件,到时候就是死循环了。切记切记!!
1 生成秘钥对,一路回车就好
[root@localhost ~]# ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'.Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:92:98:a4:6d:a3:bf:04:67:f5:5f:d9:e2:9f:e1:b8:c1 root@localhost.localdomainThe key's randomart image is:+--[ RSA 2048]----+| || || . . || + + o o || o O o S + . || * . . . + . || . . . E . || o = o || o. o.+ |+-----------------+[root@localhost ~]#
2 修改公钥名称为authorized_keys
[root@localhost .ssh]# cd /root/.ssh/[root@localhost .ssh]# cat id_rsa.pub >authorized_keys
3 修改权限为600
[root@localhost .ssh]# chmod 600 authorized_keys
4 修改sshd配置文件
[root@localhost .ssh]# vi /etc/ssh/sshd_config RSAAuthentication yesPubkeyAuthentication yesAuthorizedKeysFile .ssh/authorized_keysPasswordAuthentication no
5 重启sshd服务
[root@localhost .ssh]# service sshd restartStopping sshd: [ OK ]Starting sshd: [ OK ][root@localhost .ssh]#最后拷贝is_rsa 到任意地方保存即可实行无密码登陆
相关文章推荐
- Linux socket 初步
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- Linux 下无损图片压缩小工具介绍