ssh () (root) () (keys) root . .
ɿ (ssh ) root .
ѿ ( ) (Public-key cryptography) (pass-phrase) .
. root (ssh key) .
root root . . .
:
ȿ- ( ) root ssh. root .
- putty ssh. .
- .
: .
: # ssh root # . # . $ ssh root.
: ssh ssh . ɡ root. .
/root/newk
?
1
2 |
# mkdir /root/newk
# cd /root/newk
|
?
1 |
# ssh-keygen -t rsa -b 2048
|
?
1
2 |
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
|
:
?
?
1
2
3 |
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /root/newk/id_rsa
Enter passphrase (empty for no passphrase):
|
passsphrase
8 .
. * ( Enter).
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 |
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /root/newk/id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/newk/id_rsa.
Your public key has been saved in /root/newk/id_rsa.pub.
The key fingerprint is:
89c04f:ceaa:643f:0e:bd09:c9 root@server
The key's randomart image is:
+--[ RSA 2048]----+
| |
| + |
| . + . |
| O o |
| o S . |
| + + |
| = E |
| + +oo . |
| oo++o |
+-----------------+
|
ssh /root/newk/ . ls
?
1
2
3
4 |
# ls -lh /root/newk/
total 8.0K
-rw------- 1 root root 1.8K Jan 10 12:29 id_rsa
-rw-r--r-- 1 root root 403 Jan 10 12:29 id_rsa.pub
|
id_rsa id_rsa.pub id_rsa secret key id_rsa.pub public key.
:
ssh .
: ssh id_rsa.pub ( ) authorized_keys .ssh root id_rsa.pub /root/.ssh/authorized_keys ( authorized_keys id_rsa.pub :
?
1 |
# cat /root/newk/id_rsa.pub >> /root/.ssh/authorized_keys
|
id_rsa.pub /root/.ssh/authorized_keys
root .
: (id_rsa) /root/newk/id_rsa.
id_rsa scp winsp rsync. .
?
linux.computer
߿
id_rsa ssh :
: ssh :
?
1 |
# ssh -p 22 -l root -i /root/id_rsa linux.server
|
linux.server id_rsa /root/id_rsa
: (id_rsa) /root/.ssh/
id_rsa /root/.ssh .
(pass-phrase) . :
?
1
2
3
4 |
[root@pc ~]# ssh -p 22 -l root -i /root/id_rsa linux.server
Enter passphrase for key 'id_rsa':
Last login: Mon Jan 28 21:35:54 2013 from pc.localhost
root@server [~]#
|
ssh .
putty putty ҡ WinSCP . () putty ppk file putty
PuTTYgen putty ppk putty putty
PuTTYgen.
:
puttygen.exe :
File () Load private file :
id_rsa :
puttygen ( ) : ( OK).
:
putty save private key :
save private key save :
puttygen ppk putty putty ppk.
putty () putty session Hostname ssh 22 :
SSH Auth :
authentication parameters ppk browse :
Open session open :
putty ( ) :
root enter enter # .
.
putty ( putty () ).