Category: Linux

Raspberry Pi Connection closed while doing remote SSH

Faced an issue of unable to connect remotely to my raspberry pi remotely over ssh. Enabled password based authentication etc in sshd_config file. Still the issue not resolved. Below commands assisted in the resolution of the problem.

sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server
sudo systemctl stop ssh
sudo systemctl start ssh

Source: Raspberry Pi Connection closed SSH – Stack Overflow

How to set new user password in Ubuntu WSL 22.04?

Open terminal using ‘cmd.exe’

run the wsl with root user

type passwd <username> to modify the user password

Once done type ‘exit’ to exit wsl.

Now use wsl and check any command with sudo.

C:\Users\yodas>wsl -u root
root@localhost:/mnt/c/Users/yogi# passwd yogi
New password:
Retype new password:
passwd: password updated successfully
root@localhost:/mnt/c/Users/yodas# exit
logout

Source: Unable to change the root password in Windows 10 WSL – Ask Ubuntu