Originally Posted by deibertine
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 ??
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.