Re: run 'some' code as a different user? NET::SSH?
- From: John Clisham <jfclisham@xxxxxxxxx>
- Date: Tue, 1 May 2007 05:34:40 +0900
Brian Candler wrote:
On Tue, May 01, 2007 at 04:48:37AM +0900, John Clisham wrote:
is running under.
Is this possible? Any ideas?
The user will authenticate by providing their OS username and password?
Perhaps you could use PTY.spawn and run 'su - username'
Yes, I will authenticate useing their OS username and password. I
haven't used PTY.spawn before. Does it just spawn off a new psuedo
terminal? After doing a 'su -username' and authenicating; I want to
execute a block of ruby code as that user. Ideally that block would
return a ruby object that I could then manipulate in the broader app.
(ie since this is a Rails app, I would execute controller code as the
authenticated user (ie to get job files); and use one set of views for
all users.
Am I making sense or over thinking this? Basically, I'm trying to avoid
calling everything in shell's and reading in stdout. I'm trying to stay
completely in Ruby here.
THanks!
KF
--
Posted via http://www.ruby-forum.com/.
.
- Follow-Ups:
- Re: run 'some' code as a different user? NET::SSH?
- From: Jano Svitok
- Re: run 'some' code as a different user? NET::SSH?
- References:
- run 'some' code as a different user? NET::SSH?
- From: John Clisham
- Re: run 'some' code as a different user? NET::SSH?
- From: Brian Candler
- run 'some' code as a different user? NET::SSH?
- Prev by Date: FW: Fml status report (ruby-talk ML)
- Next by Date: Re: rdoc markup question
- Previous by thread: Re: run 'some' code as a different user? NET::SSH?
- Next by thread: Re: run 'some' code as a different user? NET::SSH?
- Index(es):
Relevant Pages
|