HomeAboutMailing ListList Chatter /0/0

ubuntu 18.04lts remote ssh

2019-09-04 by: Nick Smith
From: Nick Smith 

Im actually stumped with an issue that i cant seem to find the answer to.
Its been a while since ive had to do a fresh install of ubuntu and it seems
things have changed a bit.

In the past ive had no issues sshing into a fresh install without the need
to configure the service or open any ports.  When i try to ssh into this
new install i get a username prompt but it will never take any password i

Ive tried setting the password for root and changing the setting in the
sshd_config accordingly to allow root logins:
PermitRootLogin yes
StrictModes no

Restarted the service and even rebooted the box but i still cannot ssh into
this box with either the user i setup during install or root.  Each time it
just says access denied on the password.
I see log entries in auth.log but it just says session opened for user
root, session closed for user root, so not very helpful.

Have not found anything else to try.
Any ideas on how to resolve this?

Also noticed they started using netplan.io for network config and changed
the name from eth0 to ens160.  Not a fan.

Thanks for the help.

Nick Smith
nick at nicksmith dot us

=============================================================== From: John Lodden ------------------------------------------------------ If you are going to use password login for ssh make sure you have this set: PasswordAuthentication yes In the sshd_config file. -jrl

=============================================================== From: Nick Smith ------------------------------------------------------ That was set, as was PermitEmptyPasswords no, still the same result after restarting ssh and the box. Thanks.

=============================================================== From: Jason Brown ------------------------------------------------------ Ubuntu disables root logins in at least one other way (passwd file) and creates an administrative user called "ubuntu" to use instead. You should use sudo for commands. Have you tried connecting as the ubuntu user?

=============================================================== From: Nick Smith ------------------------------------------------------ I checked the /etc/passwd file and it does have /bin/bash listed not nologin for root. I also see the user i created at install but do not see an ubuntu user in that file. I thought it created the user i specified at install the sudo user, im not familiar with any ubuntu user. I did try to login as ubuntu and the password i set at install among other things and i still get access denied. Its crazy how much time ive wasted just trying to get this base OS going so i can ssh in and actually do some work lol. I restarted with -vvvvvvvvv but i have not seen where that gives any more information. Anything else i can look at?

=============================================================== From: Jason Brown ------------------------------------------------------ I assume you have physical access and can log into the console? If so, first verify that it is actually sshd listening on port 22, like this: sudo netstat -nltp | grep 22 The output should show "sshd" as the process name in the far right column. tcp 0 0* LISTEN 821/sshd tcp6 0 0 :::22 :::* LISTEN 821/sshd If the process name is not "sshd" , you might have installed something like proftpd or other ftp/sftp server that took over port 22. If the process name is correct, try a connection from the local terminal. ssh -vv youruser@localhost (or similar) If that works, I would look into firewall, network configuration, or some other restriction based on the origin of the connection (hosts_deny, UFW, and so on).

=============================================================== From: wes ------------------------------------------------------ You mentioned that you see the user you created at install in the passwd file. Have you tried to SSH into the system with that user? What happens then? -wes

=============================================================== From: Nick Smith ------------------------------------------------------ I show it listening on 22 using that command. I can ssh locally on the console to itself when i use the IP address, it does not work if i use localhost or I can ssh locally on the console with root and the user i set up during install. When i try to do it remotely i get access denied after the password prompt using the same passwords that worked locally, both root and local user. I have confirmed that ufw is inactive so nothing should be blocking this from happening. Confirmed hosts.allow and hosts.deny are empty. I use to like ubuntu because it normally worked out of the box and didnt have excessive restrictions turned on from the start, seems like that has changed.

=============================================================== From: wes ------------------------------------------------------ what is the local IP address? what is the IP address of the other system you're trying to connect from? I suspect the struggle you're having is not ubuntu's fault. -wes

=============================================================== From: Nick Smith ------------------------------------------------------ The machines are all on the same subnet, 172.31.5.xxx Networking seems fine, i can apt-get anything, ping gateway, dns servers, vmware is connected to the correct network etc. I have spun up several VMs in the course of testing some apps and ive always used the same IP, (blow away first vm, reinstall new vm, never 2 on at the same time) so i thought putty might have an old key stored but i went through the registry where it saves them and removed all of them so it would prompt to save the key again but it didnt help. Well, after testing ssh from another linux server I am able to ssh from another server into that one as both root and a regular user. so it seems my workstation somehow has a problem with SSHing to that box, but i can do so with every other VM ive tried. Very odd. At least i can use that as a workaroud, just dont know whats up with my workstation now. Winblows ugh. Thanks for the responses from everyone.

=============================================================== From: Dave Brockman ------------------------------------------------------ mn. =C2=A0 =C2=A0 =C2=A0821/sshd =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :::* =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 l. Yes to all the above. None of these would apply if he is getting an actual login prompt. Cheers, -dtb X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQ2h1Z2FsdWcg bWFpbGluZyBsaXN0CkNodWdhbHVnQGNodWdhbHVnLm9yZwpodHRwOi8vY2h1Z2FsdWcub3JnL2Nn aS1iaW4vbWFpbG1hbi9saXN0aW5mby9jaHVnYWx1Zwo=

=============================================================== From: Ed King ------------------------------------------------------ which makes me think its a problem with incompatible ciphers... a probl= em I had about 2 years ago when I was ssh'ing into a really old mac running= a really old sshd X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQ2h1Z2FsdWcg bWFpbGluZyBsaXN0CkNodWdhbHVnQGNodWdhbHVnLm9yZwpodHRwOi8vY2h1Z2FsdWcub3JnL2Nn aS1iaW4vbWFpbG1hbi9saXN0aW5mby9jaHVnYWx1Zwo=

=============================================================== From: Billy ------------------------------------------------------ I troubleshoot this stuff by starting another daemon in debug mode in anothe= r window: sshd -p 2222 -d Then ssh to that on the same host in another window: ssh localhost -p 2222 And again from a remote client... --b lem I had about 2 years ago when I was ssh'ing into a really old mac running= a really old sshd