Linux下SSH免密码登录(转)
2014-05-09 14:22
351 查看
搭建hadoop集群的时候一定会用到的就是SSH免密码登录
如果不能没有成功
方法一:
方法二:
[hadoop@hadoop1 ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/hadoop/.ssh/id_rsa. Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub. The key fingerprint is: 26:96:da:89:60:3d:90:75:43:bf:eb:56:d1:52:d9:68 hadoop@hadoop1 The key's randomart image is: +--[ RSA 2048]----+ | ..+ + | | o . o E . | | o . + | | o . .o . | | o o + S o | | . . * + .. | | o o .. | | .. | | .. | +-----------------+ [hadoop@hadoop1 ~]$ cd .ssh [hadoop@hadoop1 .ssh]$ scp -r id_rsa.pub hadoop@hadoop3:/home/hadoop/.ssh/authorized_keys The authenticity of host 'hadoop3 (192.168.127.120)' can't be established. RSA key fingerprint is 03:be:af:08:19:27:6d:15:7e:dd:90:fa:09:b3:14:2f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'hadoop3,192.168.127.120' (RSA) to the list of known hosts. hadoop@hadoop3's password: id_rsa.pub 100% 396 0.4KB/s 00:00 [hadoop@hadoop1 .ssh]$ ssh hadoop3 Last login: Sat Aug 4 17:35:22 2012 from hadoop1
如果不能没有成功
方法一:
[hadoop@hadoop3 ~]$ chmod 700 .ssh/ [hadoop@hadoop3 ~]$ cd .ssh [hadoop@hadoop3 .ssh]$ chmod 600 authorized_keys
方法二:
[root@hadoop3 .ssh]# vi /etc/ssh/sshd_config AuthorizedKeysFile .ssh/authorized_keys 把前面的#号去掉 [root@hadoop3 .ssh]# /etc/rc.d/init.d/sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ]
相关文章推荐
- Linux/UNIX下 ssh-keygen 设置SSH无密码登录
- Linux上ssh免密码登录
- linux/openwrt ssh免密码登录
- Linux多台服务器间SSH免密码登录配置
- linux无密码ssh登录设置
- linux主机间实现ssh/scp/rsync免密码登录
- Linux文件同步脚步,SSH免密码远程登录设置Linux
- linux下设置了SSH免密码登录但还是需要输入密码的解决办法
- linux下设置ssh无密码登录
- linux下开启SSH,并且允许root用户远程登录,允许无密码登录
- linux ssh无密码登录
- ssh-keygen+ssh-copy-id无密码登录远程LINUX主机(转载)
- linux实现ssh免密码登录
- linux系统SSH免密码登录--已解决
- linux下实现ssh授权、无密码登录
- linux中ssh使用rsa免密码登录方法
- Linux下制作不用密码可立即登录的SSH用户
- Linux多台服务器间SSH免密码登录配置及利用scp 两个服务器文件传输和crontab定时任务的设置
- linux下设置了SSH免密码登录但还是需要输入密码的解决办法
- linux下ssh无密码登录