The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
rsh help - getting the output of remote script to local server. aster007 Shell Programming and Scripting 5 03-07-2009 10:14 AM
Transfer file from local unix server to remote server indira Shell Programming and Scripting 2 05-03-2007 06:35 AM
Transfer file from local unix server to remote server indira HP-UX 2 05-02-2007 05:15 PM
FTP multiple files from remote server to local server berlin_germany Shell Programming and Scripting 2 12-20-2006 03:24 AM
executing a remote location script from local server srivsn Shell Programming and Scripting 2 02-28-2006 03:16 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-26-2009
luna_soleil luna_soleil is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 33
Can a script runned in local server access remote server?

Hi,

Im creating a script that is supposed to run commands on remote server using sftp.

My script is as below:

#!/bin/ksh
sftp remote_server
mypassword
cd /u08/mydir/allfiles
mget *
..


But this is what I got when I runned the script:

Connecting to remote server...
Password:

It hangs at Password: without inputting the "mypassword" that I specied in the script. Anything that I can do to fix this? Please help
  #2 (permalink)  
Old 02-26-2009
ShawnMilo ShawnMilo is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 252
The password can't be entered as in the sample script.

Depending on your sftp client, you can probably do something like:

sftp username:password@remote_server

Even better would be to create an ssh key and add it to the authorized_keys file in .ssh on the server. Then you wouldn't need a password at all.
  #3 (permalink)  
Old 02-26-2009
luna_soleil luna_soleil is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 33
Hi ShawnMilo..

Could you please explain more about authorized_keys file in .ssh on the server?
Which server do u mean, the local or remote?
and where do i find the .ssh file ?

I tried to do sftp usernameassword@remote_server but this is not working.

Thanks a bunch
  #4 (permalink)  
Old 02-26-2009
ShawnMilo ShawnMilo is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 252
Do some searching on this forum -- I'm sure it has been discussed a hundred times. Here are the keywords you want to search for:

authorized_keys
ssh-keygen
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0