Page 1 of 1

Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 21:32
by gusarg81
Hi,

I don´t know whats happened, But I can't login to my server anymore, it rejects my password (which was weird when It asked today, since I have stored my SSH keys in it.

Is there a way to access from KeyHelp to sshd settings?

OS: Ubuntu 24.04
KeyHelp version: Latest (upgraded one month ago from 22.04 to 24.04 using Keyhelp script).

Thanks in advance.

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 22:52
by technotravel
gusarg81 wrote: Wed 27. Nov 2024, 21:32 Hi,

I don´t know whats happened, But I can't login to my server anymore, it rejects my password (which was weird when It asked today, since I have stored my SSH keys in it.

Is there a way to access from KeyHelp to sshd settings?

OS: Ubuntu 24.04
KeyHelp version: Latest (upgraded one month ago from 22.04 to 24.04 using Keyhelp script).

Thanks in advance.
I don't know who is hosting your server (unless of course it's a bare metal in your flat ...) - but my provider offers an option to set a root password, in the web-interface of my account. Server must be shut down for this operation.

Maybe something like this is available ...

Edit: re-reading your post, I'm not sure to understand whether this is just about the Web-Interface of Keyhelp? If you can still access your server on the console via SSH, you could call "keyhelp login" to obtain an URL for immediate login

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 23:25
by gusarg81
I can´t login to SSH. Is my own server, I don't know why is rejecting my SSH keys (and password).
And is my own server hosted in a Datacenter.

Last resort: I will have to go personally to the Datacenter to check what is going on but I wanted to know if there was a way via KeyHelp Web panel or something... (I can login KeyHelp panel just fine...).

Thanks.

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 23:39
by 24unix
Are you trying to login as root?

Do you have any other ssh-enabled user?
(If not, you could add one via the panel)

If yes, can he login?
If yes: can he su - (and then root password)
Or can he sudo -i

edit:
it rejects my password (which was weird when It asked today, since I have stored my SSH keys in it.
It should not even ask for a password if you use public key auth.

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 23:44
by gusarg81
Hi,

There is only one allowed SSH user (as per configured in the ssh server with the AllowUsers), which is the one generated originally with the Ubuntu install. This the mayor problem now that I recall.

But I don´t remember If I've changed this behavior. How Can i create one with KeyHelp? I don't see that option, but is AllowUsers still active, I believe won't matter.

And yes, is way weird that is asking me for my password... That is what I am worried about.

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 23:45
by Alexander
You can enable "KeyHelp Admin Area -> Configuration -> Support Access" and send me the server IP + SSH port. I could than try to restore your regular login tomorrow (if I am able to log in this way).

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 23:50
by 24unix
gusarg81 wrote: Wed 27. Nov 2024, 23:44 How Can i create one with KeyHelp?
SCR-20241127-unen.png
Add the checkmark to SSH.

But, Alex already offerred help, there is nobody who knows KeyHelp better than him.

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 23:53
by gusarg81
Alexander wrote: Wed 27. Nov 2024, 23:45 You can enable "KeyHelp Admin Area -> Configuration -> Support Access" and send me the server IP + SSH port. I could than try to restore your regular login tomorrow (if I am able to log in this way).
Hi,

The IP/Host is server.gdnet.ar (or just gdnet.ar or 200.80.30.242). Port is default 22.

At the same time I am asking to the Datacenter to go tomorrow if this way is not possible.

Re: Can' t log in via SSH to my server anymore

Posted: Wed 27. Nov 2024, 23:56
by gusarg81
24unix wrote: Wed 27. Nov 2024, 23:50
gusarg81 wrote: Wed 27. Nov 2024, 23:44 How Can i create one with KeyHelp?

SCR-20241127-unen.png
Add the checkmark to SSH.

But, Alex already offerred help, there is nobody who knows KeyHelp better than him.
Oks, thanks. The problem is that user will not have sudo permissions for sure in case I need to fix SSH access. Or I am wrong?

Re: Can' t log in via SSH to my server anymore  [SOLVED]

Posted: Thu 28. Nov 2024, 00:03
by gusarg81
Oks guys, I've fixed the problem.

I have access with my user created with KeyHelp panel (by adding SSH permission) and then later inside the server, su - myuser.
To the problem seems that accidentally changed AllowUsers to an user from the Keyhelp panel (where is my mind these days!), which was the one I was available to login.

Sorry for the trouble and thanks for all the replied. Much appreciated as always.

Re: Can' t log in via SSH to my server anymore

Posted: Thu 28. Nov 2024, 00:12
by technotravel
Probably a silly idea - but have you considered the possibility that fail2ban has locked you out?

Re: Can' t log in via SSH to my server anymore

Posted: Thu 28. Nov 2024, 00:20
by gusarg81
technotravel wrote: Thu 28. Nov 2024, 00:12 Probably a silly idea - but have you considered the possibility that fail2ban has locked you out?
Nope, was the first thing I checked out. But now is fixed. Thanks.