Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Activating The Root Account (I Want To Use Su Not Sudo)
Activating The Root Account (I Want To Use Su Not Sudo)
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
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
Re: Activating The Root Account (I Want To Use Su Not Sudo)
Why can't you change the root password, like so?Caitlin wrote:But when I tried to log on to root, it wouldn't let me -- it said wrong password.
Code: Select all
sudo passwd root
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Activating The Root Account (I Want To Use Su Not Sudo)
As acewiza says, you should be able to do it using sudo
There are a few ways to do this.
Try first:
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 :
'man passwd' gives more details.
If that does not work, this other works, ...
http://www.wikihow.com/Change-the-Root- ... d-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= ... oot+passwd
There are a few ways to do this.
Try first:
Code: Select all
man passwd
Using sudo:PASSWD(1) General Commands Manual PASSWD(1)
NAME
passwd - modify a user's password
SYNOPSIS
passwd [user]
Code: Select all
sudo passwd root
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
If that does not work, this other works, ...
http://www.wikihow.com/Change-the-Root- ... d-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= ... oot+passwd
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Activating The Root Account (I Want To Use Su Not Sudo)
No need to ask that, and please do not ask me why I have never used "sudo"Please don't ask me why I want to use su instead of sudo.
Re: Activating The Root Account (I Want To Use Su Not Sudo)
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.)Caitlin wrote:It didn't ask me for a root password, and only allows me root access though sudo. Not as convenient.
With sudo, you can run a single command, like so:
Code: Select all
sudo COMMANDLINE
Code: Select all
sudo -s
Code: Select all
sudo -i
Yes, the root user account existed, but it was locked.I tried to put back the root account. Useradd wouldn't let me do it as it said root already exists.
First set a password, then unlock the account—e.g.:What is the best way to construct a proper root account? (Without reinstalling.)
Code: Select all
sudo -s
passwd root
passwd -u root
exit
Code: Select all
su -
Re: Activating The Root Account (I Want To Use Su Not Sudo)
seriously, why post this when he clearly does not want to use sudo that way and prefers su!luvr wrote: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.)Caitlin wrote:It didn't ask me for a root password, and only allows me root access though sudo. Not as convenient.
Of course, when prompted, you will have to type the root password that you have just set.
Re: Activating The Root Account (I Want To Use Su Not Sudo)
Documentation. Others may have a similar question, but not have such strong preferences. This may help them make an informed decision.HuangLao wrote:seriously, why post this when he clearly does not want to use sudo that way and prefers su!
Last edited by luvr on 2017-06-25 19:27, edited 1 time in total.
Re: Activating The Root Account (I Want To Use Su Not Sudo)
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
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
Re: Activating The Root Account (I Want To Use Su Not Sudo)
Sorry—I hadn't noticed the nested quotings, which apparently confused the forum.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.
I removed the superfluous quotings, and it should be OK now.
Re: Activating The Root Account (I Want To Use Su Not Sudo)
I took a closer look at this issue, and documented my findings in this other thread on this forum.Caitlin wrote:Very strange
Re: Activating The Root Account (I Want To Use Su Not Sudo)
Thank you.luvr wrote:I removed the superfluous quotings, and it should be OK now.
I guess I'll never really know why this happened; but if the second password reset "took", I'm happy.luvr wrote:I took a closer look at this issue, and documented my findings in this other thread on this forum.Caitlin wrote:Very strange
Thanks again.
Caitlin
Re: Activating The Root Account (I Want To Use Su Not Sudo)
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
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
Re: Activating The Root Account (I Want To Use Su Not Sudo)
First, run the following command to verify the “libgksu-gconf-defaults” setting: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?
Code: Select all
$ update-alternatives --display libgksu-gconf-defaults
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
Code: Select all
# update-alternatives --auto libgksu-gconf-defaults
Code: Select all
# update-alternatives --set libgksu-gconf-defaults /usr/share/libgksu/debian/gconf-defaults.libgksu-su
Code: Select all
# update-alternatives --config libgksu-gconf-defaults
Next (again as root), run the following command:
Code: Select all
# update-gconf-defaults
Re: Activating The Root Account (I Want To Use Su Not Sudo)
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
# 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
Re: Activating The Root Account (I Want To Use Su Not Sudo)
It looks to me like Synaptic is no longer using the “su”/“sudo” mechanism, but switched to “PolicyKit” instead.Caitlin wrote:but no success -- Synaptic refuses to accept the root password, but will accept my user account's password.
PolicyKit is based on “actions” with which authorisation rules are associated.
I’m not particularly familiar with PolicyKit, so I will have to dig a little deeper into this issue.
For starters, when you start the Synaptic Package Manager, you should see an authentication window that asks you for a password.
Close to the bottom left of the window, you should see a “Details” entry. If you click on that, you will be shown the PolicyKit action that synaptic requests—it should be “com.ubuntu.pkexec.synaptic”. Since synaptic prompts you for your own password, instead of the “root” one, there must be some PolicyKit configuration file set up to that effect.
Could you run the following command, to see which PolicyKit configuration files set up the “com.ubuntu.pkexec.synaptic” action? Run this as “root”, since some of the directories will not be accessible otherwise:
Code: Select all
grep -r 'ubuntu' /etc/polkit-1 /var/lib/polkit-1 /usr/share/polkit-1
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Activating The Root Account (I Want To Use Su Not Sudo)
Yes, but this is Debian, NOT Ubuntu.
But to be honest, I don't know maybe it is another "new feature" added
to Debian as well, ????
But to be honest, I don't know maybe it is another "new feature" added
to Debian as well, ????
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
Re: Activating The Root Account (I Want To Use Su Not Sudo)
Even so, the PolicyKit action really is “com.ubuntu.pkexec.synaptic”—so, yes, it must have been copied from Ubuntu.GarryRicketson wrote:Yes, but this is Debian, NOT Ubuntu.
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 5 times
- Been thanked: 16 times
Re: Activating The Root Account (I Want To Use Su Not Sudo)
@Caitlin
Have you tried dpkg-reconfigure synaptic? it might give you the option again to use su instead of sudo although I haven't tested this.
Have you tried dpkg-reconfigure synaptic? it might give you the option again to use su instead of sudo although I haven't tested this.
Re: Activating The Root Account (I Want To Use Su Not Sudo)
As far as I know, the selection between "su" and "sudo" mode for "gksu" can be made either for the system or for the individual user. How to do it for the system has been described earlier in this thread:
.
To make the selection for the current user, use this command:
Now, I am quite certain that in Jessie, the user default mode for "gksu" was to use "su" mode. In Stretch I believe this has been changed to use the "sudo" mode. It may be in the documentation somewhere but I have simply noticed it.
Code: Select all
# update-alternatives --config libgksu-gconf-defaults
# update-gconf-defaults
To make the selection for the current user, use this command:
Code: Select all
$ gksu-properties
Re: Activating The Root Account (I Want To Use Su Not Sudo)
That was one of the things that I thought of too, but it doesn’t do anything, apparently.Dai_trying wrote:@Caitlin
Have you tried dpkg-reconfigure synaptic? it might give you the option again to use su instead of sudo although I haven't tested this.