标签:ls -l print -- 文件 Staff entity 文件名 分享 and
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key ($HOME/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in $HOME/.ssh/id_rsa.
Your public key has been saved in $HOME/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:HqDbdb3SyrM2pPj+rrZt0F34GUjVIlDpEKuTOT473KU you@HOST
The key‘s randomart image is:
+---[RSA 2048]----+
| o+.o.. |
| ..+ . .|
| . .+ + . |
| . . + .+ o |
| . S....o o |
| o +.=o.o.o |
| . .o+=.oo |
| . ==Eo |
| +*OB+ |
+----[SHA256]-----+
$ ls -l .ssh
total 24
-rw------- 1 you staff 1876 Sep 11 23:07 id_rsa
-rw-r--r-- 1 you staff 404 Sep 11 23:07 id_rsa.pub
-rw-r--r-- 1 you staff 1046 Aug 3 10:06 known_hosts
秘钥默认文件名及路径
$ vi /etc/ssh/ssh_config
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
如果秘钥在以上路径,直接登录即可
$ ssh you@1.1.1.1
如果秘钥不在以上路径,有两种方法:
1)通过-i指定秘钥路径
$ ssh -i /path/to/id_rsa you@1.1.1.1
2)修改/etc/ssh/ssh_config
标签:ls -l print -- 文件 Staff entity 文件名 分享 and
原文地址:https://www.cnblogs.com/barneywill/p/11620944.html