dnf - install without root permissions
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    Jul 2019
    Location
    South Korea
    Posts
    3
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    dnf - install without root permissions

    Hello Fedora users, This is my first post, I hope it's good.

    I noticed I can install software using bash and dnf without root privileges. I just type in the name of the software I want and bash tells me there is no package installed. Bash then proceeds to look for the package and installs it if I say 'yes'... no root password required. How can this be? Is this normal?

    I dig some digging around...
    first I made sure I could reproduce these effects after doing 'sudo -K' to ensure I didn't have cached credentials.
    Then I checked the install location of the new software, sure enough it was in /usr/bin
    Next I checked the permissions on /usr/bin and /usr/bin/bash as well as /usr/bin/dnf-3 (dnf is linked to it). The owner was set to root on all of them, none of them were 'group' or 'other' writable. None of them had a sticky bit set.

    So I'm confused how this even happened, and why I don't find more information about it when googling. It doesn't seem like a feature you would normally want, it seems more like a security bug. Any advice about this? I'd kinda like to disable it if anyone knows how. I'll attach a picture of my terminal windows showing what I mean. (I live in Korea but I'm a native English speaker).

    -Justin

    Click image for larger version. 

Name:	Screenshot from 2019-07-07 21-44-50.png 
Views:	22 
Size:	192.3 KB 
ID:	30472

  2. #2
    Join Date
    Aug 2016
    Location
    Iraq
    Posts
    1,106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Please open urgent bug in RedHat Bugzilla at:

    https://bugzilla.redhat.com/

    Register, then select Fedora & post bug report setting it at highest level of urgency. Either it is fetal bug or your machine invaded by rootkit because I test it on my Fedora & never saw such thing: only I received "no such command" no more !!!! It is very unusual behavior ...... Your system abnormal ......

    Please behave urgently & secure your self from very possible hacker's attacks
    Fedora 30 X64 bit Cinnamon edition on Lenovo ThinkPad e550 with Intel core i7 5500 CPU @ 2.40 GH X 2, RAM = 8 GB, HHD = 1 TB, Hybrid VGA (Intel Corporation HD Graphic 5500 + Radeon R7 M265 2GB)

  3. #3
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    73
    Posts
    23,783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    User808, it is not unusual and I can do exactly the same thing. Now, "why" ? Can't explain it, but here's the proof.
    [bob@localhost ~]$ $ stellarium
    bash: $: command not found...
    [bob@localhost ~]$ ls -la /usr/
    total 316
    drwxr-xr-x. 12 root root 4096 May 1 12:40 .
    dr-xr-xr-x. 20 root root 4096 Jul 6 03:03 ..
    dr-xr-xr-x. 2 root root 65536 Jul 7 12:11 bin
    drwxr-xr-x. 2 root root 4096 Feb 11 08:47 games
    drwxr-xr-x. 41 root root 4096 Jul 2 05:51 include
    dr-xr-xr-x. 76 root root 32768 Jul 7 06:15 lib
    dr-xr-xr-x. 190 root root 135168 Jul 7 12:11 lib64
    drwxr-xr-x. 54 root root 12288 Jul 7 12:11 libexec
    drwxr-xr-x. 12 root root 4096 Feb 11 08:47 local
    dr-xr-xr-x. 2 root root 28672 Jul 7 06:14 sbin
    drwxr-xr-x. 321 root root 12288 Jul 7 12:11 share
    drwxr-xr-x. 4 root root 4096 Feb 11 08:47 src
    lrwxrwxrwx. 1 root root 10 Feb 11 08:47 tmp -> ../var/tmp
    [bob@localhost ~]$ stellarium
    bash: stellarium: command not found...
    Install package 'stellarium' to provide command 'stellarium'? [N/y] y


    * Waiting in queue...
    * Loading list of packages....
    The following packages have to be installed:
    openal-soft-1.19.1-2.fc30.x86_64 Open Audio Library
    qt5-qtlocation-5.12.4-1.fc30.x86_64 Qt5 - Location component
    qt5-qtmultimedia-5.12.4-1.fc30.x86_64 Qt5 - Multimedia support
    qt5-qtserialport-5.12.4-1.fc30.x86_64 Qt5 - SerialPort component
    stellarium-0.19.1-1.fc30.x86_64 Photo-realistic nightsky renderer
    Proceed with changes? [N/y] y


    * Waiting in queue...
    * Waiting for authentication...
    * Waiting in queue...
    * Downloading packages...
    * Requesting data...
    * Testing changes...
    * Installing packages..
    You'll notice that simply using the bash command, nothing happens, BUT after the "ls -la /usr/", it proceeds to find and ask about installing. Of course, if you install something from Software, you're not asked for a password either, so as I remember, if it's in a trusted repository, the devs have eliminated that step.
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  4. #4
    Join Date
    Aug 2016
    Location
    Iraq
    Posts
    1,106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    @bob
    Thak you very much for this new data !

    I did not tried ls command. You are correct !

    Indeed Linux like big sea. I'm now 3 years Linuxer & nearly every weak with Linux I learn new thing !

    However, I disagree about remove asking for password even in case of trusted repositories. And what mean by trusted repositories ? Official Fedora repositories ?
    Fedora 30 X64 bit Cinnamon edition on Lenovo ThinkPad e550 with Intel core i7 5500 CPU @ 2.40 GH X 2, RAM = 8 GB, HHD = 1 TB, Hybrid VGA (Intel Corporation HD Graphic 5500 + Radeon R7 M265 2GB)

  5. #5
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    73
    Posts
    23,783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Here's a bit more on the subject: https://superuser.com/questions/1141...or-dnf-install
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  6. #6
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    6,097
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Can he create a normal - non admin login and try a similar way to install another prog.

    It should not work from that logon account.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  7. #7
    Join Date
    Jul 2019
    Location
    South Korea
    Posts
    3
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Solved!
    A big thanks to Bob for the additional information! You're right Software doesn't ask for a password either.

    I did what Isatenstein recommended and sure enough I was required to enter a password. It makes more sense now.

    I guess it's not really a problem. But, I decided to remove the PackageKit-command-not-found program. It's nice to be able to disable the feature if you want (dnf remove PackageKit-command-not-found). I noticed I can still install software with "GNOME Software" I guess I could always just use a separate login account without admin privileges.

  8. #8
    Join Date
    Aug 2016
    Location
    Iraq
    Posts
    1,106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Quote Originally Posted by abear
    ............ I noticed I can still install software with "GNOME Software" I guess I could always just use a separate login account without admin privileges.
    @bob
    So, removal of "PackageKit-command-not-found" DID NOT prevent GNOME software from installing software on account without admin privileges (without su & sudo power). This is need more address & it seem that it is not related to "PackageKit-command-not-found". @bob can you help further to inform us how can we make GNOME software always asking for password (or at least make it ask for password on account without admin privileges) ?

    -------------------------
    Edit:
    @bob
    I found something related, but it is too advanced to me & generic. @bob my you can use it to help us further to prevent GNOME from installing software without password on account without root privilege ..... - see:

    https://unix.stackexchange.com/quest...rd-for-the-won

    https://www.freedesktop.org/software.../polkit.8.html
    Last edited by User808; 8th July 2019 at 07:30 AM.
    Fedora 30 X64 bit Cinnamon edition on Lenovo ThinkPad e550 with Intel core i7 5500 CPU @ 2.40 GH X 2, RAM = 8 GB, HHD = 1 TB, Hybrid VGA (Intel Corporation HD Graphic 5500 + Radeon R7 M265 2GB)

  9. #9
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    73
    Posts
    23,783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    User808, if you want to use a password, just open a terminal and install things using dnf. That will always require a password.
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  10. #10
    Join Date
    Aug 2016
    Location
    Iraq
    Posts
    1,106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Quote Originally Posted by bob
    User808, if you want to use a password, just open a terminal and install things using dnf. That will always require a password.
    The matter is not "love to use password" by me. But the desire to know how to make GNOME software:

    1) only available to be used by wheel group

    2) make it asking for password in wheel group

    Currently I know only one approach which prevent GNOME software from used at all by any user outside wheel group. It is as following:

    change ownership of GNOME software binary 1st, then after, change it's right. This achieved by applying the following commands in sequence:
    sudo chown root:wheel $(which gnome-software)
    sudo chmod 750 $(which gnome-software)
    By above method GNOME software will be only available to those in wheel group, but still not asking them for password ....... I search for more brilliant method to strengthening security of my system ...........

    By the way, "PackageKit-command-not-found" is newly added package to Fedora because it is not found on my system, & I was on Fedora since Fedora 24 & upgraded using tty terminal command line never fresh installation .......
    Last edited by User808; 8th July 2019 at 02:20 PM.
    Fedora 30 X64 bit Cinnamon edition on Lenovo ThinkPad e550 with Intel core i7 5500 CPU @ 2.40 GH X 2, RAM = 8 GB, HHD = 1 TB, Hybrid VGA (Intel Corporation HD Graphic 5500 + Radeon R7 M265 2GB)

  11. #11
    Join Date
    Jul 2019
    Location
    South Korea
    Posts
    3
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Hi User808, If you really want to 'lock down' your computer, then maybe you shouldn't be using your admin account for daily stuff. That might be the lesson in this thread.

    Maybe there is another reason you don't want the wheel group to be able to install software without a password? Or maybe there is a reason you want to use the admin account for daily stuff?

    -respectfully

  12. #12
    Join Date
    Aug 2016
    Location
    Iraq
    Posts
    1,106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dnf - install without root permissions

    Quote Originally Posted by abear
    Hi User808, If you really want to 'lock down' your computer, then maybe you shouldn't be using your admin account for daily stuff. That might be the lesson in this thread.

    Maybe there is another reason you don't want the wheel group to be able to install software without a password? Or maybe there is a reason you want to use the admin account for daily stuff?

    -respectfully
    Okay, I will minimize my request: I like GNOME software available to be used as it (install applications without password) but only for wheel group members never ever for any other user outside wheel group.

    That is all what I asking now about. Is their better mothod to achive this aim ?
    Fedora 30 X64 bit Cinnamon edition on Lenovo ThinkPad e550 with Intel core i7 5500 CPU @ 2.40 GH X 2, RAM = 8 GB, HHD = 1 TB, Hybrid VGA (Intel Corporation HD Graphic 5500 + Radeon R7 M265 2GB)

Similar Threads

  1. can only run app as root, how do I change permissions
    By bonedome in forum Using Fedora
    Replies: 11
    Last Post: 25th July 2010, 02:20 AM
  2. Permissions, Properties if not root
    By PeterTheGreat in forum Using Fedora
    Replies: 4
    Last Post: 17th April 2010, 09:53 PM
  3. Permissions / Root help
    By JadedBeauty86 in forum Using Fedora
    Replies: 1
    Last Post: 8th January 2009, 04:51 PM
  4. Install packages without root permissions
    By cad in forum Using Fedora
    Replies: 8
    Last Post: 20th October 2007, 10:40 AM
  5. root permissions
    By zichzach in forum Using Fedora
    Replies: 2
    Last Post: 10th June 2006, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •