因为现在比较流行的都是租用云端服务器,所以我们需要使用远程连接服务器进行运维。
使用协议:SSH(Security Shell)
安全外壳协议,专为远程登录会话和其他网络服务提供安全性的协议。
在终端输入命令 rpm -qa openssh openssl 查看是否已安装ssh服务
openssh ssh服务端软件
openssl 连接和传输过程中加密
SSH服务查看状态、启动、重启、自启
查看状态:
systemctl status sshd.service
启动服务:systemctl start sshd.service
重启服务:systemctl restart sshd.service
开机自启:systemctl enable sshd.service
关闭服务:
systemctl stop sshd.service
注:可以将最后的.service去掉。
客户端远程连接
使用xshell连接服务端,新建会话
协议,ip,端口号对应填好即可远程登录服务器。
查错
1.检查服务端:
网卡是否启动,ip是否正确 ip add或者ifconfig
2.检查服务端端口和进程
查端口:ss -lntup或者netstat -lntup
查进程:ps -ef|grep ssh
3.检查客户端
协议,ip,端口号是否正确
在客户端检查服务端是否开启服务:telnet 服务器ip地址 端口号
有时候关闭防火墙也可能有效果。