PDA

View Full Version : For those who insisit on running as root


randiroo76073
December 1st, 2008, 07:57 AM
:confused:

Maybe you'd be happier with Fedora or some other distro that allows you to setup root at the getgo, thats why there are so many different flavors of Linux, so the individual can pick & choose. I constantly am trying new ones(multi-boot) but keep Ubuntu as my main :)

chucky chuckaluck
December 1st, 2008, 08:31 AM
thanks for the tip.

ryry46d9
December 1st, 2008, 08:36 AM
if you really want to see root@blaablaa on your term then type



sudo passwd root

poof you just added a password for root that you can use

then "su" when needed


unless you really want to log in X as root , that is a question I cant answer


but I do feel the sudo pain from time to time

Swagman
December 1st, 2008, 08:36 AM
You can do that with debian anyway ( and ubuntu - sudo su) and you can still use your apt-get knowledge.

ibutho
December 1st, 2008, 08:37 AM
If you don't want to switch, you can tinker with your Ubuntu settings and revert to the classic model. Its forbidden on these forums to discuss this, but there are many articles on google that can help.

jespdj
December 1st, 2008, 09:31 AM
if you really want to see root@blaablaa on your term then type ...

You are violating the forum policy (http://ubuntuforums.org/showthread.php?t=716201).

Dr Small
December 1st, 2008, 10:12 AM
You are violating the forum policy (http://ubuntuforums.org/showthread.php?t=716201).
+1

Arch sets you in root at installation, and that is fine.
But I setup sudo, because it is faster to type than logging in as root to type every command.

saulgoode
December 1st, 2008, 10:18 AM
You are violating the forum policy (http://ubuntuforums.org/showthread.php?t=716201).

Ryry46d9 did not post how to perform a graphical root login -- in fact, he stated he could not -- presumably owing to forum policy. Neither did he describe how to arrange things so that the root account was logged into automatically. It would also be a rather tenuous argument to assert that a single command constitutes a "tutorial".

ryry46d9
December 1st, 2008, 10:27 AM
Ryry46d9 did not post how to perform a graphical root login -- in fact, he stated he could not -- presumably owing to forum policy. Neither did he describe how to arrange things so that the root account was logged into automatically. It would also be a rather tenuous argument to assert that a single command constitutes a "tutorial".



Thank you




I my self find sudo to be a pain some times when I'm building a server for the first time, over half the time sudo will time out on me, due to me doing a little RTFM

ibutho
December 1st, 2008, 10:41 AM
+1

Arch sets you in root at installation, and that is fine.
But I setup sudo, because it is faster to type than logging in as root to type every command.

You don't have to login as root every time you need to run a command. You can use "su -c" e.g.
su -c "/sbin/ifconfig -a"
You will be asked for roots password and the command will run as root. When the command has finished, you are dropped back to your normal users command prompt. Its not so different from prefixing every command with sudo and then entering your own password.

JohnFH
December 1st, 2008, 10:41 AM
If you don't want to switch, you can tinker with your Ubuntu settings and revert to the classic model. Its forbidden on these forums to discuss this, but there are many articles on google that can help.

Is it really? Why? Where does it say that?

ibutho
December 1st, 2008, 10:49 AM
Is it really? Why? Where does it say that?

The thread is here (http://ubuntuforums.org/showthread.php?t=716201). It seems pretty lame to me because the information can be found elsewhere, but I will abide by the forum rules even if I don't agree with them.

cmay
December 1st, 2008, 10:55 AM
http://www.psychocats.net/ubuntucat/whats-so-bad-about-the-eee-pc-xandros-anyway/
xandrox runs as root all time. and it cant be changed. so this is perfect if you have a root complex then you can buy a Eeepc then.

i just got mine and i am going to play wiht it all night and then by the morning i hope to have either eeebuntu or debian in it. whit proper sudo rights set up :)

JohnFH
December 1st, 2008, 10:56 AM
The thread is here (http://ubuntuforums.org/showthread.php?t=716201). It seems pretty lame to me because the information can be found elsewhere, but I will abide by the forum rules even if I don't agree with them.

Oh I see. I thought you were saying it's forbidden to talk about how to make a minimal Ubuntu install (I thought that's what you meant by classic model).

ibutho
December 1st, 2008, 10:58 AM
Oh I see. I thought you were saying it's forbidden to talk about how to make a minimal Ubuntu install (I thought that's what you meant by classic model).

I was referring to the Unix classic security model.

Asgar
December 1st, 2008, 11:04 AM
Sudo this Sudo that Sudo Sudo, to sudo or not to Sudo? Who cares! it's just 4 key strokes. "I want a root account becuse I can't type Sudo fast enough with my two fingers." :P

JohnFH
December 1st, 2008, 11:49 AM
Sudo this Sudo that Sudo Sudo, to sudo or not to Sudo? Who cares! it's just 4 key strokes. "I want a root account becuse I can't type Sudo fast enough with my two fingers." :P

What happens if you have a 20 character password? Enter that every 15 mins and you would get annoyed. What about piping the results of a command to a second command that requires sudo access? What about performing command A that takes 20 mins and command B immediately after. I can't just do sudo backup && sudo shutdown and then go to bed as it would prompt for the password again. What happens if you start editing a file (with nano say) that requires root access only to discover that after you've made your changes? What about putting commands into the background, like sudo backup &?

Yes, I know the solutions to all these things, but I'm just playing devil's advocate. Using sudo (which I prefer over root login) is not just a case of pressing four extra keys (also, with my pedant hat on, it's actually 5 characters as a space is needed).

BackwardsDown
December 1st, 2008, 11:52 AM
What happens if you have a 20 character password? Enter that every 15 mins and you would get annoyed. What about piping the results of a command to a second command that requires sudo access? What about performing command A that takes 20 mins and command B immediately after. I can't just do sudo backup && sudo shutdown and then go to bed as it would prompt for the password again. What happens if you start editing a file (with nano say) that requires root access only to discover that after you've made your changes? What about putting commands into the background, like sudo backup &?

Yes, I know the solutions to all these things, but I'm just playing devil's advocate. Using sudo (which I prefer over root login) is not just a case of pressing four extra keys (also, with my pedant hat on, it's actually 5 characters as a space is needed).

You have heard of sudo -i? With that knowledge, there is no need to complain about sudo.

cmay
December 1st, 2008, 11:53 AM
alias 's'

Dr Small
December 1st, 2008, 11:53 AM
What happens if you have a 20 character password? Enter that every 15 mins and you would get annoyed. What about piping the results of a command to a second command that requires sudo access? What about performing command A that takes 20 mins and command B immediately after. I can't just do sudo backup && sudo shutdown and then go to bed as it would prompt for the password again. What happens if you start editing a file (with nano say) that requires root access only to discover that after you've made your changes? What about putting commands into the background, like sudo backup &?

Yes, I know the solutions to all these things, but I'm just playing devil's advocate. Using sudo (which I prefer over root login) is not just a case of pressing four extra keys (also, with my pedant hat on, it's actually 5 characters as a space is needed).
If I know that I am going to be running a bunch of different commands that all require sudo (for installing and setting up something), I just login as root, and skip sudo.

But sudo is faster (for me), if I need to just run one command, instead of logging in as root, running the command, and exiting the shell.

Icehuck
December 1st, 2008, 11:59 AM
Maybe it's because I'm totally doing something wrong, but I can't use fdisk with sudo. I can do it fine when I log in with root, but not with sudo. So at the moment there is one reason to use root access.

JohnFH
December 1st, 2008, 12:01 PM
yes, yes, yes I know about sudo -i and sudo -s. I'm used to it, I prefer sudo over root login, I'm a big advocate of sudo, BUT it is not as simple as four extra keystrokes and I do quite often forget to prefix sudo when editing root-write-only files. It requires a different knowledge of how to get root permission.

infoseeker
December 1st, 2008, 12:59 PM
Something I always wanted to know was how close to the 'real' root login is booting into 'recovery mode'? The reason I ask is because if I 'cd ~' under recovery mode I end up in /root ? Would it not be more appropriate to require you to login to your own user and from there issue commands using 'sudo'?

Asgar
December 1st, 2008, 01:55 PM
You have heard of sudo -i? With that knowledge, there is no need to complain about sudo.

*wink*

igknighted
December 1st, 2008, 03:49 PM
You can also turn off sudo asking for a password for a given user, so all that is required is to prepend any command with 'sudo'. Certainly a sketchy security practice, but possible...

fishtoprecords
December 1st, 2008, 04:12 PM
You are violating the forum policy (http://ubuntuforums.org/showthread.php?t=716201).

No, I don't see how you could claim this. The forum policy explicitly says not to tell folks who to run X-windows as root

It says nothing about shell root.

bodhi.zazen
December 1st, 2008, 04:17 PM
if you really want to see root@blaablaa on your term then type



sudo passwd root

poof you just added a password for root that you can use

then "su" when needed


unless you really want to log in X as root , that is a question I cant answer


but I do feel the sudo pain from time to time

If you are going to post instructions on these forums for how to set a root password please be sure to include the appropriate precautions and please be prepared to fix the breakage you cause.

If you do not know what will break, well I guess you should not be posting that advice should you ?

The way one obtains root access with Ubuntu is :

sudo -i

Or boot to recovery mode.

If sudo - is sooo difficult to type, they set an alias in .bashrc :

alias 'su -'='sudo -i'

There are times when it is necessary to set a root password, but in general this is discouraged.

ryry46d9
December 1st, 2008, 05:02 PM
sudo allows a permitted user to execute a command as the superuser or
another user, as specified in the sudoers file. The real and effective
uid and gid are set to match those of the target user as specified in
the passwd file and the group vector is initialized based on the group
file (unless the -P option was specified). If the invoking user is
root or if the target user is the same as the invoking user, no pass‐
word is required. Otherwise, sudo requires that users authenticate
themselves with a password by default (NOTE: in the default configura‐
tion this is the user’s password, not the root password). Once a user
has been authenticated, a timestamp is updated and the user may then
use sudo without a password for a short period of time (15 minutes
unless overridden in sudoers).






The su command is used to become another user during a login session.
Invoked without a username, su defaults to becoming the superuser. The
optional argument - may be used to provide an environment similar to
what the user would expect had the user logged in directly.







sudo allows a permitted user to execute a command as the superuser or
another user / The su command is used to become another user during a login session.

hmmm they both DO THE SAME DAMAGE it's just sudo has a timer



and as for sudo -i I don't understand what they mean
-i The -i (simulate initial login) option runs the shell specified in
the passwd(5) entry of the user that the command is being run as.
The command name argument given to the shell begins with a ‘-’ to
tell the shell to run as a login shell. sudo attempts to change to
that user’s home directory before running the shell. It also ini‐
tializes the environment, leaving TERM unchanged, setting HOME,
SHELL, USER, LOGNAME, and PATH, and unsetting all other environment
variables. Note that because the shell to use is determined before
the sudoers file is parsed, a runas_default setting in sudoers will
specify the user to run the shell as but will not affect which
shell is actually run.




so your saying sudo -i is the same as su ,but with a default 15 minute timer , That I aways forget about because I got other crap on my mind


as for fixing a mess I created, no
all I did was offer yet another idea, its up to you to do the home work, if your that stupid to follow ANY ones how-to's step for step with out doing your home work then you might as well be running Microsoft windows

lswb
December 1st, 2008, 05:40 PM
As others have already posted,

sudo -i

is for practical purposes the same as logging in as root; You get root's environment, home directory, .profile & .bashrc, etc.
--------------------------
On an unrelated subject, if a user is currently working at a vt (accessed with Control-Alt-F1 through Control-Alt-F6) and wishes to start X, one way to do so is to issue the command

startx -- :1

Where 1 is an unused display available to an X server.

cardinals_fan
December 1st, 2008, 10:00 PM
My opinions:

Running as root = BAD! You can do it if you like, but it's terrible security.

Having a root user, accessible through su = GOOD. I like to su to root to handle my system. I don't particularly like sudo.

starcannon
December 1st, 2008, 10:38 PM
I love Ubuntu, I love these forums, and the community they represent; however, I am very discouraged to see "books being removed from the shelves". The ability to share information is the bedrock of the community we enjoy, and while I agree with most of the forum policies, this "New forum policy on on log-in-as-root tutorials" (http://ubuntuforums.org/showthread.php?t=716201) is not in my opinion a good road to start going down. The circular reasoning found in the policy, as well as the "your responsible for what others do with your tutorials" mentality is not good for free and open computing.

Freedom carries the price of NOT being able to pass the buck if you do something you ought not have done; this does not mean I would take this to the extreme of say, allowing social viruses to be spread in the forums (variations of the rm command who's intent is nothing more than to hose someones computer for instance). But I would say that if someone wants to know how to do X, and that X's purpose is NOT to do be vicious, then it would be perfectly reasonable to explain how to do X.

I will abide by the rules, but I am worried that with the passage of this kind of nanny policies, it is only a matter of time before the forums are little more than pink ponies.