vscode连接vmware中的deepin虚拟机,deepin端配置

一、配置ssh服务器

  1. 安装 OpenSSH 服务器

    bash 复制代码
    sudo apt update
    sudo apt install openssh-server
  2. 启动并启用 SSH 服务

    bash 复制代码
    sudo systemctl start ssh
    sudo systemctl enable ssh
  3. 检查状态

    bash 复制代码
    systemctl status ssh

出现这个就行了

bash 复制代码
root@bingley-PC:/home/bingley/test# sudo systemctl start ssh
root@bingley-PC:/home/bingley/test# sudo systemctl enable ssh
Synchronizing state of ssh.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable ssh
root@bingley-PC:/home/bingley/test# systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: enabled)
     Active: active (running) since Tue 2026-01-20 14:27:29 CST; 55s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 124434 (sshd)
      Tasks: 1 (limit: 9364)
     Memory: 1.0M (peak: 1.3M)
        CPU: 26ms
     CGroup: /system.slice/ssh.service
             └─124434 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

1月 20 14:27:29 bingley-PC systemd[1]: Starting ssh.service - OpenBSD Secure Shell server...
1月 20 14:27:29 bingley-PC sshd[124434]: Server listening on 0.0.0.0 port 22.
1月 20 14:27:29 bingley-PC sshd[124434]: Server listening on :: port 22.
1月 20 14:27:29 bingley-PC systemd[1]: Started ssh.service - OpenBSD Secure Shell server.

二、防火墙检查

1、安装

bash 复制代码
sudo apt install ufw 

2、检查状态

bash 复制代码
sudo ufw status

如果输出是:

bash 复制代码
Status: active

并且没有放行 22 端口,就执行:

bash 复制代码
sudo ufw allow 22

三、修改 SSH 配置

bash 复制代码
sudo vim /etc/ssh/sshd_config

找到并修改以下两行(取消注释并改为 yes):

bash 复制代码
PermitRootLogin yes
PasswordAuthentication yes

如果找不到,直接在文件末尾添加这两行。

四、设置密码启动测试

Linux中输入

bash 复制代码
sudo passwd root

在 Windows PowerShell 中执行:

bash 复制代码
ssh root@192.168.244.129

重启 SSH 服务

bash 复制代码
sudo systemctl restart ssh

五、结果

出现这个表示配置成功

bash 复制代码
C:\Users\xxx>ssh root@192.168.244.129
root@192.168.244.129's password:
Linux bingley-PC 6.6.40-amd64-desktop-hwe #23.01.00.33 SMP PREEMPT_DYNAMIC Thu Jul 25 15:29:39 CST 2024 x86_64
Welcome to Deepin 23 GNU/Linux

    * Homepage:https://www.deepin.org/

    * Bugreport:https://bbs.deepin.org/
相关推荐
唠叨的蜜粉17 小时前
无需离开 Visual Studio 即可审阅拉取请求
ide·visual studio
问简18 小时前
【共享盘】ubuntu、windows
linux·windows·ubuntu
小生不才yz19 小时前
Shell脚本精读 · S13-01 | POSIX sh 与 Bash:语法对照表
linux
阿拉斯攀登19 小时前
平台设备驱动:platform bus 与设备树
linux·嵌入式硬件·嵌入式·linux驱动·字符设备驱动
阿拉斯攀登19 小时前
并发与同步:自旋锁、信号量、互斥锁
linux·网络·嵌入式硬件·linux驱动·字符设备驱动
网络小白不怕黑19 小时前
10.邮件服务器搭建并脚本实现监控httpd状态
linux·运维·服务器
Carlos_Xu20 小时前
Linux基础-基础命令
linux
风曦Kisaki21 小时前
# Linux实战笔记-HIS项目实战Day01:版本控制与Git基础
linux·笔记·git
jsons121 小时前
rocky8内网离线批量补丁(你之前搭建的架构,多台服务器首选,无订阅)
linux·运维·服务器
阿拉斯攀登1 天前
SPI 设备驱动开发
linux·驱动开发·嵌入式硬件·linux内核·嵌入式·linux驱动·spi