本地 shell无法连接centos 7 ?

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

1、首先检查是否安装ssh服务

yum list installed | grep openssh-server

# 没有安装尝试安装下
yum install openssh-server   

在这里插入图片描述
2、检查ssh服务是否开启

systemctl status sshd.service

# 未开启开启下
systemctl start sshd.service   

# 将sshd 服务添加至自启动列表中
systemctl enable sshd.service

# 查看是否开启了sshd 服务自启动
systemctl list-unit-files | grep sshd

在这里插入图片描述

一般这样你就可以远程连接了。

若是还不行可以做如下配置

找到/etc/ssh/目录下的sshd服务配置文件sshd_config,用vim编辑器打开:

vim /etc/ssh/sshd_config

1把文件中的监听号地址打开
在这里插入图片描述
2允许远程控制
在这里插入图片描述
3使用用户密码登录
在这里插入图片描述
:wq保存退出

3.关闭防火墙

# 查看防火墙状态
systemctl status firewalld
 
# 关闭防火墙
systemctl stop firewalld.service
# 禁止firewall开机启动
systemctl disable firewalld.service 
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: shellcentos

“本地 shell无法连接centos 7 ?” 的相关文章