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 07-19-2010, 01:05 PM   #1
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Rep: Reputation: 30
How to generate a "masked" root password?


Just wondering if its possible to "mask" a root password?
I have a script that starts up an application.
Running the application within the script requires me to reveal the root password.
I was wondering if there's a way to mask the password via encryption (secretpw) or such tools that are out there I can use to mask the real password with an encrypted line?
Using CentOS.
Please advise.
Cheers,
DB
 
Old 07-19-2010, 01:10 PM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Do you mean, the script asks for the password, but you don't want the password shown on the screen as you type it? Are you using the shell built-in "read" to ask for the password? If so, `read -s` is silent mode, which does not echo the entered characters to the screen as you type.

If I've missed the idea here completely, please clarify
 
Old 07-19-2010, 01:19 PM   #3
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by GrapefruiTgirl View Post
Do you mean, the script asks for the password, but you don't want the password shown on the screen as you type it? Are you using the shell built-in "read" to ask for the password? If so, `read -s` is silent mode, which does not echo the entered characters to the screen as you type.

If I've missed the idea here completely, please clarify
Sorry for not clarifying but the password is not as I type.
The password itself is inputted in the script:
-u root -p TeslaR3vv!
Can I generate an encrypted root password using a tool of some sort then input that encrypted password to the script instead of the real actual password ??

Tnx
 
Old 07-19-2010, 01:52 PM   #4
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,944

Rep: Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671
Quote:
Originally Posted by deibertine View Post
Sorry for not clarifying but the password is not as I type.
The password itself is inputted in the script:
-u root -p TeslaR3vv!
Can I generate an encrypted root password using a tool of some sort then input that encrypted password to the script instead of the real actual password ??

Tnx
Spell out your words.

And I'm sure many others will point out how horribly unsafe this is, so I'm not going to go there. While you *CAN* generate an encrypted string, you'll still have to DEcrypt it, before you can use it. That method will have to be 'callable' and/or easily reversible. So much so, it's pointless to do it.

The best option I can think of right away, is that you can put your 'regular' user into the sudoers file, and give it access to that ONE command you'd like to run. Have your script then check the UID to see if it's running as root or not, and if so, execute. That way, the root password is safe, and not hard coded into a program (which can be a problem later), and isn't exposed. And if someone compromises your 'regular' user ID, they STILL can't get root access, since the only thing it can do is run that ONE command.
 
  


Reply

Tags
encrypted, encryption, password, root login


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
"su - root" giving incorrect password but normal root login works. ?? arashi256 Linux - Newbie 10 06-03-2010 04:13 AM
Unable to reset root password / init: "x" respawning very fast gshenbag Linux - Enterprise 5 12-30-2009 03:19 AM
Tried to Install Flash Plugin but says "Authenticating as Root" password required David Underhill Linux - Laptop and Netbook 5 11-05-2009 06:36 AM
New system won't allow root after installation - using correct password and "root" kn2y Linux - Newbie 6 11-07-2008 08:52 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM


All times are GMT -5. The time now is 11:00 PM.

Main Menu
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