Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo support #19

Closed
ghost opened this issue Feb 13, 2014 · 3 comments
Closed

sudo support #19

ghost opened this issue Feb 13, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 13, 2014

Is there any better way to make Envoy work with sudo other than turning off password request in visudo?

@allmarkedup
Copy link

I'm wondering this too. Trying to use sudo but getting the error 'sorry, you must have a tty to run sudo'.

@ghost
Copy link
Author

ghost commented Feb 15, 2014

I've found a library that could help with sudo and other interactive commands.
I haven't tested it yet but it looks promising. It's called phpseclib
The sudo communication looks like this

login('username', 'password')) { exit('Login Failed'); } echo $ssh->read('username@username:~$'); $ssh->write("sudo ls -la\n"); $output = $ssh->read('#[pP]assword[^:]_:|username@username:~\$#', NET_SSH2_READ_REGEX); echo $output; if (preg_match('#[pP]assword[^:]_:#', $output)) { $ssh->write("password\n"); echo $ssh->read('username@username:~$'); }

@taylorotwell
Copy link
Member

No plans for this at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants