LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-27-2004, 07:59 PM   #1
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Rep: Reputation: 15
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!
 
Old 10-27-2004, 08:10 PM   #2
bluesman2333
Member
 
Registered: Dec 2003
Location: Phoenix, Az.
Distribution: Xubuntu Edgy
Posts: 330

Rep: Reputation: 30
"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?
 
Old 10-27-2004, 08:15 PM   #3
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
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.
 
Old 10-27-2004, 08:16 PM   #4
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
that, and i'm just plain lazy :-p
 
Old 10-27-2004, 08:23 PM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
issue and read "man sudoers"

and you can change owner to users in /etc/fstab
and you can then mount those partitions as user
 
Old 10-27-2004, 09:01 PM   #6
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
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:
-e command [arguments]
Run the command with its command-line arguments in the aterm window; also sets the window title and icon name to be the basename of the program being executed if neither -title (-T) nor -n are given on the command line. If this option is used, it must be the last on the command-line. If there is no -e option then the default is to run the program specified by the SHELL environment variable or, failing that, sh(1).

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.
 
Old 10-27-2004, 09:31 PM   #7
corbintechboy
Member
 
Registered: Sep 2003
Location: Kentucky
Posts: 480
Blog Entries: 1

Rep: Reputation: 51
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.
 
Old 10-27-2004, 10:30 PM   #8
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
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.
 
Old 10-27-2004, 10:36 PM   #9
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
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.
 
Old 10-27-2004, 10:45 PM   #10
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
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.
 
Old 10-28-2004, 01:12 AM   #11
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
thanks a lot for the replies!!!


after addin by visudo

<user name> <server-name> = NOPASSWD: /bin/su

the lazy man dream completes
 
Old 10-28-2004, 01:23 AM   #12
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
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!
 
Old 10-28-2004, 08:08 PM   #13
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
lol! gratz on getting it to work though ^^
 
  


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
sign on invisible in gaim - NOT invi after sign on saravkrish Linux - Software 7 09-12-2005 11:55 PM
can't sign on as root samuelmp Ubuntu 3 09-04-2005 10:36 AM
can't sign in as root howarddevore Debian 6 07-18-2005 02:16 PM
Why must I sign on as root before using KPPP dialup? jawq Linux - Newbie 4 06-11-2005 11:37 AM
rm command even as root ch4s3r Linux - Software 4 11-07-2003 01:45 PM


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