LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-17-2003, 03:35 AM   #16
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,186

Rep: Reputation: 52

actually, now that i think about it, i don't really run as
root. it's sort of a duplicate of root, with a different
username and password, but it's still the top user.
so i guess i can say i never do anything as root, but
i really do everything as root. if i remember correctly,
i did that just so i could say i don't run as root.
i made a duplicate of my root line in /etc/password,
and changed the login name, and then changed the
password. i thought that would be just a little
better than running as root. i don't run any services
i don't need. i even hand start lpd when i want to
print something. no cron, no atd, no ftpd, no telnetd.
I think i kept trying to run as a normal user, but i had
messed up the system where a normal user couldn't
do anything. for example, X wouldn't run, and at the
time i didn't know how to fix it. i had messed up
all the permissions by moving everything with tar or
cp and not preserving the permissions and ownership.
i couldn't fix it, so i had to run as root. i remember
downloading win4lin and it wouldn't run as root, so
i couldn't run it at all. i installed a fresh redhat in
a different partition, just to have a normal user that
worked.
i like to think that since i have so many operating
systems on this computer, and 1 or a few are
accessable at any time, that i am only "root" of
that partition and not root of the whole machine,
at that time. the most i every really lose is a
few days emails, and i lose more stuff from
testing the limits of hardware with haparm and
overclocking and trying different fans and
voltages and stuff, than i do from being root,
and i'm not really root.
anyway i wanted the person who asked the original
question to know that i do sort of run as root, and i
do occasionally lose stuff thru mistake, but what i was
doing would have required root anyway, so i think it
would have happened anyway. root is dangerous,
and don't do it unless you are prepared for the
consequences. i backup often, full backups to
other hard drives, that are only hooked up when i'm
doing backups.
 
Old 04-17-2003, 03:43 AM   #17
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
Quote:
Hey, maybe we can even have a contest ...who can run root the longest w/o permanently thrashing their computer...
Hmm, well if thats actually a danger I guess Id win the contest. I normally run as root, didnt when I first started using linux, but have been for the past several years.
Once or twice Ive made some serious mistakes, but not for a long while.
Root is just another user, just more power. If youre the careless type I wouldnt recommend it though

The worst disaster running as root brought me was the deletion most of my /usr partition, an install of i forget what had created a usr dir under root and half asleep one night, cleaning out my home dir I typed "rm -rf /usr"
instead of "rm -rf usr", stopped it before it completed and did manage to put things back together. That was a couple of years ago, it made me a little more careful.

Anyway I wouldnt really recommend it unless youre very careful AND you have youre config and data backed up (and I do). I also have experience admining commercial web and mail servers where you have to work as root to do your job, so being careful is a habit Ive cultivated. I agree that running as root is not really a good habit, nonetheless I do it all the time
 
Old 04-17-2003, 04:07 AM   #18
JohanLingen
LQ Newbie
 
Registered: Jan 2003
Posts: 9

Rep: Reputation: 0
just be careful when using commands like 'rm'.

Most mistakes occur when using the tab-'autocomplete' function or incorrect use of slashes and asterixes(*)
 
Old 04-17-2003, 05:49 AM   #19
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,186

Rep: Reputation: 52
here's ones i do wrong
rm * .txt
or
rm -r / junk
notice the space between the * and the .
and the / and the junk
 
Old 04-17-2003, 08:52 AM   #20
comsomer
LQ Newbie
 
Registered: Apr 2003
Location: China
Distribution: Slack
Posts: 11

Rep: Reputation: 0
When i use root to login, my X always crashes.
 
Old 04-17-2003, 11:40 AM   #21
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
well, see. We still haven't covered all the topics. it seems that people have only understood that bad things can happen if a user is careless. Far from. For example, if you're connected to any network, a lot more damage can be caused by malicious code (or accidental code) that all of a sudden got way too many permissions. This is why, for example, services (like lpd, ftp, etc.) run as their own users - so when something goes kaboom in the code, lpd can't remove the system, because lpd user has no rights to do that. This goes back to my earlier post, not running as root is to avoid the _unexpected_

As for home boxes, I guess the danger really goes down (imagine telling your boss at some big company that their server is down because you accidentally typed in the wrong command - whoops!). So, I guess it often goes down to laziness vs. good habits. And whansard, any good admin needs to do stuff as root - but that's where stuff like sudo and 'group' permissions come in- most rootish tasks can still be limited to some admin group w/o having to su all the time.
; )

BTW, running X as root - I want to one reason why this is _needed_
Tisk tisk.
 
Old 04-18-2003, 04:37 AM   #22
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,186

Rep: Reputation: 52
which is worse,
running as root
or
running windows?

