LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-04-2007, 06:43 PM   #1
AphoxemaG
Member
 
Registered: Jan 2007
Location: Illinois
Distribution: Slackware 11
Posts: 37

Rep: Reputation: 15
I use root because I'm hardcore, like Mountain Dew.


I've always been working as root user in Linux installations I've had. I know it's bad, and I should be, like, beat and stuff for it, but I've never really known what groups I should assign a 'user' for myself.

So... I'll be good, for an occasion, and start making different users. What kinds of things do I want to keep in mind with making a user, and what limits does a 'safe' user need?
 
Old 01-04-2007, 07:03 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
This is a bit like asking: "Which of my possessions should be in a bank vault vs under the bed?"
Who has physical access to the computer?
What is it used for?
etc.

A "safe user" is one who only has the permissions they need and does NOT have permissions that would cause damage.
 
Old 01-04-2007, 07:37 PM   #3
AphoxemaG
Member
 
Registered: Jan 2007
Location: Illinois
Distribution: Slackware 11
Posts: 37

Original Poster
Rep: Reputation: 15
I don't know what permissions cause damage or what permissions I need. I'm pretty used to Windows, particularly having an installation all to myself.
 
Old 01-04-2007, 07:49 PM   #4
xjlittle
Member
 
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
Generally speaking the default set of permissions that linux grants a user are all they will need on a daily basis. As far as a group is concerned all the distros that I've worked with assign a default group-usually either creating a group by the same name as the user or adding them to the users group. In either case the users are always added to any other groups that they might need depending on how the distro is set up. For example some distros also add users to the groups audio, cdburner, etc.

On my newly installed kubuntu by default I am added to the following:
Code:
jslittl@jslittl-laptop:~$ groups jslittl
jslittl : jslittl adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin
jslittl@jslittl-laptop:~$
hth
 
Old 01-04-2007, 09:46 PM   #5
AphoxemaG
Member
 
Registered: Jan 2007
Location: Illinois
Distribution: Slackware 11
Posts: 37

Original Poster
Rep: Reputation: 15
Thank you, I didn't realize it was so easy... honestly, I keep expecting everything in any Linux distribution to be ornery and life threatening, with a bad attitude and a craving for my blood.
 
Old 01-04-2007, 10:31 PM   #6
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Only use root if you need to configure system settings or loading a service like SAMBA, CUPS, APACHE, FTP, SSH, and others. Do not use root to run GUI or else you will trash your setup. By default in a non-parnoid setup, user permissions are 750 (-rwxrw----).

Windows users do not know any better even though they should create users that are not administrative accounts. In both Windows XP and Windows 2000, I create at least two accounts. One is an administrator and other is a normal user. A Power user can also be created, but this can only be done in the management panel. However, creating users in Windows still will not fix the permission on every file that is set to everyone by default, so Windows is still far, far away from being secure out the box.

Quote:
Originally Posted by xjlittle
...In either case the users are always added to any other groups that they might need depending on how the distro is set up...
Are you sure always. When users are created in Linux, they get an user ID and that is about it. The two utilities to create users are adduser and useradd. The administrator or root have to add the users to the desire groups after or during making users. Use useradd -m <user name> to create a user and setup their home directory. Include -g to add users to desire groups.
 
Old 01-04-2007, 11:06 PM   #7
moxieman99
Member
 
Registered: Feb 2004
Distribution: Dabble, but latest used are Fedora 13 and Ubuntu 10.4.1
Posts: 425

Rep: Reputation: 147Reputation: 147
Quote:
Originally Posted by AphoxemaG
I root because I'm hardcore, like Mountain Dew
----------------------
You root because you're stupid. Root allows you screw up your system all by yourself, forget people hacking in.

My Linux box is not connected to either the internet or a network, and I had to wait extra time for it while the guy who built my system found a (then) modern motherboard that did not have an ethernet card built in. It CANNOT be broken into by anyone who isn't physically sitting at the machine, because it is not connected to a network and physically cannot be connected (otherwise, yes, I know that it would only be a question of time). NOTWITHSTANDING ALL THAT, I stay away from root because it only takes one confused command in terminal (think "dd" or the like) or a mis-click of the mouse, to trash the OS in Root.

BTW, you want hard core for a soda? Drink Moxie. Mountain Dew is for the ladies.
 
Old 01-04-2007, 11:29 PM   #8
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by Electro
Are you sure always. When users are created in Linux, they get an user ID and that is about it. The two utilities to create users are adduser and useradd...
Technically that is true, but I'm willing to bet that most modern Linux users create new accounts through an interface in their Windows manager, or through some script or utility that is part of their distribution's admin tools. Those tend to add new accounts to a lot of groups by default (as required by that distro).

