在 WSL Ubuntu 中安装 SSH 服务器,ssh连接wsl

In Ubuntu 18.04 ist im Microsoft Windows Subsystem für Linux (WSL) der SSH-Server standardmäßig nicht enthalten. Daher müssen zuerst die erforderlichen Pakete installiert werden.

Pakete installieren

apt install openssl openssh-client\
    openssh-server openssh-sftp-server\
    ssh-import-id

Schlüssel erzeugen

Danach die fehlenden Host-Keys erzeugen mit

ssh-keygen -A

Erzeugt man die Schlüssel nicht, entsteht beim Neustart des SSH-Servers die Fehlermeldung

Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key

Konfigurationsdatei bearbeiten

vi /etc/ssh/sshd_config

Port 22
PasswordAuthentication yes

SSH-Server neu starten

service ssh restart

 * Restarting OpenBSD Secure Shell server sshd [ OK ]

相关推荐

  1. WSL Ubuntu 安装 SSH 服务器ssh连接wsl

    2024-02-04 02:50:02       25 阅读
  2. ssh命令——安全远程连接服务

    2024-02-04 02:50:02       20 阅读
  3. 如何远程SSH连接家的服务器主机

    2024-02-04 02:50:02       22 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-02-04 02:50:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-04 02:50:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-04 02:50:02       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-04 02:50:02       20 阅读

热门阅读

  1. 假期作业2

    2024-02-04 02:50:02       27 阅读
  2. ArrayList的数据结构

    2024-02-04 02:50:02       27 阅读
  3. Mysql-备份与恢复

    2024-02-04 02:50:02       36 阅读
  4. C语言stderr、errno、strerror、perror

    2024-02-04 02:50:02       32 阅读
  5. Linux命令-arpd命令(收集免费ARP信息)

    2024-02-04 02:50:02       31 阅读
  6. 开发实践9_OnlinePlatform笔记

    2024-02-04 02:50:02       34 阅读
  7. 作业2024/2/2

    2024-02-04 02:50:02       33 阅读
  8. 开源社区的力量:共同构建数字时代的未来(AI)

    2024-02-04 02:50:02       27 阅读