Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    19

    Unanswered: Login to another server

    Hi ,

    I have a requirement like .

    I am executing a scripts like xx.sh . Middle of the script
    I want to login into some other user and with same host (from that xx.sh only) and execute some scripts and want to print result from xx.sh and than come back to original user .

    Please help me to write a script .

    Thanks
    Manash
    Last edited by MANASH3250; 01-28-04 at 09:35.
    Manash Ranjan

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Login to another server

    Originally posted by MANASH3250
    Hi ,

    I have a requirement like .

    I am executing a scripts like xx.sh . Middle of the script
    I want to login into some other user and with same host (from that xx.sh only) and execute some scripts and want to print result from xx.sh and than come back to original user .

    Please help me to write a script .

    Thanks
    Manash
    Check Openssh documentation and you will find the wanted solution...

  3. #3
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    19

    Re: Login to another server

    Originally posted by ika
    Check Openssh documentation and you will find the wanted solution...
    Hi ika .

    I didn't find any solution in Openssh . Can u please tell me more
    about this and how to do this .

    Thanks
    Manash
    Manash Ranjan

  4. #4
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Login to another server

    Originally posted by MANASH3250
    Hi ika .

    I didn't find any solution in Openssh . Can u please tell me more
    about this and how to do this .

    Thanks
    Manash
    Search for following topic:
    - key generation

    You need generate the keys. You take the public key (usually id_rsa.pub or id_dsa_pub) and put its content in to the /home/user/.ssh/authorized_keys file on the remote machine
    This is needed for automatic logon without entering the password (security is solved by the paar of keys).

    Then "man ssh" and look at 7th line and there is answer how you can run the command over ssh.

    Hope that helps. If not let me know

  5. #5
    Join Date
    Dec 2003
    Posts
    56
    If you are running your main script as root you might want to look into the su command.

    An other option might be expect...It's a tool which can respond to certain phrases...you coud set up a expect script (called from xx.sh) to log in and give the poassword...unfortunatly expect doesn't use coded paswrods :/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •