Re: run 'some' code as a different user? NET::SSH?



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/.

.



Relevant Pages

  • Re: PEAP, WinXP, IAS, wrong username
    ... One of the problems could be that the configuration for mschapv2 might not ... Is the winxp machine part of a domain? ... because if turn off "authenticate users on this ... it seems like this username is based on the MAC-adress on the clients NIC. ...
    (microsoft.public.internet.radius)
  • Re: a webservice to authenticate the users against
    ... public bool ValidateUser(string username, string passwordHash); ... [WebService] ... > 4) Can query our internal Active Directory to authenticate our ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Authentication with IE
    ... When I am prompted to log into the site, I enter my username and password. ... It then returns back with the local server as the prefix as opposed to the ... permissions prompts for authenticaton). ... I want the users to authenticate against foo.com, ...
    (microsoft.public.inetserver.iis.security)
  • Re: Dovecot issue
    ... Robert Trembath wrote: ... > The server is setup as a single domain setup. ... be sure that their username is the same exact case as entered into ... authenticate, but report 0 messages, UNLESS you matched the username to ...
    (Fedora)
  • Re: run some code as a different user? NET::SSH?
    ... > The user will authenticate by providing their OS username and password? ... I will authenticate useing their OS username and password. ... return a ruby object that I could then manipulate in the broader app. ... You probably won't be able to avoid more processes though, ...
    (comp.lang.ruby)