So the statement might have more accurately read: If you add a new account through your distro's admin utility...
 
Old 01-05-2007, 12:14 AM   #9
odd2k
Member
 
Registered: Oct 2006
Distribution: Slackware-11.0
Posts: 35

Rep: Reputation: 15
Another perma-root noob reporting in.. I always use root simply because I always perform tasks that require a root login. 99% of the commands I issue need root access, so I really don't see the need to log in as a non-privileged user for that last one percent.

Besides that, I honestly do not care if I trash the whole OS at this point, it takes me five minutes to get slackware 11 up and running, with any backups I need in place. Ah, what would I do without vmware..

Last edited by odd2k; 01-05-2007 at 12:16 AM.
 
Old 01-05-2007, 12:31 AM   #10
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by odd2k
Another perma-root noob reporting in.. I always use root simply because I always perform tasks that require a root login. 99% of the commands I issue need root access...
That cannot possibly be even close to true. The only way that would be accurate is if all you did was mount and unmount drives, connect to serial devices, and install new iptables rules. You must be doing something else, such as playing music, browsing websites, chatting, editing a website, writing papers, etc, etc.

Running everything as root is no different than how most people run Windows, as Administrator. It has the exact same security problems. The more popular Linux gets, the more exploits are written for it. Since the rapid growth of the LAMP install base, a huge number of exploits have been developed for PHP applications. If Linux on the Desktop ever catches on, you can bet there will be a ton of exploits for that as well. If you're running as root when you get exploited by a bug in Firefox or GAIM, your whole system can be affected.

Also remember, it's not only the damage to your own system, it's mostly about the damage your system causes to others. Historically most exploits were written by hobbyists for "fun" or to prove a point. Usually they didn't do that much damage, but enough to get noticed (such as delete all image files, or all Word documents, etc). Contemporary malware writers do so for profit. They go to great lengths to hide the fact that they've compromised your system as they use it for sending spam, hosting phishing sites, or running automated attack bots that exploit other sites.

There are two very dangerous assumptions being made: a) that you will notice that your box has been compromised and b) that the compromise will only affect you. Both of them are likely to be incorrect. I could throw in a third dangerous assumption as well: c) Linux is more secure than Windows "just because".
 
Old 01-05-2007, 01:35 AM   #11
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 774

Rep: Reputation: 243Reputation: 243Reputation: 243
Quote:
Originally Posted by xjlittle
Generally speaking the default set of permissions that linux grants a user are all they will need on a daily basis.

...

On my newly installed kubuntu by default I am added to the following:

Code:
jslittl@jslittl-laptop:~$ groups jslittl
jslittl : jslittl adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin
jslittl@jslittl-laptop:~$

Even those I'd call way too permissive. With those perms it's probably possible to:

-down the network on other users from a user account using the "dialout" permissions. Think of ppp or other network connections.

-trash any disk left in the floppy drive (boot disk?), if writable by the "floppy" user, as /dev/fd0 and friends are usually writable by group floppy

