LinuxQuestions.org
Visit Jeremy's Blog.
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 11-30-2005, 11:46 AM   #1
Hangetsu
LQ Newbie
 
Registered: Nov 2005
Location: Pennsylvania, USA
Distribution: openSuSE 10
Posts: 27

Rep: Reputation: 15
Best Practices When Installing Software


I'm a happy newbie user of openSuSE 10. At the moment, I'm presently logging on as root whenever I install software (probably not necessary with YaST, but oh well).

Is this a recommended practice, or should I be installing software as my user account? My personal account doesn't have access to many system folders so I assume this is the way to go.

Anything that is packaged can go through YaST -- Is it still worthwhile to log in as root? Is there any risk to doing so?

Thanks much for the help!
 
Old 11-30-2005, 12:24 PM   #2
fatrandy13
Member
 
Registered: Jun 2004
Location: new jersey
Distribution: anything debian based, long live apt-get
Posts: 230

Rep: Reputation: 30
I wouldnt recommend logging in as root regularly. Heres what to do; when you are in a command prompt, you can type 'sudo' (no quotes) before a command to execute as root, or just type 'su' (no quotes) alone at a prompt to get a root console. You can then continue with your business.

sudo will let you do this command:

user@machine$ sudo cp ~/script.sh /usr/bin/
Password: xxxxx
user@machine$

if your user name is in the sudoers file, you will be allowed to execute root commands using sudo without a password (be careful)


su works like this:

user@machine$ su
Password: xxxxxxx
root@machine#
 
Old 11-30-2005, 02:57 PM   #3
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
The way sudo works by default is that you need to put your account in the /etc/sudoers file in order to use sudo; and then it asks for your password. This is much more secure than using "su" since you can do anything as root from your account without needing to log in as root; but you don't need to worry about leaving your account logged in since you need to enter your password (which random people don't know) in order to use sudo. Also, you can restrict what commands can be used with sudo, etc.
 
Old 11-30-2005, 03:59 PM   #4
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Doesn't YAST ask for your root password anyway when you start it up when logged in as a user. Either way you should never login as root.
 
Old 11-30-2005, 04:26 PM   #5
Hangetsu
LQ Newbie
 
Registered: Nov 2005
Location: Pennsylvania, USA
Distribution: openSuSE 10
Posts: 27

Original Poster
Rep: Reputation: 15
How concerned do I need to be that I've logged in as root? I've only logged in as root to install some software (Firefox then Opera is about it). Given I haven't done much, is it such a risk that a reinstall is warranted??

If something is not in an RPM package, how do I install it as not root? I'm starting to think this is a question more for the newbie section...

Last edited by Hangetsu; 11-30-2005 at 04:31 PM.
 
Old 11-30-2005, 04:48 PM   #6
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
it's normal to switch to the root user (via sudo, sux -, kdesu, or when prompted by yast) to install software. the normal user doesn't have (and shouldn't have) the permissions to write to system directories.
 
Old 11-30-2005, 05:06 PM   #7
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
How concerned do I need to be that I've logged in as root? I've only logged in as root to install some software (Firefox then Opera is about it). Given I haven't done much, is it such a risk that a reinstall is warranted??
No. Logging in as root is only dangerous because you can easily make a mistake and break the whole system. Its also generally not a good idea to run desktop applications (eg. web browsers) as root for security reasons, but unless you have seen some indication that your comp. has been compromised you'd have to be extremely, extremely paranoid to want to re-install just because you once ran firefox as root

Quote:
If something is not in an RPM package, how do I install it as not root? I'm starting to think this is a question more for the newbie section...
Assuming you're talking about .tar.gz source packages? The only bit that you need to run as root is the make install, eg:
Code:
./configure
make
sudo make install
For binary installers (eg. the one for Firefox that you download from mozilla.org) you only need to run it as root if you want to install it to be accessible to all users, not just yourself. In this case
Code:
sudo ./firefox-installer.bin
To use sudo you need to setup your user in it. To do this edit the /etc/sudoers file with a text editor or using the visudo command, running as root, and add the following under "# User privilege specification":
Code:
yourusername     ALL=(ALL) ALL

Last edited by tkedwards; 11-30-2005 at 05:08 PM.
 
Old 12-01-2005, 09:35 AM   #8
Hangetsu
LQ Newbie
 
Registered: Nov 2005
Location: Pennsylvania, USA
Distribution: openSuSE 10
Posts: 27

Original Poster
Rep: Reputation: 15
Aha, that clears up ALOT regarding software installations. I wasn't sure how to install the tarballs and such myself. Thank you!
 
  


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
'Best practices' when installing downloads/programs? wmcase Linux - General 2 12-18-2004 06:30 PM
Partitioning: Best Practices newtype Linux - General 2 06-05-2004 07:44 AM
software management - best practices? curmudgeon42 Linux - Software 1 06-03-2004 09:12 PM
Best practices for upgrading hyper guy General 5 05-28-2004 12:39 AM
Best Practices mooreted Linux - Software 4 06-12-2003 12:31 PM

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

All times are GMT -5. The time now is 06:48 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