<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">After more tests, the following works fine on Fedora-28, but not on CentOS-7.<br>
SSHPASS="$(plymouth ask-for-password --prompt 'Please, enter password:')"<br>
<br>
I'll try to identify where is the problem and maybe file a bug against plymouth.<br>
1st strace indicates that I hit:<br>
ply-boot-server.c:ply_boot_connection_send_answer():285:ply_trace ("could not finish writing answer: %m");<br>
While plymouthd server was able to get the password.<br>
It seems unable to give it back to the plymouth command.<br>
<br>
Cheers,<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font face="Tahoma">-- <br>
   Olivier LAHAYE<br>
   CEA DRT/LIST/DIR</font><br>
</div>
</div>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF140968" style="direction: ltr;"><font size="2" face="Tahoma" color="#000000"><b>De :</b> plymouth [plymouth-bounces@lists.freedesktop.org] de la part de LAHAYE Olivier<br>
<b>Envoyé :</b> mardi 3 juillet 2018 18:22<br>
<b>À :</b> plymouth@lists.freedesktop.org<br>
<b>Objet :</b> [PROVENANCE INTERNET] Plymouth password handling.<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<div><br>
</div>
<div>Hi,</div>
<div><br>
</div>
<div>I've written a complex them to handle systemimager imaging process.</div>
<div>Everythings works perfectly and I can even image a system and finish boot without rebooting.</div>
<div><br>
</div>
<div>I'm now in the process og having deployemnt onver an ssh tunnel.</div>
<div>My dracut module is able to handle local ssh keys, retreive a public key using curl or rsync, but a more simple way would be to ask for ssh password.</div>
<div><br>
</div>
<div>I'm testing on CentOS-7 latest update.</div>
<div><br>
</div>
<div>My theme (script) works fin asking for a password, but I'm totally unable to retreive it or use it.</div>
<div><br>
</div>
<div>I've tried 3 aproaches.</div>
<div>1/ without using the --command => unable to retreive the password from standard input.<br>
</div>
<div>SSHPASS="$(plymouth ask-for-password --prompt 'Please, enter password:')" sshpass -e ssh oscar-server 'hostname' > /tmp/result</div>
<div>=> Doesn't work. $SSHPASS is empty. <br>
</div>
<div><br>
</div>
<div>plymouth ask-for-password --prompt 'Please, enter password:' > /tmp/password</div>
<div>=> creates an empty password.</div>
<div><br>
</div>
<div>2/ using the --command => I must type the password twice???!!!</div>
<div>plymouth ask-for-password --prompt "Please, enter password:" --command "ssh my-server 'hostname'" --number-of-tries=3 > /tmp/result<br>
</div>
<div>=> 1st time I tiype password: the password dialog close when I hit enter. Then I type blindly and it works :-/</div>
<div>In text mode, I see the plymouth password prompt, I type the password, hit enter and then I get the ssh password propt, I reenter password and it works.</div>
<div><br>
</div>
<div>3/ using systemd-ask-password => doesn't display password dialog under plymouth and not available on centos-6...</div>
<div>SSHPASS="$(systemd-ask-password 'SSH password')" sshpass -e ssh oscar-server 'hostname' > /tmp/result</div>
<div> => Works in text mode. In GUI mode, no password dialog appears.</div>
<div>=> Not available on centos-6 (that I have to support as it's still maintained).</div>
<div><br>
</div>
<div>Any advise or help would be greatly apreciated.</div>
<div><br>
</div>
<div>github theme source:</div>
<div><a href="https://github.com/finley/SystemImager/tree/initrd-from-imageserver-and-dont-package-initrd/lib/dracut/modules.d/51systemimager/plymouth_theme" target="_blank" rel="noopener noreferrer">https://github.com/finley/SystemImager/tree/initrd-from-imageserver-and-dont-package-initrd/lib/dracut/modules.d/51systemimager/plymouth_theme</a></div>
<div><br>
</div>
<div>Inside this directory, my plymouth_test.sh script.</div>
<div><br>
</div>
<div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font face="Tahoma">-- <br>
   Olivier LAHAYE<br>
   CEA DRT/LIST/DIR</font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>