1. SSH Login/Logout command
ssh <hostname> #登入 $ exit #登出
- Known_hosts
- Each user has their own known_hosts file, path: (username)/.ssh/known_hosts
- known_hosts files in the/etc/directory
2. Login Method:
- Enter Password login
- Public Key Login
1$Ssh-keygen# you can add the relevant parameters to choose the encryption method, such as [-t RSA]2 #将生成的密钥对中的公钥拷贝到远程服务器上3$SCP/users/(local_username)/.SSH/id_rsa.pub [email protected]_host:4 5#另一种方式:SSH-copy-ID 6# attached: Mac under ssh-copy-IDcommand not found workaround:7# $brewInstall SSH-copy-ID 8 9#这里的例子里 *.pub file name is id_rsa.pub, remote host user name vagrant, IP:192.168.33.10 Ten$SSH-copy-ID-I. ~/.SSH/id_rsa.pub [email protected]192.168.33.10 One/usr/local/bin/SSH-copy-ID: info:attempting to loginchwith the new key (s), to filter out any that is already installed A/usr/local/bin/SSH-copy-ID: INFO:1Key (s) remain to be installed--ifPrompted now it's toInstallThe new keys -[Email protected]192.168.33.10's Password: #此处需要输入密码 - theNumber of key (s) added:1 - -Now try logging to the machine with:"ssh ' [email protected] '" -and check to MakeSure that is the key (s) you wanted were added. +$
Resources:
Http://www.ruanyifeng.com/blog/2011/12/ssh_remote_login.html
[SSH] SSH Learning notes-Telnet