Mariusmssj4
Posts: 15
Joined: Thu Jan 23, 2014 10:37 am

root SSH login not working with Jessie, Access denied

Tue May 12, 2015 9:36 am

I've upgraded my pi image to Jessie and having issues with connection via SSH to the root user. Upon trying to connect it says Access denied.

It happily connects to Pi user but not root. I've renamed root password and everything but still doesn't work.

Any ideas what's the problem?

Thanks

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: root SSH login not working with Jessie, Access denied

Tue May 12, 2015 9:52 am

The root user is disabled by default... you may enable it, and then you must also enable root logon. Most of the time that is a bad idea (now, on a PI it might not be a big deal, especially if its a toy). It really is best to logon as some other user (PI) and then use sudo to access root privileges.
marcus
:ugeek:

asavah
Posts: 373
Joined: Thu Aug 14, 2014 12:49 am

Re: root SSH login not working with Jessie, Access denied

Tue May 12, 2015 9:55 am

It's supposed to be that way, it's for security.

If you need to enable ssh login for root with password (not recommended!!!) do the following:

Code: Select all

sudo nano /etc/ssh/sshd_config
search for the line starting with

Code: Select all

PermitRootLogin
Set it to a value that suits your needs:
PermitRootLogin
Specifies whether root can log in using ssh(1). The argument
must be "yes", "without-password", "forced-commands-only" or
"no".

If this option is set to "without-password" password authentica-
tion is disabled for root.

If this option is set to "forced-commands-only" root login with
public key authentication will be allowed, but only if the
command option has been specified (which may be useful for taking
remote backups even if root login is normally not allowed). All
other authentication methods are disabled for root.

If this option is set to "no" root is not allowed to log in.
Save the file and restart ssh server.

yagosan
Posts: 2
Joined: Thu Dec 06, 2012 2:23 am

Re: root SSH login not working with Jessie, Access denied

Mon Dec 14, 2015 10:04 pm

Im moving back to wheezy. I cannot log in as root or change to a static IP address with jessie, longer booting and forced to GUI, many problems...... :?

pete_l
Posts: 14
Joined: Thu May 17, 2012 7:08 am

Re: root SSH login not working with Jessie, Access denied

Sat Dec 19, 2015 10:08 pm

First thing you have to do is supply a password for the root user. To do this, log in as the default Pi user and run:

Code: Select all

sudo bash
which will give you a root privilege shell.
Next set a password for the root user:

Code: Select all

passwd <whatever password you like>
and repeat it when asked.
You can now "go" to the root user from your ordinary user any time you like, just run

Code: Select all

su - 
and give the root password you chose earlier

Once you have a root password, then you must use your new found root access :D to edit the file
  • /etc/ssh/sshd_config
note the d - it's sshd_config, not ssh_config. Then change the line to read as follows (if you're ready to use a root shell, then you don't need instructions on using an editor)

Code: Select all

PermitRootLogin yes
Then restart the sshd service (you do know how to do that, don't you? If not you shouldn't be playing with root level commands.

After this you can ssh in as the root user.

Aros
Posts: 37
Joined: Tue Apr 28, 2015 9:08 am

Re: root SSH login not working with Jessie, Access denied

Tue Jul 24, 2018 4:47 pm

I have the same problem. I am getting Access denied while connecting with Putty. The password is 100% correct. I do have PermitRootLogin se to yes but it still doesn't work.

I can ssh from the pi to itself with the very same password...

UberNarf
Posts: 1
Joined: Thu Aug 22, 2019 5:47 am

Re: root SSH login not working with Jessie, Access denied

Thu Aug 22, 2019 5:55 am

I've got the same problem.
Edited my /etc/ssh/ssh_config file, checked it for wrong or misleading entries several times, but still yet i can't ssh to the pi as root.
PermitRoolLogin = yes and passwd done, ssh service and pi were restarted.
Now there's the interesting part....
The password i entered is 100 % correct, nevertheless i get this logged

(I'm aware of root ssh being a security risk, sadly this pi is used at work and those ppl in charge don't wanna understand such stuff.....)

Code: Select all

Aug 22 07:40:30 raspberrypi sshd[724]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser=
Aug 22 07:40:32 raspberrypi sshd[724]: Failed password for root from 10.48.150.138 port 58858 ssh2
Aug 22 07:40:39 raspberrypi sshd[724]: Failed password for root from 10.48.150.138 port 58858 ssh2
Aug 22 07:40:45 raspberrypi sshd[724]: Failed password for root from 10.48.150.138 port 58858 ssh2
Aug 22 07:40:46 raspberrypi sshd[724]: Connection reset by authenticating user root 10.48.150.138 port 58858 [preauth]

I'd be happy for any input or anyone pointing me in the right direction in this case.
Greetz
Narf

Return to “Advanced users”