#Cannot SSH into my Ubuntu Server

26 messages · Page 1 of 1 (latest)

loud wave
#

So I have set up a new Ubuntu server transitioning from the micro PC I was using to a SFF OptiPlex. This is not the first time I have used Ubuntu Server but this is the first time I have ran into this issue. I was able to SSH in ONCE from my main PC, and once from my HTPC. Every time after that I am given this output.

Ubuntu Server 22.04.2 LTS

[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
[email protected]: Permission denied (publickey,password).```
I have tried searching online for some help but I have been thus far unable to fix the issue. I have tried deleting SSH keys from the machines I was trying to connect from. To no avail
 I am able to however connect to the computer from FileZilla without issue

This is the closest issue I could find a thread for online but trying the solution did not seem to do anything.  I appreciate any help or guidance, thank you!
https://askubuntu.com/questions/1435791/unable-to-ssh-into-ubuntu-server-20-04
loud wave
#

@knotty turret

knotty turret
#

do you use ftp/ftps or sftp via filezilla?

loud wave
#

I have normally always been able to get in via filezilla so sftp. Normally I use ssh for updating

knotty turret
#

interesting, if sftp works, ssh should work too. i assume you use the same IP and user to access it?

loud wave
#

Yep

knotty turret
#

do you use an ssh key or password with filezilla?

loud wave
#

I honestly dont know. I have always just logged into and the first time it prompts me about a ssh key I click accept or whatever and it lets me in.

knotty turret
#

ok, so you are probably using an ssh key then. next time you are connected to the server, check your /etc/passwd file. if sftp works and ssh does not with identical credentials, there is probably a different shell set for that user (like /usr/sbin/nologin or /bin/false or something like that) instead of zsh or bash. which would prevent you from logging in

loud wave
#

After that it doesnt prompt me about an ssh key.

knotty turret
#

it might not have been an ssh key at all actually, maybe that dialogue was just to trust the ssh connection to that server. that typically happens for the first time when you connect

#

but in any case, check your /etc/passwd file for your user and see which shell is configured there. i strongly suspect your user may have an invalid shell set, preventing it from logging in

loud wave
#

Would it be the sshd?

knotty turret
#

what is your question exactly? sshd handles both sftp and ssh connections

#

in /etc/passwd you are looking for the line that starts with woodmansff:x and at the end it should say /bin/bash or /bin/zsh or something. if it says /usr/sbin/nologin, /bin/false or similar, thats your problem. the user is not allowed to use any shell, so it would only work via sftp

loud wave
#

Okay I see what you mean.

#

If I was trying to log in with the wrong user would that cause the same kind of issue?

knotty turret
#

the error message would also be "permission denied", yes. thats why i tried to make sure your working sftp connection is using the same credentials, to exclude them being wrong as the cause 🙂

loud wave
#

Sorry my linux knowledge is basically youtube videos explaining how to download things like pihole and then copy pasting commands for certain things.

knotty turret
#

thats how most of us start, nothing wrong with that

#

ive been using linux for a long time and there are still so so many things i dont know. youll never stop learning

loud wave
#

I think my problem is way dumber than anything technical. I think I was trying to log in with a user that didnt exist. I was trying to log in as user woodmansff but the user is woodman. I think I named the system woodmansff.

knotty turret
#

awesome 🙂 even better

#

trust me, it wont be the last time you make a stupid mistake. ive been a software engineer for over 20 years and im still making stupid mistakes that make me want to smash my head against the wall more often than id like to admit 😛 no shame in that

loud wave
#

Appreciate your help. Thank you!