1.9 使用PuTTY远程连接Linux
1.10 使用xshell连接Linux
1.11 PuTTY密钥认证
1.12 xshell密钥认证
2018.05.30笔记
1.9 使用PuTTY远程连接Linux
首先搜索下载putty远程工具
现(baidu)官网地址:www.chiark.greenend.org.uk/~sgtatham/putty
官网因下载一个软件组最好
1.10 使用xshell连接Linux
xshell分为商业和学校及个人版
学校及个人版免费提供使用
官网:http://www.netsarang.com/需要注册后才能够下载
xshell连接服务器步骤
1.11 PuTTY密钥认证
安装putty后找到putty gen
点击Generate生成密钥字符串
接下来在系统中保存公钥的字符串信息
login as: root
root@192.168.1.220's password:
Last failed login: Wed May 30 13:08:45 CST 2018 from 192.168.1.112 on ssh:notty
There was 1 failed login attempt since the last successful login.
Last login: Wed May 30 11:12:58 2018 from 192.168.1.112
[root@Huaching-2 ~]# mkdir /root/.ssh
[root@Huaching-2 ~]# chmod 700 /root/.ssh
[root@Huaching-2 ~]# vim /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAg0zAq4XMe7peCdHW9CtaG4CVwdMDI2Mi/zTIPFyvaeYymi8RrurFP4xQhMbxh3ocDSFtYvm/rEj+Uerz86+P4ztda4i+Llxi1K1yCEFo0Oj3cAQcL7q1MkM+Tj+wl8Ijx9d6CiXtv/u2DaCldd42X6eUCtI0/As7s3wBkxmKvU2v4xf7mmtUuuvSGrJHSY0JctzL+41cnds3dUeHDaYA2I4cvRJgeuBgOBzGEk+TwDlgTwXibShpdDy4zgrLzURq2+Sqk+mw4UHyz7nVRcCFdwAQcZW2eOcXkxkmboyXd0jwu2cqNlPXeC6rhxZS8EABmcLzcBmbn6JP0ks0UnDQyQ== rsa-key-20180530
保存公钥退出
关闭selinux防火墙
vim /etc/selinux/config
SELINUX=disabled
putty上指定私钥位置
使用私钥成功登录
login as: root
Authenticating with public key "rsa-key-20180530"
Passphrase for key "rsa-key-20180530":
Last login: Wed May 30 13:59:59 2018 from 192.168.1.112
[root@Huaching-2 ~]#
1.12 xshell密钥认证
xshell生成密钥对
把生成的公钥保存到服务器中(服务器公钥文件前以#号注释则这条公钥不生效)
[root@Huaching-2 ~]# mkdir /root/.ssh
[root@Huaching-2 ~]# chmod 700 /root/.ssh
[root@Huaching-2 ~]# vim /root/.ssh/authorized_keys
#puttyssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAg0zAq4XMe7peCdHW9CtaG4CVwdMDI2Mi/zTIPFyvaeYymi8RrurFP4xQhMbxh3ocDSFtYvm/rEj+Uerz86+P4ztda4i+Llxi1K1yCEFo0Oj3cAQcL7q1MkM+Tj+wl8Ijx9d6CiXtv/u2DaCldd42X6eUCtI0/As7s3wBkxmKvU2v4xf7mmtUuuvSGrJHSY0JctzL+41cnds3dUeHDaYA2I4cvRJgeuBgOBzGEk+TwDlgTwXibShpdDy4zgrLzURq2+Sqk+mw4UHyz7nVRcCFdwAQcZW2eOcXkxkmboyXd0jwu2cqNlPXeC6rhxZS8EABmcLzcBmbn6JP0ks0UnDQyQ== rsa-key-20180530
##xiang_xshell
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAmOKyjI62GmiQiARZl7hIOmcxEt1dcLiRt13wxckzGe6HD6AFPBsm8oOudz9vYCBbXRytc7QJXI4vog3f1UMcJyw62fvHUOzD1dquevzOo5L7zpDwdxJ6hZtUDVUhGWC4Mu53yi5vSuOvTm74J/MLXMOVAUJCp390I1/a0c/7elZUx+UgZD2dlCCNGi3Hgx/2ciax8JOAiNDbhplcp9FUMeFMu7Q2E4RHp4kD+BAaoWSkmwG1UY/iklZP/da8ICDNJ/zCDrocaYZVE2h/lyWkE8/Dyi+CZZHq+1GbZIRNka/Yn91fR2PknNCHkqhHdymZy1ILv3tJ6aqv959baSkNQQ==
最后使用私钥验证登录
在xshell上测试登录成功
Connecting to 192.168.1.220:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Wed May 30 14:43:41 2018 from 192.168.1.112
[root@Huaching-2 ~]#
转载于:https://blog.51cto.com/8844414/2122021