LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 07:42 PM   #1
officecase
Member
 
Registered: Jan 2007
Distribution: Centos, ArchLinux
Posts: 40

Rep: Reputation: 18
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, 08:11 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
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 :

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 08:20 PM.
 
Old 05-11-2007, 11:05 AM   #3
officecase
Member
 
Registered: Jan 2007
Distribution: Centos, ArchLinux
Posts: 40

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


Reply



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 01:38 PM
alias ll='ls -l --color=tty' bhar0761 Linux - Newbie 3 01-29-2006 11:02 AM
Can't gain new ROOT access dauphinfay Linux - General 3 07-28-2005 12:38 AM
Gain root access to user longnam Slackware 5 03-29-2005 11:43 AM
Shell scripts: gain root access - how? ludeKing Programming 16 09-02-2004 10:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:43 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
Open Source Consulting | Domain Registration