Permission denied when using SSH to connect to a remote server
Matthew Martinez
I am new to ssh and have it installed in two Linux machines (Ubuntu 20.04.3 and Zorin OS 16). I tried to access from one machine to the other via ssh. The command I use is ssh username@ip-address, but I got an error saying Permission denied despite entering the correct password. I have tried the following ways, but none of them is working.
- Change root password and enable PermitRootLogin in /etc/ssh/sshd_config.
- Enable PasswordAuthentification
- Reinstall ssh
1 Answer
The "username" in ssh username@ip-address is actually "root" in this case, since it seems you're trying to login as root, so that makes the command: ssh root@ip-address.
Also, on the remote server, make sure sshd is running. If using systemd, you can run systemctl status ssh or systemctl status sshd (sudo shouldn't be necessary for 'status') depending on distro.