Linux A??????????SSH???B????
???????????? ???????[ 2016/6/15 10:58:48 ] ?????????????? Linux
???????????
?????????A????????????????B???????????????B???????????????????????????????????ssh???????????????????
???????????
????1.????
????SSH??????ù??????????????
????2.????
????1) A??????????/????
[root@host-08 ~]# ssh-keygen -t rsa -P ''
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
a7:e3:23:45:e4:a2:22:d0:8d:21:f8:fb:9a:18:b7:f2 root@host-08
The key's randomart image is:
+--[ RSA 2048]----+
|. |
|o . . |
| + + o |
|. + . . o |
|. . . oS . |
|. o . .o |
|...o .o |
|.+ o. .... |
|.oE. ... |
+-----------------+
???????
????1. -P???????-P '' ?????????????????-P??????????????????????-P??λ????
????????????/root/.ssh???????????????id_rsa??id_rsa.pub??
????2. ???????ssh??rsa???:
????id_rsa ??
????id_rsa.pub ???
??????????????????????????
????ssh-keygen -t dsa
????ssh-keygen -t rsa
????ssh-keygen -t rsa1
????2) B??????.ssh??
????[root@host-203 ~]# mkdir .ssh
???????
????????.ssh??????????????????.ssh??
????3) ??A?????????????????B????
????[root@host-08 ~]# scp -P 28888 ~/.ssh/id_rsa.pub root@192.168.1.100:/root/.ssh/authorized_keys
????The authenticity of host '[192.168.1.100]:28888 ([192.168.1.100]:28888)' can't be established.
????RSA key fingerprint is d4:a5:96:40:80:cb:c6:b9:7d:28:46:43:0c:95:49:84.
????Are you sure you want to continue connecting (yes/no)? yes
????Warning: Permanently added '[192.168.1.100]:28888' (RSA) to the list of known hosts.
????root@192.168.1.100's password:
????id_rsa.pub 396 0.4KB/s 00:00
????[root@host-08 ~]#
???????
????1.B????ssh??????????????????????? "-P ????? "
????2.B????????A??????????$HOME/.ssh?????scp???????????? authorized_keys
????4) B????????authorized_keys(A???????)??????
????[root@host-203 ~]# chmod 600 /root/.ssh/authorized_keys
????----------------------------
??????????????????????????????B?????????????A????????????????????????????ɡ?
????5) ????
????SSH????????
????[root@host-08 ~]# ssh -p28888 -l root 192.168.1.100
????Last login: Tue Jun 14 15:02:37 2016 from 192.168.1.8
????[root@host-203 ~]$
????SCP???????????
????[root@host-08 ~]# scp -P 28888 -r /root/findyou.war root@192.168.1.100:/root/
????findyou.war 8005KB 7.8MB/s 00:01
????[root@host-08 ~]#
??????
???·???
??????????????????
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