Sftp in shell Scripting issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sftp in shell Scripting issue
# 1  
Old 10-04-2012
Sftp in shell Scripting issue

I have the below code for ftping a file
Code:
sftp "ogl@serverna,me"ogl@serverna,me <<EOF 
cd $path_on_the_server
binary
put $path_on_my_sever/filename.txt
bye 
EOF

Not sure is this works.but when i tried its asking for password .How i can avoid asking password and provide it in the script.Please let me know.

Moderator's Comments:
Mod Comment Please use code tags next time for your code and data.

Last edited by vbe; 10-04-2012 at 06:34 AM..
# 2  
Old 10-04-2012
is the passwordless setup is done b/w your destination and source server ?

Is the user@host is correct ?
Code:
 
sftp "ogl@serverna,me"ogl@serverna,me

# 3  
Old 10-04-2012
The host name is correct =>sftp ogl@servername

How do i setup this password less setup b/w my destination and source server ?

Thanks
Shyam
# 4  
Old 10-04-2012
just google it "passwordless ssh setup"
# 5  
Old 10-09-2012
the destination is a windows server.The windows admin says that he is unable to generate the key for this.
Please help
# 6  
Old 10-09-2012
Why you need the public key for the destination server?

Generate the public key of your unix server and provide that key and hostname to that destination server admin... they will add it in authorized key list and it will be done.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting looping issue

#!bin/ksh --------------------------------------------------------------------------------------------- -- Get sequence number from database --------------------------------------------------------------------------------------------- .os rm... (3 Replies)
Discussion started by: swathi reddy1
3 Replies

2. Shell Programming and Scripting

Shell Scripting - CHMOD issue

Hi Friends , good morning . I am very new to Unix scripting and require a bit of advice to help resolve the below issue . Hope some one can provide some suggestion I have the below script which calls a Oracle stored procedure which inturn extracts data from a table and writes in a ascii... (4 Replies)
Discussion started by: J1nx007
4 Replies

3. Shell Programming and Scripting

Shell scripting issue-running the background script

I have written the below query to genrate a telephone.I am passing account number from oracle database. I am calling 2 scripts which generate the bill 1. bip.sh (it runs in the background) 2.runXitInvoice_PROFORMA_integ bip.sh generates a number which runXitInvoice_PROFORMA_integ uses.How... (7 Replies)
Discussion started by: rafa_fed2
7 Replies

4. UNIX for Dummies Questions & Answers

Shell Scripting Issue

Hi I have a requirement where in I need to check 103,104,105 letters in each line and if it equal to MAS then I need to copy the whole line (Till End) to a file. In case if there are 10 lines, all these lines must be copied to a file. Can you please help me with script. (1 Reply)
Discussion started by: krishna87
1 Replies

5. Shell Programming and Scripting

Shell Scripting Issue

Hi I have a requirement where in I need to check 103,104,105 letters in each line and if it equal to MAS then I need to copy the whole line (Till End) to a file. In case if there are 10 lines, all these lines must be copied to a file. Can you please help me with script. (1 Reply)
Discussion started by: krishna87
1 Replies

6. Shell Programming and Scripting

Sql issue in shell scripting

HI friends , i am also facing an issue in mysql i ma trying to insert detail in a variable but not got success #!/bin/sh mysql -u<username> -p<password> <dbname> << EOF DEV=`mysql --skip-column-names <dbname> -e "SELECT timestamp from process_record where id = 1"` EOF echo $DEV ERROR... (3 Replies)
Discussion started by: sanjay833i
3 Replies

7. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

8. Shell Programming and Scripting

Sftp scripting

Dear All, I have script that get the files from sFtp server to Unix server. The script is below. -- Batch File (mybatch) cd Output get abc123.csv in/abc123.csv get def456.csv in/def456.csv get ghi789.csv in/ghi789.csv bye -- Script File sftp -b mybatch xyz@111.222.33.4 >... (1 Reply)
Discussion started by: samrio
1 Replies

9. Shell Programming and Scripting

Issue with Shell Scripting..

Hi Guys.. I need a solution for these two questions... Plz help me... 1)How can you load multiple files in a script ? 2)How do you get a process Id for multiple files in a shell script ? (3 Replies)
Discussion started by: mraghunandanan
3 Replies

10. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies
Login or Register to Ask a Question