??????????? SSH ??????????????????????????????????
????$ ssh user@hostname -p port
?????????卸?? SSH ??????????????SSH?????????? SSH ??????????????????锟�??????????????????
???????? SSH ??????????????????????????????????? SSH ????????????config???? SSH ????
???????SSH???????
????SSH ?????????????????????貌?????
?????????????
?????????????? (~/.ssh/config)
????????????? (/etc/ssh/ssh_config)
?????????????????????????危???????????????”Host”???????????????????????????????host??????????????巍?
??????????????
????????????些?????SSH??????
????· Host ????
????· HostName ??????
????· Port ???
????· User ?????
????· IdentityFile ????????路??
????· IdentitiesOnly ?????SSH key ???
????· PreferredAuthentications ??????Public Key???
????Host
????Host????????????????????巍?
????SSH???????????????????????
????'*' ???? 0??n ???????????
????'?' ????????????????
????'!' ??????????
???????????????????????锌????????????? host ????????????危?
????$ cat /etc/ssh/ssh_config | grep '^Host'
????Host *
???????????些?????????????????????????????懈?????些??????谩?
????GlobalKnownHostsFile
???????????????????????????????????????????????????????????????????????????????????????? /etc/ssh/ssh_known_hosts ?? /etc/ssh/ssh_known_hosts2 .
????HostName
????????????????????????????????IP???????????????邪??? ‘%h’ ????????????????????械????????婊�??
????IdentityFile
??????????????????????路???????? ~/.ssh/id_dsa ?? ~/.ssh/id_ecdsa ?? ~/.ssh/id_ed25519 ?? ~/.ssh/id_rsa ?械?????????????????????????????
????'%d' ?????????
????'%u' ???????????
????'%l' ??????????
????'%h' ?????????
????'%r' ????????
?????????????????????????????????谢????纬?????些????????
????Port
???????????????????????22??
????User
?????????????????
????UserKnownHostsFile
???????????????????????????????????????????????????????????????????????????????????????? ~/.ssh/known_hosts ?? ~/.ssh/known_hosts2 .
????StrictHostKeyChecking
????SSH??????StrictHostKeyChecking??????? StrictHostKeyChecking=no ??????????????????????????????????渭????????????魏尉?????????
???????懈??????????????????? man ssh_config ????????
??????????
???????????????????www.hi-linux.com?????????
????Host www
????HostName www.hi-linux.com
????Port 22
????User root
????IdentityFile  ~/.ssh/id_rsa
????IdentitiesOnly yes
????$ ssh www
?????????????????????械????
????Host github.com git.coding.net
????HostName %h
????Port 22
????User git
????IdentityFile  ~/.ssh/id_rsa_blog
????IdentitiesOnly yes
????$ ssh -T git@git.coding.net
????$ ssh -T git@github.com