Activating The Root Account (I Want To Use Su Not Sudo)

Help with issues regarding installation of Debian

Activating The Root Account (I Want To Use Su Not Sudo)

Postby Caitlin » 2017-06-23 17:11

When installing Stretch I chose NOT to create a root account. Big mistake. It didn't ask me for a root password, and only allows me root access though sudo. Not as convenient.

I tried to put back the root account. Useradd wouldn't let me do it as it said root already exists. I tried using usermod to unlock it, and it said I couldn't do that as that would create a passwordless account. So I added a password, then was able to unlock it.

But when I tried to log on to root, it wouldn't let me -- it said wrong password.

What is the best way to construct a proper root account? (Without reinstalling.) More to the point, how can I get su (not sudo) to work?

Please don't ask me why I want to use su instead of sudo.

Caitlin
Caitlin
 
Posts: 237
Joined: 2012-05-24 07:32

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby acewiza » 2017-06-23 17:42

Caitlin wrote:But when I tried to log on to root, it wouldn't let me -- it said wrong password.


Why can't you change the root password, like so?

Code: Select all
sudo passwd root
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
User avatar
acewiza
 
Posts: 271
Joined: 2013-05-28 12:38
Location: Out West

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby GarryRicketson » 2017-06-23 17:44

As acewiza says, you should be able to do it using sudo

There are a few ways to do this.
Try first:
Code: Select all
man passwd

PASSWD(1) General Commands Manual PASSWD(1)

NAME
passwd - modify a user's password

SYNOPSIS
passwd [user]

Using sudo:
Code: Select all
sudo passwd root

and you should get prompted, asking to enter a password,
then a again, to confirm it,
I am not positive on this because I have never used "sudo" so I do not
know if sudo can set "root" s password,..but it should be able to.
Note: root is the "user", so that is why :
Code: Select all
passwd root

'man passwd' gives more details.

If that does not work, this other works, ...


http://www.wikihow.com/Change-the-Root-Password-in-Linux
Skip down to the part on if you have forgotten or lost the password.

There also are several threads on the forum about this,
http://forums.debian.net/search.php?st=0&sk=t&sd=d&sr=posts&keywords=set+root+passwd
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4453
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby GarryRicketson » 2017-06-23 17:47

Please don't ask me why I want to use su instead of sudo.

No need to ask that, and please do not ask me why I have never used "sudo" :mrgreen:
User avatar
GarryRicketson
 
Posts: 4453
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby luvr » 2017-06-23 20:17

Caitlin wrote:It didn't ask me for a root password, and only allows me root access though sudo. Not as convenient.

