Vagrant, sudo and requiretty

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Vagrant, sudo and requiretty

Torben Knerr
Hi everybody,

given you are working on a cloud platform which has `Defaults requiretty` in `/etc/sudoers` Vagrant will fail with an error like that:


[my_server] Rsyncing folder: /cygdrive/D/Repos/_github/vagrant-managed-servers/ => /vagrant
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir -p '/vagrant'

Stdout from the command:



Stderr from the command:

sudo: sorry, you must have a tty to run sudo


How are you guys dealing with that?

Is there a way to tell vagrant to use ssh with the `-t` option for the communicate methods:

env[:machine].communicate.sudo("mkdir -p '/vagrant'")


I have only found https://github.com/mitchellh/vagrant-aws/issues/72 which is still open


Cheers,
Torben

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant, sudo and requiretty

Peter Idah
Hi,

Applying config.ssh.pty = true seems to fix this issue as referenced in https://github.com/mitchellh/vagrant/issues/1482 
but it seems to break some vagrant in-built commands as referenced in https://github.com/mitchellh/vagrant/issues/3063

Regards,
Peter




On Fri, Jun 13, 2014 at 9:39 AM, Torben Knerr <[hidden email]> wrote:
Hi everybody,

given you are working on a cloud platform which has `Defaults requiretty` in `/etc/sudoers` Vagrant will fail with an error like that:


[my_server] Rsyncing folder: /cygdrive/D/Repos/_github/vagrant-managed-servers/ => /vagrant
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir -p '/vagrant'

Stdout from the command:



Stderr from the command:

sudo: sorry, you must have a tty to run sudo


How are you guys dealing with that?

Is there a way to tell vagrant to use ssh with the `-t` option for the communicate methods:

env[:machine].communicate.sudo("mkdir -p '/vagrant'")


I have only found https://github.com/mitchellh/vagrant-aws/issues/72 which is still open


Cheers,
Torben

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
Sign-up to receive updates on my upcoming book – DevOps 101 now! – http://www.DevOps101.com

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant, sudo and requiretty

Torben Knerr
Hi Peter,

thanks, that did the trick. Exactly what I was looking for!

Cheers,
Torben



On Fri, Jun 13, 2014 at 5:05 PM, Peter Idah <[hidden email]> wrote:
Hi,

Applying config.ssh.pty = true seems to fix this issue as referenced in https://github.com/mitchellh/vagrant/issues/1482 
but it seems to break some vagrant in-built commands as referenced in https://github.com/mitchellh/vagrant/issues/3063

Regards,
Peter




On Fri, Jun 13, 2014 at 9:39 AM, Torben Knerr <[hidden email]> wrote:
Hi everybody,

given you are working on a cloud platform which has `Defaults requiretty` in `/etc/sudoers` Vagrant will fail with an error like that:



[my_server] Rsyncing folder: /cygdrive/D/Repos/_github/vagrant-managed-servers/ => /vagrant
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir -p '/vagrant'

Stdout from the command:



Stderr from the command:

sudo: sorry, you must have a tty to run sudo


How are you guys dealing with that?

Is there a way to tell vagrant to use ssh with the `-t` option for the communicate methods:

env[:machine].communicate.sudo("mkdir -p '/vagrant'")


I have only found https://github.com/mitchellh/vagrant-aws/issues/72 which is still open


Cheers,
Torben

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
Sign-up to receive updates on my upcoming book – DevOps 101 now! – http://www.DevOps101.com

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.