i'm not advocating
running as root, I just
do. I definately wouldn't
advocate using windows,
but i occasionally do.
If i was a sysadmin, i definately
would not run as root, but
then i would be better at
setting up permissions
to get the stuff i need working
as a regular using. For instance
my check email script mounts
2 windows drives read-write
starts eudora in wine. I spent
a day years ago trying to figure
out how to do that as a regular
user and failed. I have scripts
set up to run three different versions
of kde or 3 different versions of X
that all rename directories and
make some symlinks and run
ldconfig and change the path and
stuff. I definately don't know enough
to do that as a normal user. I also
have about 10 versions of linux on
a different partition that i have scripts
to mount, mount proc and tmp and
chroot into. I don't think i could do that
as a normal user, but i haven't tried.
I'm glad i have the choice to run as
whatever i wish. when i put linux on a
friend's machine, i don't even tell them
about root. I just give them a name and
password, so they can't mess things up.
Anyway, is running as root worse than
running windows.
I have a friend who uses win98 that has
klez on his machine, and i get a copy or
2 sent to me every day. I know its him
cause i recognize the names that
klez uses as "from" as his friends and
family. This has been going on for 6 months,
and i keep sending him letters telling him
he has klez, how klez works, links to tools
telling him to download to fix klez, telling him how
simple the tool is, and all i get from him is
an occasional vague statement about how
his isp checks his email for viruses. Am
I, by running as root as bad as he is?
 
Old 04-18-2003, 09:10 AM   #23
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,186

Rep: Reputation: 52
ok. i spent the last few hours setting up
an account where i could do most of my stuff,
but not as root. i had my machine set up
where nobody but root could do anything, so
i had to mess with mount, and fstab and
a bunch of scripts. I actually feel less safe
since i had to suid some stuff and chmod
a bunch of files. i'll see if i can use it for a while
without it driving me nuts.
 
Old 04-18-2003, 10:30 AM   #24
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Quote:
Originally posted by whansard
ok. i spent the last few hours setting up
an account where i could do most of my stuff,
but not as root. i had my machine set up
where nobody but root could do anything, so
i had to mess with mount, and fstab and
a bunch of scripts. I actually feel less safe
since i had to suid some stuff and chmod
a bunch of files. i'll see if i can use it for a while
without it driving me nuts.
For just about anything, it is possible to give users permission to do stuff. For example, mounting can be done by normal users by specifying the 'user' option in /etc/fstab for whichever mount point. If you want some users, but not others, to be able to access certain things, use groups. Put a few users in the group, and keep the others out. Set group permissions accordingly.

One thing you might want to try (if you still want to be logged in as a powerful user most of the time) is setting up some kind of "admin" account. Give admin permission for most of the stuff you might normally do (by using some admin group), but keep the more sensitive stuff as root-only, with no write permissions for admin. Anything that is critical to system operation (like kernel stuff, modules, etc.) could be off-limits, but maybe you could allow stuff like editing config files, mounting, creating devices, etc. That might be a good compromise in your situation. It'll give you the power you want, but still with a little bit of safety.

Although, it sounds like you're already trying something like this...

Even in Windows (at least 95/98/ME), you're not *really* running as root all the time. Yes, there's essentially only one user, but most of the time Windows will complain if you try to go in and delete important stuff.

Last edited by wapcaplet; 04-18-2003 at 10:32 AM.
 
Old 04-18-2003, 11:28 AM   #25
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,186

Rep: Reputation: 52
i had a horrible time getting my created user to
be able to mount. I think part of it was bastille-linux
i installed a couple of years ago that i let do something
to my mount and umount, and i couldn't remember
the name of the script that sets it up. I installed a newer
version, hoping to undo stuff with that, and i can't
get it working at all. i had some luck with linuxconf
and kuser, but stuff kept happening like when i got
mount to work, ppp would quit working.
is pppd supposed to be suid, or should i have done
something else? i barely understand the concept of
groups, because i've never used a group for anything,
and i don't know what i'm supposed to use them for.
this is a single user machine, and i've never used linux
on a network except for ppp internet.
 
Old 04-18-2003, 11:33 AM   #26
LoungeLizard
Member
 
Registered: Apr 2003
Location: Tampa, Florida
Distribution: Mint 17.2 ,OpenSuse, Kali and Pepermint OS 6
Posts: 276

Rep: Reputation: 30
Running Root all the time is like masterbating while having the power in your hands is inviting, when it comes down to it all you are doing is screwing yourself.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Fonts ok as root, but bad as user BroX Debian 11 11-01-2004 03:30 AM
Bad blocks on /root partition sarysa Linux - Newbie 2 10-26-2004 03:17 PM
running as root is bad because?... breezewax Linux - Security 4 10-09-2004 05:00 PM
Bad root shell Tyraziel Linux - General 2 04-08-2004 10:08 AM
is running root bad??? zetsui Linux - Security 1 06-23-2003 02:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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