Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: no sudo required for /opt??

  1. #1
    Join Date
    Aug 2013
    Beans
    3,356

    no sudo required for /opt??

    Hi,

    I was trying to copy a file in /opt/google/earth and I forgot to add "sudo" before the cp command and it worked! Is this a bug or am I missing something?
    (I was following oldos2er's post to fix GE's panaromio picture bug http://ubuntuforums.org/showthread.php?t=2196304&page=3)

    Ubuntu 13.10

    Looks like for some reason I (not root) am the owner of the google directory

    Code:
    mb@localhost:/opt$ ls -l
    drwxr-xr-x 3 root root 4096 Dec  4 23:22 extras.ubuntu.com
    drwxr-xr-x 6 root root 4096 Dec 12 17:51 ffmpeg
    drwxr-xr-x 5 mb mb 4096 Dec  1 21:00 google
    Last edited by monkeybrain20122; January 6th, 2014 at 12:20 AM.

  2. #2
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: no sudo required for /opt??

    Quote Originally Posted by monkeybrain20122 View Post
    Hi,

    I was trying to copy a file in /opt/google/earth and I forgot to add "sudo" before the cp command and it worked! Is this a bug or am I missing something?
    (I was following oldos2er's post to fix GE's panaromio picture bug http://ubuntuforums.org/showthread.php?t=2196304&page=3)

    Ubuntu 13.10
    What are the permissions from /opt on down? The directory /opt is traversable by any user. They can read but not write. If you make a directory below /opt that is writable for all users then the cp won't need to use sudo.
    -BAB1

  3. #3
    Join Date
    Aug 2013
    Beans
    3,356

    Re: no sudo required for /opt??

    Hi

    I just edited and showed the permissions.

  4. #4
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: no sudo required for /opt??

    Quote Originally Posted by monkeybrain20122 View Post
    Hi

    I just edited and showed the permissions.
    And as I said you will be able to manipulate all the files in the google directory because you have rwx permissions to that directory (see the red below).
    Code:
    drwxr-xr-x 5 mb mb 4096 Dec  1 21:00 google
    -BAB1

  5. #5
    Join Date
    Aug 2013
    Beans
    3,356

    Re: no sudo required for /opt??

    Why is that? I installed the google packages like everything else (with sudo) I never messed with the permissions.

  6. #6
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: no sudo required for /opt??

    Quote Originally Posted by monkeybrain20122 View Post
    Why is that?
    The installation was run as root and it made the google directory. Then it gave the user that installed the package the permissions.
    I installed the google packages it like with everything else.
    Did you install it using Ubuntu packages or a .deb file you got somewhere else?

    Ultimately there is no problem with this install. The user mb has no rights to anything else in the /opt file system other than the google directory and it's subdirectories. remember the entire /opt file system is world (everyone) readable anyway.

    Edit: So you did the install as root. That's what sudo does. The tool sudo stands for Switch User (to root) and DO the command (install).
    Last edited by bab1; January 6th, 2014 at 12:51 AM.
    -BAB1

  7. #7
    Join Date
    Aug 2013
    Beans
    3,356

    Re: no sudo required for /opt??

    I have google-chrome, google-talk plugin and goole-earth, all installed by downloading the .deb from google.

  8. #8
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: no sudo required for /opt??

    Quote Originally Posted by monkeybrain20122 View Post
    I have google-chrome, google-talk plugin and goole-earth, all installed by downloading the .deb from google.
    You installed all of that as root. This means that the installer was allowed to do whatever it wanted to do. Do you trust Google to do the right thing? This is why Ubuntu uses the Debian style package manager (SC, Synaptic, apt-get or aptitude). I'm not saying the Google .deb is dangerous. What I'm saying is YOU don't know. Only you can decide to take a chance. At least with the Ubuntu package managers there is some vetting of the code.
    -BAB1

  9. #9
    Join Date
    Aug 2013
    Beans
    3,356

    Re: no sudo required for /opt??

    I know the risk, but if I worry about it I won't be using anything google, right? You don't get google's applications from the repo. My question is simply why I would be able to cp files in those subdirctories without being root.

  10. #10
    Join Date
    Sep 2010
    Beans
    898

    Re: no sudo required for /opt??

    You can manipulate the files in those subdirectories because you (mb) own them. The installer probably set it up like that intentionally.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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