SSH root login failure

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

SSH root login failure

Post by alex.barylski »

I have finally figured out why I cannot connect to SSH @ work -- someone changed the port to 25 -- that reset to 22 eveything works -- sorta.

Now I can login remotely using my user/pass assgined to me but I cannot login remotely as root despite the following config setting:

Code: Select all

PermitRootLogin yes
I assume it's the password but the admin here swears he gave me the right password.

Assuming he has lost the password but we have physical access to the machine, how do we retreive the root password? :P
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: SSH root login failure

Post by Benjamin »

Just to check the password, have you tried to SU from a different account?

If the password is wrong I would search google for the steps you have to take in order to reset it, I know it's out there.

Might want to try the password with a space before it or after it, in case he pasted it in there with a space.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: SSH root login failure

Post by VladSun »

1. Boot from a live CD
2. create a directory
3. mount your HDD into this directory
4. chroot to this directory
5. execute passwd into CLI
6. eject the CD and reboot ;)

PS: You can't retreive it, but you can rewrite it this way
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: SSH root login failure

Post by alex.barylski »

Apparently Ubuntu has an 'administrator' account and remote root login are strictly forbidden, so I had to login as 'administrator' then:

Code: Select all

sudo su apt-get install xxx
Or something to that effect...I do recall reading that somewhere a few years ago, that Ubuntu was more 'secure' or 'limiting' in this way. :P

Once of the differences between Debian and Ubuntu I guess. :P
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: SSH root login failure

Post by Benjamin »

It's quite easy to just set the root password, then you can login as root.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: SSH root login failure

Post by alex.barylski »

It's quite easy to just set the root password, then you can login as root.
Is that why. Huh. If that is all it takes, I cannot see that being a big deal, no.

I still don't like the idea of using Ubuntu for a web server though. Extraneous overhead IMHO when a base Debian install with some minor tweaks would also do the trick. :P
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: SSH root login failure

Post by Jenk »

Code: Select all

sudo passwd
:p

or when on the grub boot screen, change runlevel to 1 (single user mode) which will log you in as root automatically.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: SSH root login failure

Post by VladSun »

PCSpectra wrote:

Code: Select all

PermitRootLogin yes
Don't do this ;) We have discussed it before, remember?
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: SSH root login failure

Post by alex.barylski »

Dn't do this We have discussed it before, remember?
I do, although this server is not 'solely' my responsibility (my server was a dev server behind a NAT router -- I wouldn't do this on a live server).

I want to know what the advantages Ubuntu has over Debian setup with the introduction of a Administrator account...why not just super and normal users? And sudo/su into root if required?
Post Reply