????SSH????????????Config????SSH??
???????????? ???????[ 2017/2/15 11:13:24 ] ?????????????????? ???霉???
??????????? 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
??????

???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11