can I change root password

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
topboss1

can I change root password

Post by topboss1 »

can I and how do I change root password in mint 18 Sarah ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
AscLinux
Level 4
Level 4
Posts: 477
Joined: Sat Oct 29, 2016 3:32 pm
Location: Acadiana
Contact:

Re: can I change root password

Post by AscLinux »

There is no root password by default. Why you need it? Generally, if you do not know how to enable root account you should not to do it.
Master Foo Discourses on GUI.
First Linux 1997. Last Windows 2004.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: can I change root password

Post by Cosmo. »

Mint does indeed set a password for the virtual user root during installation - in difference to Ubuntu. The password is identical with the password for the first user account. Of course it can be changed.

The really important question is, why do you want to change it? And on which places do you actually use it. As a member of the group sudo you do not need it at all.

Do you possibly want to change the password for your account?
needleroozer

Re: can I change root password

Post by needleroozer »

I can't speak for the OP, but I have a very good reason for asking this. I am trying to set up a Raspberry Pi Zero as a headless computer. To do this I need to edit some of the configuration files on the SD card. To do that, I need Linux. I have been wanting to use Linux Mint for some time, but I am not yet ready to dedicate a computer to it and do a permanent installation, nor do I want to cobble up a duel-boot just to set up the Pi. So I boot from a Linux Mint DVD and the default user - apparently the only user - is "mint", without a password. OK, but I still can't edit the files on the Pi SD card becaus they belong to root and I'm not root, I'm mint. I don't even know how to change mint's password, so even if mint were a member of sudo (which I doubt - and I don't know how to even check that) I couldn't invoke sudo because I don't know the password.

I'm at the point where I'm ready to look for some windows software that will allow me to access the Ext4 partition under Windows and edit the files there.

Frankly, while I understand the risks of logging in as root, the attitude here that "if you don't know how to do it you shouldn't" really flies in the face of the statement that "All Gurus once were Newbies". To not even answer the question of "how do I change my password" is frankly rude and makes me open to considering other operating systems. Even OpenBSD, which is openly hostile to stupid questions, provides an extensive MAN system where you can find most answers if you just look. The Linux Mint "Official User Guide" is frankly of little use.

So can someone PLEASE tell me how to change mint's password, how to make mint a member of sudo, how to activate root - whatever I need to do to edit these files? Thank you.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: can I change root password

Post by jimallyn »

man pages are also available on Mint and probably any other Linux distro for console commands and many applications. Open a terminal and type man passwd. I have changed passwords on other peoples systems a couple of times, but not enough that I have the syntax memorized. I hate to just tell people RTFM, but that's what I have to do quite often myself, so that's the best advice I can offer.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Pjotr
Level 24
Level 24
Posts: 20123
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: can I change root password

Post by Pjotr »

You can change your administrator password like this: https://sites.google.com/site/easylinuxtipsproject/5
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: can I change root password

Post by Cosmo. »

needleroozer wrote:So can someone PLEASE tell me how to change mint's password, how to make mint a member of sudo, how to activate root - whatever I need to do to edit these files? Thank you.
There is nothing to change. Open a terminal and enter groups, no you will see, that mint belongs to the groups sudo. The password is empty (just press the Enter key) and root does exist also (otherwise the system would not work at all).

All you have to do is to open the file manager, right click in the main pane, select the command to open as root -> done.
sbroccolo

Re: can I change root password

Post by sbroccolo »

You've been warned. Logging on as Root is dangerous. But I don't believe in telling people what they can or cannot do with their own computers. So here it is:
First go into the "Login Window" Go to the Options screen and enable "Login as Root"
Then open a terminal screen and

Type the following command:

sudo passwd

The following message will appear:

[sudo] password for [username]: [Type your user password and press return]

After that another message will appear, the following:

Type new UNIX password: [Type the root password you want]

Now the last thing you need to do, the following:

Retype new UNIX password: [Retype the root password you chosen before]

The following message will appear:

passwd: password updated successfully

If the above message showed up on your terminal, you can now use the root privileges by typing:

su

And then type the password you chosen. That's it!
BrianD

Re: can I change root password

Post by BrianD »

...and that lovely MAN system you applaud from BSD is actually a holdover from Unix and is available on every Linux installation (of any stripe) that I've ever logged into.

mint@mint ~ $ MAN passwd
MintBean

Re: can I change root password

Post by MintBean »

I've never yet seen a legitimate reason with Mint to login as root or change the root password and as has already been pointed out, none of the use-cases presented here have changed that point of view.
sbroccolo

Re: can I change root password

Post by sbroccolo »

There have been only two reasons that I have had to login as root. To transfer files between two different Linux installations and to reinstall grub after installing a second Linux but I wanted the grub from my "main" installation where I had already made my preferences. Yes, there are probably other ways to do it. But I find this way to be the simplest.
simonsaysthis
Level 2
Level 2
Posts: 59
Joined: Sun Jun 11, 2017 1:39 pm
Location: Pforzheim, Germany

Re: can I change root password

Post by simonsaysthis »

I only ever changed my root password once and that was because I had mistakenly captured it with CAPS lock and the thought of it somehow annoyed me. Other than that it is not good Linux practice to do things as root, especially not on a production system
acerimusdux
Level 5
Level 5
Posts: 633
Joined: Sat Dec 26, 2009 3:36 pm

Re: can I change root password

Post by acerimusdux »

needleroozer wrote:So can someone PLEASE tell me how to change mint's password, how to make mint a member of sudo, how to activate root - whatever I need to do to edit these files? Thank you.
sudo su
sfzombie13

Re: can I change root password

Post by sfzombie13 »

i came here to also find out how the root password was not set during installation and i cannot believe the answers i have read saying that you don't need to change it or that there are no reasons to login as root. this is beyond stupid and the main reason that linux malware is on the rise. as a security researcher, i know that the best way to prevent 94% (last time i read a stat on it) of all malware was to set the user of the computer to a non-admin user. you guys apparently do not understand how that works.
if it uses the same password for the root account and it is common knowledge, anyone writing malware also knows this and can elevate privileges with no effort at all. granted it isn't that hard anyway, but still, at least make an attempt at security. and there is a very good reason to login as root when doing maintenance or configuration changes. it may only be four letters extra to type, but if you login as root, you save those four letters every time and can also use the same scripts you have prepared (if you have them already done) without changing them to suit mint. realistically, i usually just sudo su, but that didn't work when i tried it with mint to get a command terminal. and as one user wrote here, i like to have full control over my system, which is the reason i use linux, along with the cost.
User avatar
karlchen
Level 23
Level 23
Posts: 18227
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: can I change root password

Post by karlchen »

Hello, sfzombie13.

Up to and including Mint 18.1, the Linux Mint installer will assign to user "root" the same password during installation, which you have chosen for your first user account.
Up to and including Mint 18.1, the command sudo su will work. Yet, I have always used sudo -i instead.

Starting with Mint 18.2, the Linux Mint installer will follow the same approach as the Ubuntu installer. User "root" will be prevented from logging in interactively by default, because user "root" is not assigned any password.
As a consequence, in the default configuration the command su will not work, because it expects to be given the password of user "root". The command sudo -i will still work and give me a root shell.

Best regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: can I change root password

Post by Cosmo. »

sfzombie13 wrote:i like to have full control over my system
You have full control with sudo and as a security researcher you are expected to know this.
sfzombie13

Re: can I change root password

Post by sfzombie13 »

i know how to get around it, and i also know i can do everything i need by getting a root shell. what i don't like is not having a separate admin password which prevents lots of attacks by unskilled or lazy criminals. it's about not being able to login as root and do the work i need like i enjoy doing it, i hate things limiting me. the only reason i am using mint now is for the ease of my travelers at project code. i need to be able to move around in it if i have any questions, but the travelers now are young and really enjoy linux. we were using slackware which is my favorite, but were having too many issues which started to eat up class time. it was actually a blessing in disguise as we learned much more by solving the problems than if everything had gone well. check out codewv dot org and see what you think of my concept. we have had four classes now and i am still super excited to be helping out. there are two kids in there that are going to go places if they keep it up and i help them stay out of trouble on their chosen paths.
yaye

Re: can I change root password

Post by yaye »

sfzombie13 wrote: what i don't like is not having a separate admin password which prevents lots of attacks by unskilled or lazy criminals.
I agree. So karlchen, with Mint 18.2 is it no longer possible to give the root account a password and login graphically as well? This is what finally drove me away from Ubuntu. If this is the case with Mint, I'll be looking for a new distro. Debian or Fedora.
User avatar
Pjotr
Level 24
Level 24
Posts: 20123
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: can I change root password

Post by Pjotr »

yaye wrote:is it no longer possible to give the root account a password
It is: sudo passwd

But this only makes sense for making it a bit more difficult for an attacker with physical access to your computer, to get root permissions on your machine by booting it into recovery mode.
yaye wrote: and login graphically as well?
Logging into a root desktop is beyond plain dumb. It's outright insane. Ask any experienced Linux user.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: can I change root password

Post by Cosmo. »

yaye wrote:with Mint 18.2 is it no longer possible to give the root account a password
This is easy and I had described it already 3 weeks ago. This is doable with all versions of Mint.
yaye wrote:and login graphically as well? .... If this is the case with Mint, I'll be looking for a new distro. Debian or Fedora.
Do as you like to insist in a mistake. Nobody cares.
Locked

Return to “Other topics”