常见的Linux服务器远程连接工具有Putty、Xshell、securCRT等如何使用远程连接工具生成密钥对?选择Xshell的菜单工具栏——新建用户密钥生成向导,看到如下图在Linux系统上创建相
常见的Linux服务器远程连接工具有Putty、Xshell、securCRT等
如何使用远程连接工具生成密钥对?
- 选择Xshell的菜单工具栏——新建用户密钥生成向导,看到如下图
- 在Linux系统上创建相关的authorized_keys文件,如下:
[root@localhost ~]# mkdir /root/.ssh[root@localhost ~]# ls -la /root/total 52dr-xr-x---. 3 root root 4096 Nov 10 06:13 .dr-xr-xr-x. 22 root root 4096 Nov 10 05:47 ..-rw-------. 1 root root 1094 Nov 10 05:46 anaconda-ks.cfg-rw-r--r--. 1 root root 18 May 20 2009 .bash_logout-rw-r--r--. 1 root root 176 May 20 2009 .bash_profile-rw-r--r--. 1 root root 176 Sep 23 2004 .bashrc-rw-r--r--. 1 root root 100 Sep 23 2004 .cshrc-rw-r--r--. 1 root root 8837 Nov 10 05:46 install.log-rw-r--r--. 1 root root 3314 Nov 10 05:44 install.log.syslogdrwxr-xr-x. 2 root root 4096 Nov 10 06:13 .ssh-rw-r--r--. 1 root root 129 Dec 4 2004 .tcshrc[root@localhost ~]# vi /root/.ssh/authorized_keys将复制下来的公钥文件写入到authorized_keys文件中ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzDFIGeLAlINHKVz2/6WSLWfgqiaF1SfvBIjF8havJQlNMpj4UGCbnI+Ymc/Izw+q/Y+G9MEKYodrdTaEcu2suOUlg8IGLFwrp3mBVebsBL38NL8nQJ/a2WFJcNCTTIHCsQtmYPm2X9mO0rgpN/xzwLBxRIlMK/Jo78/Fdv029Lv9w5C8+B6/yqRZ0e2OafxfIMgqmKjaG33X6b+p7wGRxq5azRtdnMTfUoN2722Um+l4kaiJ42caOz8I1T/2HIEmB06gNuPYOckuU1s4dK62Wu/WC8pIarUgveBv8mSclHSFpezFoRJqVEACU/J3Qe22WT+t61Ithd5WGZCOgjXTQQ==[root@localhost ~]# chmod 700 /root/.ssh/ #修改文件夹的权限[root@localhost ~]# chmod 600 /root/.ssh/authorized_keys #修改密钥文件的权限[root@localhost ~]# /etc/init.d/iptables stop #关闭防火墙iptablesiptables: Setting chains to policy ACCEPT: filter [ OK ]iptables: Flushing firewall rules: [ OK ]iptables: Unloading modules: [ OK ][root@localhost ~]# chkconfig iptables off #关闭重启自动启动[root@localhost ~]# iptables -F #清空防火墙规则[root@localhost ~]# service iptables save #保存防火墙规则iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ][root@localhost ~]# setenforce 0 #临时关闭selinux[root@localhost ~]# vi /etc/selinux/config #彻底关闭selinux# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy is loaded.SELINUX=disabled #将此处的enforcing修改为disabled彻底关闭selinux# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=targeted