接之前文章,在VMware中安装好系统后。
新装的虚拟机、ubuntu\centos,必须要单独安装/.ssh。
centos删除ssh重装
在CentOS系统中重装SSH服务,你可以按照以下步骤操作:
- 卸载当前的SSH包:
sudo yum remove openssh-server openssh-clients
- 安装SSH包:
sudo yum install openssh-server openssh-clients
- 启动SSH服务:
sudo systemctl start sshd
- 设置SSH服务开机自启:
sudo systemctl enable sshd
- 如果需要,检查SSH服务状态:
sudo systemctl status sshd
确保在执行这些步骤之前,你有适当的权限(通常是root权限)。如果你使用的是CentOS 7或更高版本,yum是用来管理包的工具。如果你使用的是CentOS 8或更高版本,可能需要使用dnf来代替yum。
开放22端口
- 打开终端,使用
vim或者nano等编辑器打开文件/etc/ssh/sshd_config。 - 在文件中找到“
#Port 22”,将它改成Port 22,表明要开放22端口。 - 重启
systemctl restart sshd