-various printer naughtiness with lpadmin. Same for scanner, possibly plugdev, depending on what it can access (I've never seen this group so I don't know for sure, but I'd certainly check it out)

-open & close the cd tray, possibly mount/unmount cd filesystems, from the network as user

-write to system files as user (if anything is belonging to adm or admin, which does include some systems). Look at the rc.* files, possible in /dev, by using dd to write thru adm/admin owned /dev/ devices.

-play sounds out of the console from the network (I learned about this one because I had a user ssh in and play an mp3 of a muppets show to the console before I tightened down the permissions. Cute, but highly annoying.)

-establish unauthorized network connections out, possibly in as well, using the dip permissions

-not sure about "video", but it may be possible to snarf screens in some setups

Many distros add users to such groups to make things easy to get started, especially for new users. Almost all of these are not needed and can be trouble. I'd recommend limiting users to just the "users" account, and possibly any special project/job group they're involved with. For special tasks like mounting and unmounting CD's or making a dial out connection, it's probably better to use something like sudo. It's easier to control exactly who does what, and you get account (logs) of what's going on, too.
 
Old 01-05-2007, 01:53 AM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Chort, yes and no. On some machines (ie servers) I'd only ever connect as root as I'd only be updating, checking logs, whatever. It's only desktops where non root users rule
 
Old 01-05-2007, 02:25 AM   #13
odd2k
Member
 
Registered: Oct 2006
Distribution: Slackware-11.0
Posts: 35

Rep: Reputation: 15
Quote:
Originally Posted by chort
That cannot possibly be even close to true. The only way that would be accurate is if all you did was mount and unmount drives, connect to serial devices, and install new iptables rules. You must be doing something else, such as playing music, browsing websites, chatting, editing a website, writing papers, etc, etc.
Actually, I'm only using this virtual machine for server stuff, trying out installs, building LFS and so on.

Quote:
Originally Posted by chort
Running everything as root is no different than how most people run Windows, as Administrator. It has the exact same security problems. The more popular Linux gets, the more exploits are written for it. Since the rapid growth of the LAMP install base, a huge number of exploits have been developed for PHP applications. If Linux on the Desktop ever catches on, you can bet there will be a ton of exploits for that as well. If you're running as root when you get exploited by a bug in Firefox or GAIM, your whole system can be affected.
I rather see it this way: If an exploit is able to run commands on your system as a non-privileged user, then your system is already as compromised as it will ever be. I'm thinking of root kits and so on. But I suppose it's a good idea to avoid using root unnecessarily, just in case.
 
Old 01-05-2007, 04:58 AM   #14
AphoxemaG
Member
 
Registered: Jan 2007
Location: Illinois
Distribution: Slackware 11
Posts: 37

Original Poster
Rep: Reputation: 15
Let's get something straight... Windows has two modes of security... 'Insecure', and 'Less Secure'.

Just kidding... maybe...

Right now, I have a user, 'aphoxema' with a 14 character password with letters and numbers, the only groups assigned are 'users', 'cdrom', and 'audio', and whatever Slackware 11 defaults those as. They sounded safe, anyways...

My fstab...

/dev/sda1 /mnt/astraea ntfs ro,umask=0222 1 0
/dev/sda3 /mnt/actinium ntfs ro,umask=0222 1 0
/dev/hda1 /mnt/unlogich ntfs ro,umask=0222 1 0
/dev/hda3 /mnt/floorkiller ntfs ro,umask=0222 1 0
/dev/hdc5 /mnt/share vfat defaults,umask=0222 1 0

/dev/hdc5 is just a fat32 share I made to push things to Windows if I need it, I did the 'umask=0222' because I knew it would let me actually read the disks, and since they're RO, I figured I shouldn't have much to worry about anyways.

I disabled all of the service options when I installed Slackware, and I only run root now to configure iwconfig, because I have no idea how to make that available to users.

Chort is exactly right; I'm using Linux again because I'm not using things that are strict to Windows right now, so I can do just about everything I normally do in Linux, now. I hope Linux becomes popular, even competing with Apple and Microsoft. I respect open source and liberated software, and I worship Linus Torvalds. I want to know what I can do right, what I can do wrong, how I can be vulnerable, and just what I can do with Linux now that I can do many things I never could before, such as play music and video, use the majority of my hardware, and sofware has only grown more stable and popular.

I suppose the responsible first step is to know how to avoid l33t h4x and suicide-by-root...

And, apparently Moxieman read my topic instead of my post, and assumed I wasn't 'the ladies'.

"The less a man makes declarative statemets, the less apt he is to look foolish in retrospect"
 
Old 01-05-2007, 07:13 AM   #15
moxieman99
Member
 
Registered: Feb 2004
Distribution: Dabble, but latest used are Fedora 13 and Ubuntu 10.4.1
Posts: 425

Rep: Reputation: 147Reputation: 147
[QUOTE=AphoxemaG

And, apparently Moxieman read my topic instead of my post, and assumed I wasn't 'the ladies'.

"The less a man makes declarative statements, the less apt he is to look foolish in retrospect"[/QUOTE]

---------------------
True, but declarative statements are much more fun. Besides, they build character. Moxie does, too.

Anyway, I think everyone here agrees that being root unnecessarily is not only stupid but dangerous to the owner and to others. I can accept someone taking risks with their own systems, but they have no authority to put the systems of others at risk by unleashing a compromised box onto the internet or a network. If someone wants to spend their time re-installing their own system, fine, but a decent respect for the rights of others demands that root use be minimized.

Believe it or not, there are lawsuits out there for negligent computing -- where I am sued because my computer was compromised and used for an attack on your computer -- and routinely unnecessarily using root on a system connected to a network or the internet is negligent.

Why take the risk when almost all of the distributions out there offer to set up perfectly usable user accounts as part of installation?
 
  


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
A challenge for all hardcore linux users ilovehtml Linux - Laptop and Netbook 13 01-25-2006 05:10 AM
Q for all the hardcore gamers 0pal_t0ad General 16 02-04-2005 11:54 AM
hardcore linux tweaks fedorafreak Fedora 2 08-10-2004 05:01 PM
Networking Mountain To Climb bytebrowser Linux - Networking 2 07-02-2003 10:37 AM
why mt. dew should be made illegal fragged one General 9 01-29-2003 02:39 AM

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

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