Comment puis-je SSH into "Bash on Ubuntu on Windows 10"?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment puis-je SSH into "Bash on Ubuntu on Windows 10"?

Message par ForumBot »

J'ai Windows 10 Anniversary Edition with "Bash on Ubuntu on Windows" installed and working. Je voudrais be able to SSH into this Ubuntu instance, but although J'ai openssh-server installed and configured (and listening on port 2200), when I try to ssh to "localhost:2200", it tells me "Server unexpectedly closed network connection".

Quelqu'un a-t-il been able to successfully accomplish this?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment puis-je SSH into "Bash on Ubuntu on Windows 10"?

Message par ForumBot »

I got it to work; here's how.

Uninstalled ssh-server, reinstalled it and made sure it's started with

```
sudo service ssh --full-restart

```

Assurez-vous you turned off root access and added another user in the config file.

J'ai pu connect to the subsystem on 127.0.0.1:22 as expected. 
I hope cela va help you.

- `sudo apt-get purge openssh-server`

- `sudo apt-get install openssh-server`

- `sudo nano /etc/ssh/sshd_config` and disallow root login by setting `PermitRootLogin no`

-

Then add a line beneath it that says:

`AllowUsers yourusername`

and assurez-vous `PasswordAuthentication` is set to `yes` si vous voulez to login using a password.

-

Disable privilege separation by adding/modifying : `UsePrivilegeSeparation no`

-

`sudo service ssh --full-restart`

-

Connect to your Linux subsystem from Windows using a ssh client like PuTTY.
Répondre

Revenir à « Windows 10 »