Link to home
Start Free TrialLog in
Avatar of linuxperson
linuxpersonFlag for Canada

asked on

script

[root@host ~]# grub-md5-crypt
Password:
Retype password:
$1$bQ14m1$RwVVO7svf57j9Dm33333

I want to script above command. Basically i want to pass the password in the script and want to save the encrypted password to a variable.
Avatar of gheist
gheist
Flag of Belgium image

If one gets to entering grub password they are in good position to use MicroSD card to remove grub boot password.
Avatar of linuxperson

ASKER

then what is the purpose of having this password
In GRUB - none - on physical machine adversary can boot off the CD, copy your data or/and remove password, on virtual system it will prevent system start and invite you to work on sunday to enter the password....
It is still a valid salted md5 hash that you can use in passwd file.
To protect data you need real encryption, not some password dialog.
please let me know if you can help me with my original question.
VARIABLE=`passwd`
echo "abc" | passwd test --stdin

similar way i am trying  to do

echo "abc" |  grub-md5-crypt --stdin

Not working. Please let me know how to do this.
mkpasswd command if present takes stdin argument
Can you please provide me the exact command for echo "abc" |  grub-md5-crypt --stdin  this issue
echo abc | htpasswd -1 -
echo abc | openssl passwd -1 --stdin
...
...
ASKER CERTIFIED SOLUTION
Avatar of skullnobrains
skullnobrains

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks
it works