how do i sign into root with one command?
hey all
so here's a real lazy man's question, i'm sick of typing su and then my password all the time into the console to get access, and i dont' like signin on as root, so i'm wondering, is there any brilliant oneline code that'll leme sign into root? something like su | <the password> or something ? i mean, it'd be nice to have a button on fluxbox menu to shutdown/reboot the computer and not the X server without havin to sign in, thanks! :p |
"i'm sick of typing su and then my password all the time"???
You shouldn't need to do anything in root very often at all. I haven't done that for months! What are you doing that needs root permissions so often? |
i work with debian
the apt-get system uses root, so i install and remove --purge a lot of things with root constantly, but i don't like leavin the root window open, so yeah, plus i work with ntfs and fat partitions, i believe they require root to gain access. |
that, and i'm just plain lazy :-p
|
issue and read "man sudoers"
and you can change owner to users in /etc/fstab and you can then mount those partitions as user |
i mean honestly. i'm lazy, but that's in another category altogether! lol. i just leave one aterm open on one of my desktops, and anything that requires root access i do from there. i understand you don't want to have to do that, but it really is probably the laziest way of doing things. oh, unless there's a way to pass aterm (or whatever) a username and password like you pass it other options.
Quote:
i just found that, so i suppose in ~/.fluxbox/menu (or wherever) you could have an entry something like this: [exec] (aterm -- root) {aterm -tr -trsb -fg green -e su root} i don't know if it will work, but it's worth playing around with. also, i know that aterm can be called as a login shell, or as a subshell which inherits variables/permissions from the owner...it would stand to reason that it needs to be told who the owner is, and therefore, that you can tell it who the owner is. i wish i knew how...i'll try doing more research if i have the time. |
I am behind a router and know my box pretty well. I might get flamed for this but I dont see a problem running as root under these conditions. And if one were to mess up a system under root the install process of distros today is pretty painless.
|
obviously the choice is entirely up to you. if you're comfortable with it, then who am i to criticize you for it? it's your box after all. i think it's fantastic that linux has the built-in separation of powers, but what i also think is fantastic is that linux allows you to do whatever you want with it, so if you want to run as root, more power to you. but it's not a piece of advice i would give to someone else, especially someone new to linux.
|
well, i'm at home on my linux box now, and i just tried out the -e option with aterm. it works with su, so if you type
aterm -e su it opens an aterm, and prompts you for the root password. but i don't know how to pass it the password in the same command...possibly with some sort of i/o stream or something. i don't really know what i'm talking about though. gonna keep looking. |
hmm, i'm reading about sudo now. stop me if you know this already, but sudo allows you to create a file that lists users and commands they are allowed to run (that normally would require root permission).
here's one page about it: http://www.siliconvalleyccie.com/linux-hn/sudo.htm and there are lots more if you google/linux it. then you could do what you wanted in one command, after you set up the sudoers file properly. |
thanks a lot for the replies!!!
after addin by visudo <user name> <server-name> = NOPASSWD: /bin/su the lazy man dream completes :) |
actually in retrospect my previous post is a huge security breach...
so a better solution and still a security issue but less is the following in visudo <user name> <server-name> = NOPASSWD: /sbin/reboot, /sbin/shutdown thanks to all i guess the real secure way for me to save typing my password has to be to have a finger-print test as i type sudo su into the computer, let's all wish for that in year... 2040 and may the red sox triumph many times in world series before then! |
lol! gratz on getting it to work though ^^
|
All times are GMT -5. The time now is 07:56 PM. |