SSH Skills

Posted on Tue 04 August 2009 in 我用(IT)

- change default port
root@Server:~# vi /etc/ssh/ssh_config
/Port

- alias ip to host
root
@Server:~# vi /etc/hosts

- without password
. goal:
root@ServerA:~# ssh ServerB
//need not type password

. steps:
1. gen key
root@ServerA:~# ssh-keygen -t rsa
//type user password and press enter

root@ServerA:~# ls /root/.ssh/id_rsa.pub
/root/.ssh/id_rsa.pub

2. cp key to ServerB
root@ServerA:~# scp /root/.ssh/id_rsa.pub ServerB:/root/.ssh/tmpkey
root@ServerB:.ssh# cat tmpkey > authorized_keys