root@hadoop1:/opt/hadoop/conf# sudo /etc/init.d/ssh start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start ssh
root@hadoop1:/opt/hadoop/conf# ps -e |grep ssh
1297 ? 00:00:00 ssh-agent
2548 ? 00:00:00 sshd
--设置ssh不需输入密码登录
root@hadoop1:/opt/hadoop/conf# ssh-keygen -t rsa
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:
c0:71:4e:38:4e:42:cb:cb:f2:32:52:16:6a:08:a7:66 root@hadoop1
The key's randomart image is:
+--[ RSA 2048]----+
| .. ..o |
| ..o+= |
|. o o+o.. |
|o+ o ... |
|+E+ o S |
|+o o |
|. o . |
| . o |
| |
+-----------------+
--test
root@hadoop1:~/.ssh# ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is e8:0c:77:fc:b5:1a:76:46:e1:97:ec:e0:d2:ae:b1:cd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 11.04 (GNU/Linux 2.6.38-8-generic i686)
* Documentation: https://help.ubuntu.com/
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.