Re: Change user on UNIX

2008-03-29 Thread Tim Roberts
Giampaolo Rodola' [EMAIL PROTECTED] wrote: I'll try to describe what I'm actually trying to implement so that maybe it can help you understand a little better. The application is an asynchronous FTP server implementation. I decided that it would be desirable to change the current implementation

Re: Change user on UNIX

2008-03-27 Thread Giampaolo Rodola'
Sorry for replying so late. I'll try to describe what I'm actually trying to implement so that maybe it can help you understand a little better. The application is an asynchronous FTP server implementation. I decided that it would be desirable to change the current implementation so that every

Change user on UNIX

2008-03-20 Thread Giampaolo Rodola'
Hi all. Is there any way to su or login as a different user within a python script? I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. I tried to google a little bit about it but I still didn't find a solution. Thanks in advance.

Re: Change user on UNIX

2008-03-20 Thread Bjoern Schliessmann
Giampaolo Rodola' wrote: Is there any way to su or login as a different user within a python script? I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. I tried to google a little bit about it but I still didn't find a solution.

Re: Change user on UNIX

2008-03-20 Thread Jonathan Gardner
On Mar 20, 4:51 am, Giampaolo Rodola' [EMAIL PROTECTED] wrote: Hi all. Is there any way to su or login as a different user within a python script? I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. I tried to google a little bit

Re: Change user on UNIX

2008-03-20 Thread Jeffrey Froman
Giampaolo Rodola' wrote: I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. If the script is run as root, you can freely impersonate other users with the os.seteuid() and os.setegid() methods. If the script is not run as root

Re: Change user on UNIX

2008-03-20 Thread Jeff Schwab
Jonathan Gardner wrote: On Mar 20, 4:51 am, Giampaolo Rodola' [EMAIL PROTECTED] wrote: Is there any way to su or login as a different user within a python script? I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. In the unix

Re: Change user on UNIX

2008-03-20 Thread Preston Landers
On Mar 20, 9:46 am, Jonathan Gardner [EMAIL PROTECTED] wrote: In the unix world, this is highly discouraged. You shouldn't have to change your user. The only user who can change roles---and who should change roles for security reasons---is root. IMHO this statement is a bit too broad. The