Root Password prevents SSH and WinSCP
-
So, I just added a root password (as a step to install games through dosbox), and right after, I can no longer connect through SSH or WinSCP. Error message = "Connection Refused".
I followed these steps to the point: The root password is disabled by default (as is the case for Raspbian and many other linux distros).
before setting a root password, the following must be edited
sudo nano /etc/ssh/sshd_config
look for
PermitRootLogin without-password
change it to
PermitRootLogin yes
then ctrl+x to save,
next set your root password:
sudo passwd root
restart your Pi to register your changesAnd now SSH wont work. In putty i do as normal, put in "retropie" or IP, and neither work. I do not make it to the terminal where I can log in as "pi" with password "raspberry".
Can I from inside the Pi, disable the dassword again, or better, is there a way to keep the changes and still access the Pi through SSH?
I am running retropie 4.0.2 with Pi model 2 B.
-
@Kvitekvist if you log in as
pi
you can become root with the following command:sudo su
I think it's easier than all those configs...
-
To change the root password:
sudo passwdTo change your user password:
passwdTo change other users password:
sudo passwd USERNAMEDouble-check your Pi's IP address if it's on DHCP
You can do like @meleu suggested and just login as the 'pi' user and elevate privileges from there
-
Edited this post out because frankly, it wasn't helpful.
-
@Nightfire I am very new to the Rpi, so please explain how I can access the command line within the Pi, as I cannot access it from SSH?
-
@Kvitekvist said in Root Password prevents SSH and WinSCP:
how I can access the command line within the Pi, as I cannot access it from SSH?
USB keyboard. You can try undo the changes you made in /etc/ssh/sshd_config and maybe it will give you the SSH back.
-
@meleu So, press F4 + Any key, then: sudo nano /etc/ssh/sshd_config to undo the changes i did? Is this the right steps to get there?
-
@Kvitekvist said in Root Password prevents SSH and WinSCP:
@meleu So, press F4 + Any key, then: sudo nano /etc/ssh/sshd_config to undo the changes i did? Is this the right steps to get there?
I'm not sure if this was the only change you have made, but it seems the right thing to do.
BTW: Pressing F4 only is enough to exit emulationstation.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.