LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-10-2007, 08:42 PM   #1
officecase
Member
 
Registered: Jan 2007
Distribution: Centos, ArchLinux
Posts: 38

Rep: Reputation: 17
alias for user to gain root tty with no passwd


I am looking to add a line in the .bashrc so when I open up a terminal I am given a root prompt without being prompted for a password. Or maybe there is a better way to do this.

I know about su and sudo. I know it is a big security risk. I am just trying to create an alias root account close enough to the root without being the root. And I don't want to change my UID to 0.
 
Old 05-10-2007, 09:11 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
You could add yourself to the /etc/sudoers and add this line under the section # Same thing without a password :

Code:
%group        ALL=(ALL)       NOPASSWD: ALL
%group is the name of the primary group the user that you want to have automatic root access (to find out the primary group type id in the command line). Then under the .bashrc file add the lines:

Code:
alias nopass='sudo su -'
nopass
Next time you login you'll have root access without a password....BE CAREFUL...I havent actually tried this but It might work. If I'm wrong somone correct me...

-custangro

Last edited by custangro; 05-10-2007 at 09:20 PM.
 
Old 05-11-2007, 12:05 PM   #3
officecase
Member
 
Registered: Jan 2007
Distribution: Centos, ArchLinux
Posts: 38

Original Poster
Rep: Reputation: 17
Wow! That worked like a charm! Thank you very much!
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alias name for user root? officecase Linux - Security 9 05-10-2007 02:38 PM
alias ll='ls -l --color=tty' bhar0761 Linux - Newbie 3 01-29-2006 12:02 PM
Can't gain new ROOT access dauphinfay Linux - General 3 07-28-2005 01:38 AM
Gain root access to user longnam Slackware 5 03-29-2005 12:43 PM
Shell scripts: gain root access - how? ludeKing Programming 16 09-02-2004 11:35 PM


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