Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #95455
| References | <a6b3da0b-d9be-4241-8577-85aafca72440@googlegroups.com> |
|---|---|
| Date | 2015-08-18 13:06 +1000 |
| Subject | Re: execute commands as su on remote server |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.70.1439867208.4764.python-list@python.org> (permalink) |
On Tue, Aug 18, 2015 at 12:57 PM, <harirammanohar159@gmail.com> wrote: > I need to execute commands after doing su to other user on remote server(not sudo which doesn't require password) how i can achieve this using python? > I googled and came to know that its not possible, so just for confirmation asking again, is it possible ? Ultimately, this isn't a Python question, it's a systems administration one. You want a way to execute commands as a specific user, triggering them remotely. There are basically two ways you can do this: either you provide some form of credentials (this is what sudo does), or you elevate the entire management process. The latter option is far FAR easier (running it as root if you might need to go to any different user, or as that specific user if you'll only ever use one), but then you have to ensure, in some way, that your Python program can't be compromised. Python has nothing to do with any of this. If you want to manage elevation using sudo, Python can invoke sudo in a subprocess. If you want to elevate the Python process and then simply invoke something directly, Python won't even be aware of it. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
execute commands as su on remote server harirammanohar159@gmail.com - 2015-08-17 19:57 -0700
Re: execute commands as su on remote server Chris Angelico <rosuav@gmail.com> - 2015-08-18 13:06 +1000
Re: execute commands as su on remote server harirammanohar159@gmail.com - 2015-08-18 23:58 -0700
Re: execute commands as su on remote server harirammanohar159@gmail.com - 2015-08-19 00:02 -0700
Re: execute commands as su on remote server Laura Creighton <lac@openend.se> - 2015-08-19 10:44 +0200
Re: execute commands as su on remote server Laura Creighton <lac@openend.se> - 2015-08-19 10:51 +0200
Re: execute commands as su on remote server harirammanohar159@gmail.com - 2015-09-01 05:16 -0700
Re: execute commands as su on remote server Laura Creighton <lac@openend.se> - 2015-09-01 15:25 +0200
Re: execute commands as su on remote server Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-09-02 09:05 +0200
Re: execute commands as su on remote server harirammanohar159@gmail.com - 2015-10-01 00:10 -0700
csiph-web