file attributes

Discussion in 'Ruby' started by Krekna Mektek, Jan 5, 2007.

  1. Lo!

    Busy with my program, I run in to 2 questions.

    In a certain method I want to open a ssh connection by a certain user.
    I need to sudo to an ssh user to make the passwordless connection via
    public-private key authorization. How can I do this in Ruby?
    FYI: I am not allowed to use sudo su - ssh -c [ssh command].

    Thanks,
    Krekna
     
    Krekna Mektek, Jan 5, 2007
    #1
    1. Advertising

  2. Krekna Mektek

    Jan Svitok Guest

    On 1/5/07, Krekna Mektek <> wrote:
    > Lo!
    >
    > Busy with my program, I run in to 2 questions.
    >
    > In a certain method I want to open a ssh connection by a certain user.
    > I need to sudo to an ssh user to make the passwordless connection via
    > public-private key authorization. How can I do this in Ruby?
    > FYI: I am not allowed to use sudo su - ssh -c [ssh command].


    1. you can start programs by `command` or Kernel#system, or IO#popen
    2. you probably want to call `sudo -u <username> ssh -c <command>`
    or even
    user = 'joe'
    cmd = 'ls'
    `sudo -u #{user} ssh -c #{cmd}`
    but then be careful what you are passing there.
     
    Jan Svitok, Jan 5, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Max
    Replies:
    1
    Views:
    515
    Joe Kesselman
    Sep 22, 2006
  2. P4trykx
    Replies:
    2
    Views:
    1,891
    bruce barker
    Jan 31, 2007
  3. james_027

    class attributes & data attributes

    james_027, Jun 20, 2007, in forum: Python
    Replies:
    2
    Views:
    412
    Bruno Desthuilliers
    Jun 20, 2007
  4. Kyle Schmitt
    Replies:
    3
    Views:
    226
    Kyle Schmitt
    Jul 24, 2007
  5. Jayden
    Replies:
    16
    Views:
    561
    Steven D'Aprano
    Sep 29, 2012
Loading...

Share This Page