一、启动网卡、安装软件
1.修改网卡配置文件
vi /etc/sysconfig/network-scripts/(ifcfg-ens160)#ONBOOT=yes#重启网络服务systemctl restart network
2.安装vim、epel源、bash自动补全
yum install -y vim epel-release bash-completion
二、关闭防火墙、SELINUX
1.终端SSH登入
ssh root@10.0.10.210
2.防火墙
#停止防火墙、禁止开机自启systemctl stop firewalldsystemctl disable firewalldsystemctl status firewalld
3.SELINUX
#停止SELINUX、禁止开机自启setenforce 0vi /etc/selinux/config#SELINUX=disabledgetenforce
三、添加用户至免密组
adduser tonnnvisudo#加一行 tonnn ALL=(ALL) NOPASSWD: ALL#验证免密sudo su
四、公钥免密验证
#在本机生成一对公钥ssh-keygen -t rsa#复制本机的公钥cat ~/.ssh/id_rsa.pub#粘贴至远程机cd /home/tonnnmkdir .sshvim authorized_keys#本机验证tonnn登入ssh tonnn@10.0.10.210
五、关闭其它登入方式
vim /etc/ssh/sshd_config#关闭密码登入#PasswordAuthentication no#关闭RootSSH登入#PremitRootLogin no#重启sshd服务systemctl restart sshd
六、修改主机名称
1.修改远程机主机名称
hostnamectl set-hostname zonst
2.本地机修改远程机别称
vim ~/.ssh/config#host zonst#hostname 10.0.10.210#user tonnn