config ssh auto login

http://baike.baidu.com/view/16184.htm


http://en.wikipedia.org/wiki/Secure_Shell

http://www.openssh.com/


SSH 为 Secure Shell 的缩写,由 IETF 的网络工作小组(Network Working Group)所制定;SSH 为建立在应用层和传输层基础上的安全协议。SSH 是目前较可靠,专为远程登录 会话和其他网络服务提供安全性的协议。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题。

$ dpkg -l |grep ssh
ii  openssh-client      1:5.1p1-5ubuntu1  secure shell client, an rlogin/rsh/rcp repla
ii  openssh-server    1:5.1p1-5ubuntu1  secure shell server, an rshd replacement

cat ~/.ssh/id_rsa.pub | cat - >> cat_text
cat ~/.ssh/id_rsa.pub | ssh [email protected] "cat - >> ~/.ssh/authorized_keys"
sed -n '/task_records/p' client_server.log

[simon@localhost]#ssh localhost
ssh: connect to host localhost port 22: Connection refused
openssh-server not installed
Fire up your synaptic package manager and do a search for openssh-server.
sudo apt-get install openssh-server
ps -A | grep ssh
which is sshd
which is ssh-agent
sudo /etc/init.d/ssh restart
vi /etc/ssh/ssh_config

[simon@localhost]#sudo /etc/init.d/ssh start
[sudo] password for simon:
 * Starting OpenBSD Secure Shell server sshd                                                     [ OK ]
[simon@localhost]#ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 74:c8:ac:0b:61:77:07:6d:22:16:36:d4:14:81:fb:c3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
simon@localhost's password:

$ ssh localhost
If you’re prompted for a passphrase, you’ll need to run these commands to generate a key for passphraseless SSH:
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

远程server端安装 openssh-server

client 端安装openssh-client

配置成功后,每次连接到远程主机时都不用输入密码,这里用localhost模拟远程主机



猜你喜欢

转载自tongxiaoming520.iteye.com/blog/979650
今日推荐