??????????? 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