Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


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

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
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

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

%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:

alias nopass='sudo su -'
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...


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

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


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 > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration