Sponsored Content
Top Forums Shell Programming and Scripting Script to connect to a remote server and execute scripts Post 302349860 by pludi on Wednesday 2nd of September 2009 05:13:41 AM
Old 09-02-2009
SSH + Public Key Authentication. Both are very well documented in various threads and on the Web.
 

9 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Connect to a Remote Sybase Server Through Script.

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (2 Replies)
Discussion started by: Aparna_k82
2 Replies

2. Shell Programming and Scripting

Connect to a Remote Sybase Server Through Script

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (3 Replies)
Discussion started by: Aparna_k82
3 Replies

3. Shell Programming and Scripting

shell script for how to connect to a remote server by using ssh

i want to connect to a remote server through ssh. i have to also provide password within that script. after connecting to the remote server i want to do some operations like grep,cd etc can u pls help me to wite a script. Thanks (1 Reply)
Discussion started by: millan
1 Replies

4. Shell Programming and Scripting

Connect to differect server and execute the script

Hello Everyody Please help me with the below problem. I have two servers names server1 and server2. From server1, i have to connect to server2 and execute a script residing on server2. How can i achieve this? (6 Replies)
Discussion started by: vasuarjula
6 Replies

5. Shell Programming and Scripting

Execute scripts on remote server

Hi All, I need to first of all establish a connection to remote unix server non-interactively with the help of a shell script and then connect to oracle database from that server all with this script of mine. Please suggest the best method which could be used to connect to server for executing... (1 Reply)
Discussion started by: m_kapur83
1 Replies

6. Shell Programming and Scripting

Execute a local script against a remote server

I am unable to run the below script against a remote server due to syntax error (then unexpected), but i am able to run it locally. Am i executing it correctly or is there any other way to execute it. ssh username@servernname ksh -s < scriptname #!/bin/ksh function record { ((end =... (5 Replies)
Discussion started by: NarayanaPrakash
5 Replies

7. Shell Programming and Scripting

How to execute commands on remote server using expect script?

I need to copy python script file to around 100 servers using expect script. 1. Copy script to my user home first(/home/myhome) on each remote server 2. change permissions on copied file to 766. 3. sudo to appuser1 account on remote server. copy script file from my user home to /usr/bin/... (1 Reply)
Discussion started by: kchinnam
1 Replies

8. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

9. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies
SSH2_AUTH_HOSTBASED_FILE(3)						 1					       SSH2_AUTH_HOSTBASED_FILE(3)

ssh2_auth_hostbased_file - Authenticate using a public hostkey

SYNOPSIS
bool ssh2_auth_hostbased_file (resource $session, string $username, string $hostname, string $pubkeyfile, string $privkeyfile, [string $passphrase], [string $local_username]) DESCRIPTION
Authenticate using a public hostkey read from a file. PARAMETERS
o $session - An SSH connection link identifier, obtained from a call to ssh2_connect(3). o $username - o $hostname - o $pubkeyfile - o $privkeyfile - o $passphrase - If $privkeyfile is encrypted (which it should be), the passphrase must be provided. o $local_username - If $local_username is omitted, then the value for $username will be used for it. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Authentication using a public hostkey <?php $connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa')); if (ssh2_auth_hostbased_file($connection, 'remoteusername', 'myhost.example.com', '/usr/local/etc/hostkey_rsa.pub', '/usr/local/etc/hostkey_rsa', 'secret', 'localusername')) { echo "Public Key Hostbased Authentication Successful "; } else { die('Public Key Hostbased Authentication Failed'); } ?> NOTES
Note ssh2_auth_hostbased_file(3) requires libssh2 >= 0.7 and PHP/SSH2 >= 0.7 PHP Documentation Group SSH2_AUTH_HOSTBASED_FILE(3)
All times are GMT -4. The time now is 10:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy