LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-09-2017, 05:27 PM   #1
ConsJMEA
LQ Newbie
 
Registered: Aug 2017
Posts: 4

Rep: Reputation: Disabled
Linux Debian 9 GUI don't accept sudo and asks for root password


Hello. I've just installed Debian 9.

Code:
Linux Qhari06 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux
When I use applications like Synaptic or when I try to mount a partition I need to give a password. With prior versions of Debian I used to enter my password as sudo and it was enough. But now I need to enter the root password. From terminal I can launch Synaptic with gksudo without problems. I've used gksu-properties both with sudo and from root and I've changed the authentication mode to "sudo" but the problem remains. Both in Gnome and KDE occurs this behavior.

I'm the only user and I've sudo privileges.

Code:
sudo -l -U jmea
[sudo] password for jmea: 
Matching Defaults entries for jmea on Qhari06:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User jmea may run the following commands on Qhari06:
    (ALL : ALL) ALL
I would prefer not to use the root password. There are some way to solve this problem?.

Thanks
 
Old 08-10-2017, 10:31 AM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, Manjaro
Posts: 8,838
Blog Entries: 14

Rep: Reputation: 1080Reputation: 1080Reputation: 1080Reputation: 1080Reputation: 1080Reputation: 1080Reputation: 1080Reputation: 1080
If you want to perform administrative tasks I don't see a way around 'not typing in your password' it's pretty much the norm with elevated privileges.

Next time your in the terminal try:

Code:
su -

and than hit Enter and put in your password
Maybe others know a way w/o root privileges. Sorry I don't.
 
Old 08-10-2017, 10:34 AM   #3
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX
Posts: 2,240
Blog Entries: 5

Rep: Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972
I wonder if this is a polkit issue. On my Debian 9, there's a polkit file for synaptic called /usr/share/polkit-1/actions/com.ubuntu.pkexec.synaptic.policy. So that is what synaptic is going to use for authentication if it is run via pkexec (which it probably will be if run from a menu). What counts as an administrator is listed in /etc/polkit-1/localauthority.conf.d/51-debian-sudo.conf. It says you must be a member of the sudo group to use your own password as an administrative password. If you have given yourself sudo rights in any other way (by name, or via the wheel group) it probably doesn't count.

You could check on this quickly by opening a terminal and running pkexec synaptic. If you get the same results as for the graphical launch, then polkit is to blame.
 
1 members found this post helpful.
Old 08-10-2017, 05:57 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,297
Blog Entries: 36

Rep: Reputation: Disabled
I thought there was/is a discussion over at the Debian User Forums on the root+password "issue".
Seems to be a 'thing', IIRC.

http://forums.debian.net/viewtopic.php?f=10&t=133551

Search term:
Code:
root password sudo site:forums.debian.net

Last edited by Habitual; 08-10-2017 at 06:01 PM.
 
Old 08-11-2017, 02:37 AM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,479

Rep: Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994
Sudo is not installed by default in Debian.
 
Old 08-11-2017, 07:40 AM   #6
ConsJMEA
LQ Newbie
 
Registered: Aug 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks to AwesomeMachine and Habitual. The post https://linuxpanda.wordpress.com/201...ebian-stretch/ is very interesting.

In my case, the installation process included SUDO on my system but my username (the only one by now) was not included as sudoer. I used visudo from root and I've sudo privileges (you can see the first post).
Code:
$ cat /etc/group | grep 'sudo'
sudo:x:27:jmea
I'll test the hazel's answer.
 
Old 08-11-2017, 08:15 AM   #7
ConsJMEA
LQ Newbie
 
Registered: Aug 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
You could check on this quickly by opening a terminal and running pkexec synaptic. If you get the same results as for the graphical launch, then polkit is to blame.
I can run pkexec only as sudo
Code:
$ pkexec synaptic
Cannot run program synaptic: No such file or directory
$ sudo pkexec synaptic
[the program launches OK]
Quote:
On my Debian 9, there's a polkit file for synaptic called /usr/share/polkit-1/actions/com.ubuntu.pkexec.synaptic.policy. So that is what synaptic is going to use for authentication if it is run via pkexec (which it probably will be if run from a menu).
Code:
$ cat /usr/share/polkit-1/actions/com.ubuntu.pkexec.synaptic.policy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

  <action id="com.ubuntu.pkexec.synaptic">
    <message>Authentication is required to run the Synaptic Package Manager</message>
[... the same message in various languages ...]
    <icon_name>synaptic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/synaptic</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
  </action>
Quote:
What counts as an administrator is listed in /etc/polkit-1/localauthority.conf.d/51-debian-sudo.conf.
Code:
$ cat /etc/polkit-1/localauthority.conf.d/51-debian-sudo.conf[Configuration]
AdminIdentities=unix-group:sudo
I don't understand well but it looks like all is OK. I want also to clarify that the problem is not only with Synaptic but with other authentication messages e.g. for mounting a partition.

Also I note that sudo group exists on my system but admin group not exists.

Code:
jmea@Qhari06:~$ cat /etc/group | grep 'su'
sudo:x:27:jmea
jmea@Qhari06:~$ cat /etc/group | grep 'ad'
adm:x:4:
shadow:x:42:
lpadmin:x:115:jmea
 
Old 08-11-2017, 09:46 AM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,479

Rep: Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994
Sudo uses a different environment than the user using sudo. So, /sbin, and /usr/sbin are in the path. If you type as normal user
Code:
$ /usr/sbin/synaptic
it will launch.
 
1 members found this post helpful.
Old 08-12-2017, 09:37 AM   #9
ConsJMEA
LQ Newbie
 
Registered: Aug 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks. I've launched
Code:
$ /usr/sbin/synaptic
and Synaptic runs without administrative privileges. If I use
Code:
$ sudo /usr/sbin/synaptic
the program runs OK.

On the other hand, the problem is solved although I'm not sure why because I did not change any configuration file. The only changes on my system since yesterday are:
1) Yesterday I executed
Code:
$ sudo pkexec synaptic
while I was testing the suggestions of hazel

2) Although I already had sudo privileges by having used visudo, yesterday I executed from root
Code:
# adduser jmea sudo
3) Today I've executed
Code:
$ sudo apt-get update
4) I've executed a few minutes ago
Code:
$ sudo /usr/sbin/synaptic
Now when I open Synaptic from Gnome the program asks for my password and not the root password. The same occurs when I mount a partition. Thanks all.
 
Old 08-12-2017, 10:10 AM   #10
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX
Posts: 2,240
Blog Entries: 5

Rep: Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972
Quote:
Originally Posted by ConsJMEA View Post

2) Although I already had sudo privileges by having used visudo, yesterday I executed from root
Code:
# adduser jmea sudo
Now when I open Synaptic from Gnome the program asks for my password and not the root password. The same occurs when I mount a partition. Thanks all.
That confirms my theory. By adding a user who belongs to the sudo group, you made it possible for programs that use polkit to recognise this user as an administrator. I am in the sudo group on my Debian Stretch system and I can use synaptic with my own password too.
 
  


Reply

Tags
debian 9, gui, root password, sudo


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] RIPLinuX asks for a password... I don't know what password Vocay2 Linux - Software 2 10-12-2013 07:13 AM
liveCD installer asks for root password, but means the liveCD's root password newbiesforever VectorLinux 4 04-23-2013 01:16 PM
[SOLVED] Sudo command occasionally asks for root password ubuntuv Linux - Newbie 25 09-14-2010 01:26 PM
Install skype on acer one. Asks for root password. don't know where to get this congercod Linux - Newbie 4 02-13-2009 08:08 AM
is possible that sudo always asks the password? Lantius Linux - Software 5 05-09-2007 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration