通过ssh的公钥/私钥方式远程登录linux
来源:互联网 发布:超人引流软件 编辑:程序博客网 时间:2024/06/13 07:00
一、通过 ssh-keygen命令创建认证文件
The authenticity of host '192.168.1.202 (192.168.1.202)' can't be established.
RSA key fingerprint is 46:8f:d3:43:db:52:b1:c2:16:99:cd:03:9b:3f:0c:e8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.202' (RSA) to the list of known hosts.
<user>@<host>'s password:<服务器口令>
Now try logging into the machine, with"ssh '<user>@<host>'",and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
# ssh-keygen -b 1024 -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
...............................
The key's randomart image is:
.............................
如果没有更改路径的话,会在<userHome>/.ssh/目录下产生:id_dsa和id_dsa.pub两个文件。其中id_dsa是要加载到ssh客户端的,id_dsa.pub是服务器端的匹配文件。二、使用ssh-copy-id命令将生成服务器端认证文件加载到对应服务器
# ssh-copy-id-i <认证文件保存的目录>/id_dsa.pub <user>@<host>
The authenticity of host '192.168.1.202 (192.168.1.202)' can't be established.
RSA key fingerprint is 46:8f:d3:43:db:52:b1:c2:16:99:cd:03:9b:3f:0c:e8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.202' (RSA) to the list of known hosts.
<user>@<host>'s password:<服务器口令>
Now try logging into the machine, with"ssh '<user>@<host>'",and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
三、修改服务器的ssh配置文件
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
四、将id_dsa加载到客户端
ssh客户端很多,这里只介绍Xshell(免费的为啥不用啊,\(^o^)/~)
properties -> Authentication -> method改成“Public key”,在Userkey中载入对应的认证文件
ok啦~不必再用用户名、口令登录了,方便了不少,安全了不少~
0 0
- 通过ssh的公钥/私钥方式远程登录linux
- 通过ssh的公钥/私钥方式远程登录linux
- Linux-Centos7通过 ssh 远程登录其他用户
- ssh远程登录方式
- Linux 通过rsa公钥实现ssh免密码登录
- linux下ssh公钥验证的设置和远程登录
- Linux的远程登录方式:
- Linux ssh远程登录
- Linux ssh远程登录
- linux远程ssh登录
- 通过ssh登录远程服务器
- Ubuntu 通过SSH远程登录
- 【SSH】登录方式(1)用户名/密码:取远程公钥+用户名/密码 (2)公钥:取数据+本地私钥
- 【原创】windows/Linux通过ssh服务远程登录centos6.5
- Linux SSH远程登录慢的解决方法
- FreeBSD添加一个新用户并允许其使用ssh通过公私钥的方式登录
- ssh 公钥认证方式登录
- ssh 公钥认证方式登录
- Android快捷开关实现
- Linux下删除文件没有释放空间的问题
- 了解Android资源(下)
- com/opensymphony/xwork2/spring/SpringObjectFactory.java:220:-1问题出现的原因及解决办法
- MYSQL VARCHAR排序 CAST ,CONVERT函数 类型转换
- 通过ssh的公钥/私钥方式远程登录linux
- 各种机器学习方法概念
- struts2学习笔记之九(国际化)
- Linux下面使用sqlplus热键冲突
- Reverse Linked List LeetCode206
- Win32使用Psapi库枚举系统进程信息
- 使用wechat4j-master快速开发微信消息
- 线性表顺序存储
- 2.4 实型数据(浮点型)