Posts

Showing posts with the label sudo

Sudo in Fabric2

Sudo in Fabric2 I would like to reproduce the behavior of my old Fabric1 script running sudo('useradd -m -u --groups mygroup myuser') In that case the remote machine (an Ubuntu AWS instance) would prompt me for my sudo password and I was able to type it in. Even the repeated prompt after a wrong input would work. After that Fabric1 would hold on to that password by keeping the connection open. In my new Fabric 2.x script I am using within a @task c.sudo('useradd -m -u --groups mygroup myuser') I am still getting a user prompt but it does not wait for my response, I am not able to type the password, and it fails as expected with invoke.exceptions.AuthFailure: The password submitted to prompt '[sudo] password: ' was rejected Using the --prompt-for-sudo-password argument has the same (or no effect). I also tried run('sudo useradd -m -u --groups mygroup myuser') and received sudo: no tty present and no askpass program specified I would preferable not set the...