LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-19-2015, 06:36 AM   #1
detr
LQ Newbie
 
Registered: Dec 2013
Posts: 21

Rep: Reputation: Disabled
install a program as a user or install it as a root?


install a program as a user or install it as a root?
What is the difference between install a program as a user and install it as a root, all differences please and what is the best?

sudo apt-get install vlc or apt-get install vlc?
 
Old 06-19-2015, 07:18 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Install as root, using the sudo form of the command.

Most systems will require that you install as root.

If you look at the binary directories, /bin, /sbin, /usr/bin, and /usr/sbin all the programs there are owned by root and have 755 permissions, which is to say that the permissions are read-write-execute for owner, read-execute for group members and the rest of the world. Further, these directories are owned by root and therefore all files in there should also be owned by root.

This is the common method. It is also designed so that if you have multiple users, that they can also use the newly installed program.

Can someone get away with not doing that or altering file ownership to have it not be root? The answer is yes, but it is not advised.
 
Old 06-19-2015, 02:05 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by detr View Post
install a program as a user or install it as a root?
What is the difference between install a program as a user and install it as a root, all differences please and what is the best?

sudo apt-get install vlc or apt-get install vlc?
On Debian and all the Debian-based systems I know of it isn't possible to run "apt-get install vlc" (or install any other program that way) as root. What makes you think that's possible?
Personally, even when I install things by dropping binary files into directories I do so as root and make them owned by root (I do this for Firefox, for example) because that means that the executable cannot be changed by the user running it. Whether that actually matters or it is actually more secure I could not tell you but to my mind executables ought (in the most part) to be owned by root and used by users other than root. There are other reasons for my doing it which I suppose come down to "consistency".
 
Old 06-19-2015, 02:13 PM   #4
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,479

Rep: Reputation: Disabled
Installing programs requires root permission, as they are installed for all users to use. However, you can install some (not all) programs in your /home directory for your own personal use.
 
  


Reply



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
user root can not install software on pc! trieu1929 Linux - Newbie 2 07-17-2014 09:48 PM
Is it possibel to install program as user js72 Debian 1 10-20-2006 02:30 PM
How od i install a program as root under suse 10/KDE. assettt Linux - Newbie 2 09-12-2006 07:59 PM
If not root ...then what user to install is best? Old_Fogie Slackware 27 05-08-2006 04:19 AM
When to install as user, when to install as root fooze Linux - Software 2 11-11-2005 12:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:34 AM.

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