本机ssh连接vmware虚拟机

322 阅读1分钟

接之前文章,在VMware中安装好系统后。

新装的虚拟机、ubuntu\centos,必须要单独安装/.ssh。

centos删除ssh重装

在CentOS系统中重装SSH服务,你可以按照以下步骤操作:

  1. 卸载当前的SSH包:
sudo yum remove openssh-server openssh-clients
  1. 安装SSH包:
sudo yum install openssh-server openssh-clients
  1. 启动SSH服务:
sudo systemctl start sshd
  1. 设置SSH服务开机自启:
sudo systemctl enable sshd
  1. 如果需要,检查SSH服务状态:
sudo systemctl status sshd

确保在执行这些步骤之前,你有适当的权限(通常是root权限)。如果你使用的是CentOS 7或更高版本,yum是用来管理包的工具。如果你使用的是CentOS 8或更高版本,可能需要使用dnf来代替yum

开放22端口

  1. 打开终端,使用vim或者nano等编辑器打开文件/etc/ssh/sshd_config
  2. 在文件中找到“#Port 22 ”,将它改成Port 22,表明要开放22端口。
  3. 重启 systemctl restart sshd

blog.csdn.net/Ureliable/a…