linux服务器中配置命令:linux
[root@localhost ~]# mkdir .sshshell
[root@localhost ~]# chmod 700 .ssh/ ====>>也能够不设置.ssh权限,设置autherized_keys权限为600vim
[root@localhost ~]# vim .ssh/authorized_keys ====>>.ssh/autherized_keys这个也能够命名为其余名字,须要在sshd配置文件/etc/ssh/sshd_config中修改服务器
[root@localhost ~]# setenforce 0ssh
客户端配置:工具
putty:.net
1:putty下载到官网下载完整安装包get
2n:安装putty相关软件,并运行puttygeit
3:点击Generate生成补丁,注:鼠标在此框中不停晃动以加快速度。io
A:下图为公钥,复制到linux服务器中/root/.ssh/authorized_keys中保存
B:Key comment 此项能够自定义 登陆服务器时显示的key名
C:Key passphrase以及Confirm passphrase 设置远程密钥登陆的密码
D:save public key 以及Save private key 保存公钥以及私钥到电脑中
4:打开putty设置密钥登陆:
5:返回Session保存打开linux。
Xshell:
1:打开xshell 选择工具-新建用户密钥生成向导
2:选择RSA 以及 2048
3:生成公钥,复制公钥到/root/.ssh/authorized_keys里,“保存为文件”能够另存公钥到计算机,最后点击完成
4:保存私钥,“导出”能够另存私钥到计算机
5:xshell中新建,并用私钥认证
6:肯定保存便可打开使用
SecureCRT:
1:打开SecureCRT生成公钥
2:把Identity.pub的公钥复制到/root/.ssh/authorized_keys里
3:选择PublicKey认证
4:保存后便可打开使用