If you skip between servers, it will be troublesome if you do not connect the channel, even if you can remember the password you have. I used it a long time ago. I used it a few days ago. I suddenly forgot how to use it. I wrote it down today so that I would not forget to find a method again.
Machine 1: dwapp @ pttest1
Machine 2: gpadmin1 @ hadoop1
First try to jump from 1 to 2
Dwapp @ pttest1:/home/dwapp/. Ssh> SSH gpadmin1 @ hadoop1
Gpadmin1 @ hadoop1's password:
Dwapp @ pttest1:/home/dwapp/. Ssh>
Prompt to enter the password, CTRL + C to end. Since we want to jump from 1 to 2, we must first establish trust between them. How can we establish it? You think, what you want to achieve is to jump from 1 without entering a password to 2, so why do you trust 2? You have to ensure that people can jump unconditionally.
There is a. Ssh folder under the Home Directory and CD to see what is there
Dwapp @ pttest1:/home/dwapp/. Ssh> ls
Authorized_keys
Execute the following command ssh-keygen-t dsa. Press enter to generate two files.
Dwapp @ pttest1:/home/dwapp/. Ssh> ls
Authorized_keys id_dsa id_dsa.pub
Append the content in id_dsa.pub to the authorized_keys file of Machine 2, and then try to jump from 1 to 2.
Dwapp @ pttest1:/home/dwapp/. Ssh> SSH gpadmin1 @ hadoop1
Last login: Tue Mar 22 21:59:04 2011 from 10.22.13.107
Authorized uses only. All activity may be monitored and reported.
[Gpadmin1 @ hadoop1 ~] $
###############
I tried to jump several times in the new environment today and still needed a password. I searched the internet and found a place to be ignored.
Set authorized_keys Permissions
$ Chmod 600 authorized_keys
Set. Ssh Directory Permissions
$ Chmod 700-R. SSH
Attached to a previous post http://nickkathy.javaeye.com/blog/653921