Geal / PilotSSH-scripts

A collection of scripts usable with the PilotSSH iOS app
http://pilotssh.com
MIT License
52 stars 14 forks source link

Run as sudo #7

Closed Geekfish closed 11 years ago

Geekfish commented 11 years ago

While accessing a server with a user that is in the sudoers, you should be able to run commands with sudo without having to log in as root.

Geal commented 11 years ago

I have some code to support sudo usage, but it was not stable enough to be included in the first release. The code is different, because with LibSSH2, it is rather easy to send one command and get the result, but it needs a lot more code for an interactive command like sudo. Would you like to beta test the sudo code? If you send me your UDID, I can build a version of the application supporting sudo, and send it to you.

Geekfish commented 11 years ago

I can do that yes! Would it be ok if I email the UDID to you instead, I would prefer not to publish on github, is there an email I can send it to? Many thanks for coming back so quickly :+1:

Geal commented 11 years ago

Yes, email is ok. You can find the support email at the end of the http://pilotssh.com/ webpage.

xenji commented 11 years ago

Why is sudo meant to be interactive? I run my nagios checks from one specific user who is able to use sudo without a password for only the check commands. This would mean you can emit the sudo command like any other command, wouldn't it?

Geal commented 11 years ago

It can be done that way, but for most users, sudo without password is not an option. They appreciate the additional protection of asking for a password.

Moreover, I want to provide a no-configuration experience: you connect, upload the scripts, and you can get rolling.

On Tue, Feb 19, 2013 at 8:17 AM, Mario Mueller notifications@github.comwrote:

Why is sudo meant to be interactive? I run my nagios checks from one specific user who is able to use sudo without a password for only the check commands. This would mean you can emit the sudo command like any other command, wouldn't it?

— Reply to this email directly or view it on GitHubhttps://github.com/Geal/PilotSSH-scripts/issues/7#issuecomment-13759940.

xenji commented 11 years ago

Ok, the zero config idea is fine for me, but using a explicit nopasswd /path/to/binary is no magic at all. In fact, this is very common for nagios/cacti/munin checks.

Geal commented 11 years ago

Yes, that's probably how I would do it too :)

Feel free to use it that way, then! You just need to replace the call to ".pilotssh/folder/script" by "sudo .pilotssh/folder/script".

On Tue, Feb 19, 2013 at 11:07 AM, Mario Mueller notifications@github.comwrote:

Ok, the zero config idea is fine for me, but using a explicit nopasswd /path/to/binary is no magic at all. In fact, this is very common for nagios/cacti/munin checks.

— Reply to this email directly or view it on GitHubhttps://github.com/Geal/PilotSSH-scripts/issues/7#issuecomment-13765203.

Geal commented 11 years ago

Sudo works in the Android version. Sudo supports will come in the next update for the iOS version.

Geal commented 11 years ago

A new iOS version was published, with sudo support.