LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2016, 10:05 PM   #1
road hazard
Member
 
Registered: Nov 2015
Posts: 241

Rep: Reputation: Disabled
Question Using SUDO to install stuff changes the owner to root and causes problems


I have a feeling this is a REALLY stupid question.

Lets say I'm using Mint and I need to install a program via the SUDO command. I noticed that once this program installs and copies its files to say.... /home/Downloads ..... when I try to run the program as myself, it fails. Right clicking on the folder, I see the permissions belong to 'root'.....makes since because I used SUDO to install it?! If I use 'sudo chown etc' to change ownership of that folder and its sub-directories back to my account, I can run it perfectly.

Is this something I'll need to just remember to do every time I need elevated access to install something or am I not using the 'sudo' command right?
 
Old 07-15-2016, 10:17 PM   #2
cykodrone
Member
 
Registered: Apr 2014
Location: My comp chair
Distribution: PCLinuxOS, Devuan
Posts: 87

Rep: Reputation: 19
That really depends on what you install, most programs grant system-wide user permissions when installed. Mint uses apt, Synaptic is an apt GUI, but is only run as root (or sudo, I hate sudo, I use "su" whenever possible), whenever you install pretty much anything from the distro's repo, it will appear in the menu, ready for any user to use, unless it's a tiny binary that has no GUI, then it's run from the command-line (depending on the type of binary, you may have to run some non-GUI progs as root as well). You'll notice programs like Bleachbit or luckyBackup have to separate icons, one is regular user, the other is root activated, that's because they are both file-system progs that sometimes require a higher level of system access. I hope that's not too confusing. So I guess the answer to your question is yes, if you are installing special things by hand, you will have to manipulate their permissions from time to time.

Edited for spelling and grammar.

Last edited by cykodrone; 07-15-2016 at 10:19 PM.
 
Old 07-16-2016, 02:26 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by road hazard View Post
Lets say I'm using Mint and I need to install a program via the SUDO command. I noticed that once this program installs and copies its files to say.... /home/Downloads ..... when I try to run the program as myself, it fails. Right clicking on the folder, I see the permissions belong to 'root'.....makes since because I used SUDO to install it?!
it seems you are confusing "downloading" with "installing".

you don't need super user privileges to download something to your /home/<username>/Downloads (i hope you didn't really use /home/Downloads???).

there are some fundamental differences in how linux managaes software installations, compared to windows.
please show us what, and how you "installed".

Last edited by ondoho; 07-16-2016 at 02:27 AM.
 
Old 07-16-2016, 03:13 AM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You should download to /home/user_name/Downloads and not sudo until you actually install the program with make install, or some like command. If your installing from a package manager you don't need to worry. If your using /home/Downloads, you had to be sudoed to make the directory. So, you won't be able to expand and untar source packages as a normal user in that directory. If you want to do it that way, you must chown -R user: /home/downloads, and then not use sudo to work in that directory.
 
  


Reply

Tags
chown, permission, sudo



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
Question about the sudo command, specifically how to have sudo act as if user is root slacker_ Linux - Newbie 17 09-22-2013 03:48 PM
[SOLVED] Problems with su, sudo, root and user bg368 Slackware 10 06-02-2011 02:28 PM
Owner of a directory different than file owner problems Guardian-Mage Linux - Server 4 04-24-2009 10:26 AM
Give root access to user's display + sudo problems Ephracis Linux - General 12 01-11-2006 11:25 PM
sudo changes the owner and the group of some my files and now I can't enter in X Ali79 Linux - Software 5 12-10-2004 01:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:07 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
Open Source Consulting | Domain Registration