Why "not so convenient"? (Mind you, I'm not asking why you prefer su over sudo—that is you call entirely. I just wonder if, perhaps, you are unaware of the different ways in which sudo can be used.)

With sudo, you can run a single command, like so:
Code: Select all
sudo COMMANDLINE

Alternatively, you can become root, as follows:
Code: Select all
sudo -s

Last but not least, you can become root and run a login shell, like this:
Code: Select all
sudo -i

The most immediately apparent difference between the “-s” and “-i” options, is the working directory that will be set once you become root: “-s” will not change your working directory, while “-i” will enter the home directory of the root user—i.e., normally ‘/root’. In either case, run the exit command to return to your own user account.

I tried to put back the root account. Useradd wouldn't let me do it as it said root already exists.

Yes, the root user account existed, but it was locked.

What is the best way to construct a proper root account? (Without reinstalling.)

First set a password, then unlock the account—e.g.:
Code: Select all
sudo -s
passwd root
passwd -u root
exit

You should then be able to use the su command to become root:
Code: Select all
su -

Of course, when prompted, you will have to type the root password that you have just set.
luvr
 
Posts: 79
Joined: 2016-07-21 19:39
Location: Boom - The Home Town of Tomorrowland, Belgium

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby HuangLao » 2017-06-23 23:14

luvr wrote:
Caitlin wrote:It didn't ask me for a root password, and only allows me root access though sudo. Not as convenient.

Why "not so convenient"? (Mind you, I'm not asking why you prefer su over sudo—that is you call entirely. I just wonder if, perhaps, you are unaware of the different ways in which sudo can be used.)

Of course, when prompted, you will have to type the root password that you have just set.


seriously, why post this when he clearly does not want to use sudo that way and prefers su! :roll:
User avatar
HuangLao
 
Posts: 340
Joined: 2015-01-27 01:31

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby luvr » 2017-06-24 08:05

HuangLao wrote:seriously, why post this when he clearly does not want to use sudo that way and prefers su! :roll:

Documentation. Others may have a similar question, but not have such strong preferences. This may help them make an informed decision.
Last edited by luvr on 2017-06-25 19:27, edited 1 time in total.
luvr
 
Posts: 79
Joined: 2016-07-21 19:39
Location: Boom - The Home Town of Tomorrowland, Belgium

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby Caitlin » 2017-06-25 17:25

Very strange --

As I said, I gave root a password, then unlocked it, then tried to log on as root -- and it said wrong password. (I'm sure the password I assigned it was the password I tried to log on with.)

Then (according to the advice above) I used sudo passwd root to change root's password (again using the same password as before), but this time when I tried to log on, it worked. Like I said, very strange.

Film at 11.

BTW, the prior post is quoting me as having said "seriously, why post this when he clearly does not want to use sudo that way and prefers su!". I did not say this.

Caitlin
Caitlin
 
Posts: 237
Joined: 2012-05-24 07:32

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby luvr » 2017-06-25 19:29

Caitlin wrote:BTW, the prior post is quoting me as having said "seriously, why post this when he clearly does not want to use sudo that way and prefers su!". I did not say this.

Sorry—I hadn't noticed the nested quotings, which apparently confused the forum.
I removed the superfluous quotings, and it should be OK now.
luvr
 
Posts: 79
Joined: 2016-07-21 19:39
Location: Boom - The Home Town of Tomorrowland, Belgium

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby luvr » 2017-06-25 19:34

Caitlin wrote:Very strange

I took a closer look at this issue, and documented my findings in this other thread on this forum.
luvr
 
Posts: 79
Joined: 2016-07-21 19:39
Location: Boom - The Home Town of Tomorrowland, Belgium

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby Caitlin » 2017-06-26 03:01

luvr wrote:I removed the superfluous quotings, and it should be OK now.

Thank you. :)

luvr wrote:
Caitlin wrote:Very strange

I took a closer look at this issue, and documented my findings in this other thread on this forum.

I guess I'll never really know why this happened; but if the second password reset "took", I'm happy.

Thanks again.

Caitlin
Caitlin
 
Posts: 237
Joined: 2012-05-24 07:32

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby Caitlin » 2017-07-13 08:06

Okay, now I can use su to get root access, and I can't use sudo (which is what I want). Thanks to all who helped.

But when I first used Synaptic, it gave me a choice of (internally) issuing su or sudo. I chose sudo at the time. Now it asks for a password, but won't take the root password, but will accept my user account password.

Is there some way of changing this at this time? Perhaps if I delete a configuration file somewhere, it will ask me to choose again?

I poked around all my "dot" files in home and all the files with synaptic in their name but didn't find anything that would seem to do it.

Caitlin
Caitlin
 
Posts: 237
Joined: 2012-05-24 07:32

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby luvr » 2017-07-13 09:12

Caitlin wrote:I chose sudo at the time. Now it asks for a password, but won't take the root password, but will accept my user account password.

Is there some way of changing this at this time?

First, run the following command to verify the “libgksu-gconf-defaults” setting:
Code: Select all
$ update-alternatives --display libgksu-gconf-defaults
It will probably tell you that libgksu-gconf-defaults is currently in manual mode, and that it points to “gconf-defaults.libgksu-sudo”:
Code: Select all
libgksu-gconf-defaults - manual mode
  link best version is /usr/share/libgksu/debian/gconf-defaults.libgksu-su
  link currently points to /usr/share/libgksu/debian/gconf-defaults.libgksu-sudo
  link libgksu-gconf-defaults is /usr/share/gconf/defaults/10_libgksu
/usr/share/libgksu/debian/gconf-defaults.libgksu-su - priority 20
/usr/share/libgksu/debian/gconf-defaults.libgksu-sudo - priority 10

Since the “gconf-defaults.libgksu-su priority is the higher one, you can simply switch the setting to auto mode (as root):
Code: Select all
# update-alternatives --auto libgksu-gconf-defaults

Should the priorities have been switched on a new Debian install (which I doubt will be the case, but just to be sure), you will have to manually select the “gconf-defaults.libgksu-su” option:
Code: Select all
# update-alternatives --set libgksu-gconf-defaults /usr/share/libgksu/debian/gconf-defaults.libgksu-su

Alternatively, if you prefer to configure the setting interactively:
Code: Select all
# update-alternatives --config libgksu-gconf-defaults
and, from the list of options displayed, select the one labelled “gconf-defaults.libgksu-su”.

Next (again as root), run the following command:
Code: Select all
# update-gconf-defaults

You will most likely have to log out and log back in again for these changes to take effect.
luvr
 
Posts: 79
Joined: 2016-07-21 19:39
Location: Boom - The Home Town of Tomorrowland, Belgium

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby wizard10000 » 2017-07-13 09:42

Caitlin wrote:I guess I'll never really know why this happened; but if the second password reset "took", I'm happy.


It's a known bug in the installer.

https://bugs.debian.org/cgi-bin/bugrepo ... bug=866206

edit: IMO the easiest way to fix this is -

1. When grub starts, hit 'e' to edit the startup environment.

2. In the editor, find the line that starts with 'linux' and add

Code: Select all
init=/bin/bash


to the end of that line and hit esc or F10 to boot the machine.

3. Next, remount your root filesystem read-write like this -

Code: Select all
mount -no remount,rw /


4. Change root's password like this -

Code: Select all
passwd root


5. Reboot. Done :)
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1218
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Activating The Root Account (I Want To Use Su Not Sudo)

Postby Caitlin » 2017-07-24 14:01

I tried all the above suggestions, one at a time, and tested Synaptic authorization after each one:

# update-alternatives --auto libgksu-gconf-defaults
# update-gconf-defaults
reboot
# update-alternatives --set libgksu-gconf-defaults /usr/share/libgksu/debian/gconf-defaults.libgksu-su
# update-gconf-defaults
reboot
# update-alternatives --config libgksu-gconf-defaults
# update-gconf-defaults
reboot

but no success -- Synaptic refuses to accept the root password, but will accept my user account's password.

For the seventh command above, I was given 3 choices (I chose 0):

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/share/libgksu/debian/gconf-defaults.libgksu-su 20 auto mode
1 /usr/share/libgksu/debian/gconf-defaults.libgksu-su 20 manual mode
2 /usr/share/libgksu/debian/gconf-defaults.libgksu-sudo 10 manual mode

I am open to suggestion.

Caitlin
Caitlin
 
Posts: 237
Joined: 2012-05-24 07:32

Next

Return to Installation

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable
cron