hatcreek68
Posts: 8
Joined: Tue Dec 26, 2017 7:54 pm

simplified steps to login as root / set root password.

Sat Jun 16, 2018 3:47 pm

HOW
Step 1 -Set root password
sudo passwd root

Step 2 - allow root login
just go to /etc/ssh/sshd_config change the line as below
PermitRootLogin yes #(i just added this to the bottom of the file)

WHY!?!!?
What about security! This is a hobby learning pi, not a secure pi, only login as root as needed not to upset system files.

I want to edit text pi files on winscp from a PC; sometimes that means root access needed to edit - darkice.cfg for example. It's a long file, easier to copy-paste from backups or otherwise.

This is not a debate post on the security risk of allowing root login - plenty of those posts on other threads hence this simplified guide:

DirkS
Posts: 10743
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: simplified steps to login as root / set root password.

Sat Jun 16, 2018 3:59 pm

hatcreek68 wrote:
Sat Jun 16, 2018 3:47 pm
This is not a debate post on the security risk of allowing root login - plenty of those posts on other threads hence this simplified guide:
Well, that means that your post is pretty superfluous.
The information you give does not add anything to what is already widely available...

fbe
Posts: 690
Joined: Thu Aug 17, 2017 9:08 pm

Re: simplified steps to login as root / set root password.

Sat Jun 16, 2018 4:56 pm

If you had installed a public key for root ssh login you wouldn't need to set a root password.

User avatar
jahboater
Posts: 8165
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: simplified steps to login as root / set root password.

Sat Jun 16, 2018 6:04 pm

and on the command line:

sudo su

will get you a root shell without needing a password.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: simplified steps to login as root / set root password.

Sat Jun 16, 2018 8:06 pm

I want to edit text pi files on winscp from a PC
JFI - as an alternative , I run samba on my Pii and then just edit any file using any editor (usually Notepad++) that runs on my PC

This the smb.conf file I use to give me access

Code: Select all

======================= Global Settings =======================
[global]
workgroup = WORKGROUP
wide links = yes
unix extensions = no
dns proxy = no
#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
security = user
map to guest = Bad User
guest account = pi
#======================= Share Definitions =======================
[root]
comment = Admin Config Share
path = /
browseable = yes
force user = root
force group = root
admin users = pi
writeable = yes
read only = no
guest ok = yes
create mask = 0777
directory mask = 0777
#-------------------------------------------------------------------
[pi]
comment = pi user /homepi folder
path = /home/pi
browseable = yes
force user = pi
force group = pi
admin users = pi
writeable = yes
read only = no
guest ok = yes
create mask = 0777
directory mask = 0777

donbrew
Posts: 85
Joined: Sun Sep 04, 2016 2:32 pm

Re: simplified steps to login as root / set root password.

Tue Jul 03, 2018 4:06 am

I agree since I hate having to type in terminal. If the path is really long it gets to be a pain proof reading. Click and edit is much easier and you can easily keep the file in Notepad++ while you test it.

I hate looking like a TV show Linux nerd touch typing a path at 80 WPM to edit a 2 line file when I could just click the mouse on a file.

I don't use my Pi for any financial transactions and I am ready to admit that it was my action that borked the OS, that's why we have backups.

If you are really skeered you can always disable the root when you are done.

And I was happy this thread was here near the top of the pile today when I needed a refresher on a new SD card. Everytime I do something in Linux seems like I have to GoOgle for help. I never can remember the right options for any command, if I remember the command.

ghans
Posts: 7893
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: simplified steps to login as root / set root password.

Tue Jul 03, 2018 5:21 am

If you are on the command-line, try using the TAB key more often. Bash has auto-completion.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Raspberry Pi OS”