OpenSSH Server Setup in WSL

preview_player
Показать описание
In this video, we learn how to set up the OpenSSH server in the Windows Subsystem for Linux (WSL).

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

🌐 Social Media & Contact 🌐

Рекомендации по теме
Комментарии
Автор

I do recommend creating SSH keys using ED25519 algorithm instead of the default RSA. The former is safer, newer and shorter as well

costa
Автор

Thank you very much. I tried this `sudo ufw allow ssh` but got an error `ERROR: Couldn't determine iptables version`. I have installed it `sudo apt install iptables` but still got the same error.

KhalilYasser
Автор

ur great and two precisions i stay 4 hours to say a problem and dont ask gpt yt is best : if u dont have systemctl its the good commande sudo service ssh status to say if ssh is open and sudo service ssh restart after the modification in the backup maybe and create a new authorized_keys with sudo nano authorized_keys and copy in the backup content after move with sudo cat backup

pll
Автор

Thank you for the video. Could you show us how to connect via the internet instead of through the local windows system?

mateosabando
Автор

I have two questions: a) How can u do the viceversa? I mean, connect from the WSL to Windows. I think that's not as easy. I've downloaded an ssh-server application and it supose to be running. At the same time, I try to configure Firewall. But I cannot connect.
b) There is other way to share the keys? I mean, this example is easy to implement because access to the File System of each OS very quickly, but how if we pretend to connect from other device? We need to send the keys by email or with a pendrive?

facundolubo
Автор

hi, at "ssh-keygen -A" i get the error: "ssh-keygen: gnerating new host keys: DSA could not save your public key in ... : permission denied". What can I do about it?

TheBerni
Автор

I am following this video step by step. Does anyone know why at 5:18 I get this error:
cp: cannot create regular file No such file or directory

kasra
Автор

Thanx man i want more on wsl btw you are the great teacher

prashlovessamosa
Автор

How come the ls command available from your cmd.exe? Is it standard behavior? 😅

MaxMustermann-ongd
Автор

DO NOT override the existing KEY!!! I REPEAT DO NOT OVERRIDE THE EXISTING KEY!!! YO! What are you doing here?

jojojojojojojo
Автор

so, why did you copy the id_rsa.pub file from the .ssh directory to the desktop when you could ave just cd'dto the .ssh directory from /mnt/users/*/.ssh?

rickgaine
Автор

Unfortunately, this is a deprecated method for ssh into WSL. Better to ssh into the Windows host but in a way that has system32's default shell configured to match the shell of your default distro in WSL2.

Once you ssh into the Windows host, it requests a shell, the default shell. If that matches your default Linux distribution' shell in WSL2, then your default Linux also gets launched upon ssh into the Windows host. Cleaner and simpler. No need to repeatedly verify configs or run a script or job to fix port forward IP address, which is revised following a WSL shutdown. No need to configure firewall to open another port.

Ssh to Windows' openssh-server, authenticate with Windows, Windows finds its system32 default shell, and if configured to match that of the WSL linux distro, then that distro gets launched, with Windows not WSL handling TCP traffic.

Source: Scott Hanselman blog post dated August 4, 2020. Go there for more details and his clear instructions on a quick and easy setup.

Nice video, nice channel 👍

Kindest regards, friends and neighbours.

chromerims
Автор

I’m confused why you are doing this. What’s the use case?

pluto