👉 https://amzn.to/4aLHbLD 👈 You’re literally one click away from a better setup — grab it now! 🚀👑 As an Amazon Associate I earn from qualifying purchases. Ubuntu: SSH error: Permission denied, please try again Question: I have an Ubuntu server setup using amazon ec2 instance. I need to connect my desktop (which is also a ubuntu machine) to the ubuntu server using SSH. I have installed open-ssh in ubuntu server. I need all systems of my network to connect the ubuntu server using SSH (no need to connect through pem or pub keys). Hence opened SSH port 22 for my static IP in security groups (AWS). My SSHD-CONFIG file is: Package generated configuration file See the sshd_config(5) manpage for details What ports, IPs and protocols we listen for Port 22 Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: #ListenAddress 0.0.0.0 Protocol 2 HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key #Privilege Separation is turned on for security UsePrivilegeSeparation yes Lifetime and size of ephemeral version 1 server key KeyRegenerationInterval 3600 ServerKeyBits 768 Logging SyslogFacility AUTH LogLevel INFO Authentication: LoginGraceTime 120 PermitRootLogin yes StrictModes yes RSAAuthentication yes PubkeyAuthentication yes #AuthorizedKeysFile %h/.ssh/authorized_keys Don't read the user's ~/.rhosts and ~/.shosts files IgnoreRhosts yes For this to work you will also need host keys in /etc/ssh_known_hosts RhostsRSAAuthentication no similar for protocol version 2 HostbasedAuthentication no Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication #IgnoreUserKnownHosts yes To enable empty passwords, change to yes (NOT RECOMMENDED) ... (Please watch the video for the full question) Solutions Sample (Please watch the whole video to see all solutions, in order of how many people found them helpful): == This solution helped 11 people == You've locked the account. From the manpage of usermod(8): -L, --lock Lock a user's password. This puts a '!' in front of the encrypted password, effectively disabling the password. Now look at your shadow line: ubuntu:!$6$rWDSG...HSi1:15347:0:99999:7::: Unlock it: usermod -U ubuntu Important note! If this user is preinstalled on the system it may be locked for a reason (security reasons), but I cannot decide that for you since this isn't a regular Ubuntu install apparently. ---- If the above makes you feel uncomfortable, you could create a separate user: sudo adduser username and answer the questions. You should be able to login just fine. Also make it able to become root (use sudo) by adding it to the sudo group: sudo adduser username sudo In case you need to switch to the ubuntu user on the command line, you'll have to use your elevated privileges, because you can't provide credentials for the same reason as why you can't log in using SSH. Now, log in using SSH as username, and run this to become ubuntu: sudo su -l ubuntu For security reasons I would not advise to use root to log in directly. == This solution helped 2 people == I found where the issue is and fixed. I have created a new user (named: senthil) and just used it for SSH. In Ubuntu, I feel that when we create a new user, by default the root user's password will be assigned to the new user. Even then, reset and assign some new password to the newly created users. Once after the user password reset and making the following changes in sshd_config, now I am able to connect all my systems (from my network) to remote server. Please Note: I have switched off all SSH authentications (like RSAAuthentication, PubkeyAuthentication and KerberosAuthentication).. I have turned on only the PasswordAuthentication. Thank You. With thanks & praise to God! With thanks to all the many who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music & music license: https://www.bensound.com/royalty-free... | Images & images license: https://stocksnap.io/license and others | With thanks to user Tshepang (https://askubuntu.com/users/2591), user Senthil Kumaran (https://askubuntu.com/users/98428), user Sadee (https://askubuntu.com/users/605870), user gertvdijk (https://askubuntu.com/users/88802), user Dang_Ho (https://askubuntu.com/users/582628), user Abdennour TOUMI (https://askubuntu.com/users/159179), and the Stack Exchange Network (http://askubuntu.com/questions/315377). Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything should be amiss at Roel D.OT VandePaar A.T gmail.com.