Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all,
I am new to linux an I have some questions. I have a small server(NSLU2) running debian at home. I installed lighttpd and mt-daapd and everything on the root account. Is that something wrong? I was going to install rtorrent but I read in somewhere saying not to install it from root account. Will you tell me if I have a security problem in my current system at home. Should I reinstall debian?
Hi all,
I am new to linux an I have some questions. I have a small server(NSLU2) running debian at home. I installed lighttpd and mt-daapd and everything on the root account. Is that something wrong? I was going to install rtorrent but I read in somewhere saying not to install it from root account. Will you tell me if I have a security problem in my current system at home. Should I reinstall debian?
Thank you in advance
Hi aspedisca,
The only way to install things in Linux is as root (with a few exceptions, but don't mind it for now), so there is nothing wrong with it. What you should not do, however, is to run applications as root. E.g: you need to be root to install Firefox, but you should not surf the web with Firefox as root.
Since lighttpd and mt-daapd are services, you will need to start them as root as well (I think) so I don't see anything wrong with what you are doing: Installing programs, configuring the system and start/stopping services (eg: FTP server) are all administrator tasks (root). Surfing the web and listening to music, downloading stuff via FTP client are all examples of regular user task.
The only way to install things in Linux is as root (with a few exceptions, but don't mind it for now), so there is nothing wrong with it. What you should not do, however, is to run applications as root. E.g: you need to be root to install Firefox, but you should not surf the web with Firefox as root.
Since lighttpd and mt-daapd are services, you will need to start them as root as well (I think) so I don't see anything wrong with what you are doing: Installing programs, configuring the system and start/stopping services (eg: FTP server) are all administrator tasks (root). Surfing the web and listening to music, downloading stuff via FTP client are all examples of regular user task.
I hope this clarifies things a bit.
Regards!
Hi Megaman,
Thank you for your fast reply. The question on my mind is I did not su from my account to install those. I just logged in as root and installed those. What is the difference between logging as a user then su and logging as a root? Thanks in advance
Hi Megaman,
Thank you for your fast reply. The question on my mind is I did not su from my account to install those. I just logged in as root and installed those. What is the difference between logging as a user then su and logging as a root? Thanks in advance
You are welcome aspedisca . As far as I know, there is no difference between logging as an user and then using the su command or logging in as root from the beginning. su will simply switch your user to a root user.
I am not sure if you installed those programs when Gnome/KDE or anything else was running. Because starting X (eg: logging in to Gnome/KDE, etc) with a root user is also not recommended.
I always, always login as an ordinary user and use the su command if I really need to do administrator tasks. Logging as an ordinary user helps you to protect your computer against your yourself (seriously), perhaps even more against you than from any external attack. One wrong "rm" command as root and you can easily turn your system unusable.
You are welcome aspedisca . As far as I know, there is no difference between logging as an user and then using the su command or logging in as root from the beginning. su will simply switch your user to a root user.
I am not sure if you installed those programs when Gnome/KDE or anything else was running. Because starting X (eg: logging in to Gnome/KDE, etc) with a root user is also not recommended.
I always, always login as an ordinary user and use the su command if I really need to do administrator tasks. Logging as an ordinary user helps you to protect your computer against your yourself (seriously), perhaps even more against you than from any external attack. One wrong "rm" command as root and you can easily turn your system unusable.
I do not have gnome/kde or any desktop utility on my system (266 MHZ and 32 mb ram ). I just simply use terminal window to use. I feel relieved after your answers. I recently had an attack to my system because I opened port 22 from router without any precautions. In the end I installed the system allover again and decided to be more careful about everything. Anyway, thanks for your help.
Happy new year. Cheers...
Hi Megaman,
Thank you for your fast reply. The question on my mind is I did not su from my account to install those. I just logged in as root and installed those. What is the difference between logging as a user then su and logging as a root? Thanks in advance
The logging in as 'su' (superuser);
Code:
excerpt from 'man su';
NAME
su - change user ID or become super-user
SYNOPSIS
su [-] [username [args]]
DESCRIPTION
su is used to become another user during a login session. Invoked with-
out a username, su defaults to becoming the super user. The optional
argument - may be used to provide an environment similiar to what the
user would expect had the user logged in directly.
...
When logging into the 'root' account then you have system wide services available on the account. With 'su' you are becoming the 'root/superuser' from your login account to get the same level of access. The system knows no difference if you provide the proper password for the account. You will exit the 'su' to your user login account. When you exit the 'root' you exit to the system login. Either way you should use good judgment when utilizing the superuser account.
One small point that you may already know, and it is mentioned in the 'su' man page
Code:
The optional argument - may be used to provide an environment similiar to what
the user would expect had the user logged in directly.
If you 'su root', you will become root but your profile is not executed, so your PATH, HOME and other environmental variables may not be set correctly; if you 'su - root', you will become root AND root's profile will be executed.
just to avoid confusion in the future...
Last edited by tommylovell; 01-01-2009 at 04:07 PM.
One small point that you may already know, and it is mentioned in the 'su' man page
Code:
The optional argument - may be used to provide an environment similiar to what
the user would expect had the user logged in directly.
If you 'su root', you will become root but your profile is not executed, so your PATH, HOME and other environmental variables may not be set correctly; if you 'su - root', you will become root AND root's profile will be executed.
just to avoid confusion in the future...
Good point! I just cut the 'man su' so the OP would get the general idea.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.