SFTP connection using shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP connection using shell script
# 1  
Old 05-17-2010
Java SFTP connection using shell script

Hi ,
I am able to manually connect to remote system usning "sftp" protocol. But when I using the below command in the script but I am not able to connect.

`sftp TEST01@120.34.3.4`

And the connection should not be closed after login. Please help to solve this.

Thanks
Satya
# 2  
Old 05-17-2010
can you include the other part of the script? If you are using a file or here document as input or is it supposed to be passwordless sftp or you have to input it manually when your script prompts for it.
# 3  
Old 05-17-2010
for non-interactive mode try
Code:
lftp -u user_name,password sftp://120.34.3.4/your/path/location/<< EOF
ls
bye
EOF

But this is bad idea.. cause password is shown in script
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

New sftp connection

Dear All , I have a openssh 4.3p2 , but i need to configure sftp for a user which is present in the server. This user has to see only the specific directory not all. I tried to do the changes in sshd_config for openssh 4.9p1 , but for openssh 4.3p2 how to do it. Any one pl help. ... (1 Reply)
Discussion started by: jegaraman
1 Replies

2. Shell Programming and Scripting

Help! Shell Script for Wifi Connection

Hi, I am quite new to shell scripting and was wondering if it was possible to automatically enter the username and password fields to a wifi-access-router and then ping it. I have most trouble with entering the username and password fields. Is that even possible? Also, what do I do if the... (1 Reply)
Discussion started by: Xyn
1 Replies

3. Shell Programming and Scripting

Connection with Teradata through shell Script

Hi All, As we are using SQLPLUS command to connect Oracle Database in unix: Like below syntax: sqlplus username/password@dbname << EOI SET HEADING OFF SPOOL MAX_DATE_VAL.txt select max(LAST_UPDT_DATE) from source_defect; SPOOL OFF here the result is stored in... (0 Replies)
Discussion started by: Shilpi Gupta
0 Replies

4. UNIX for Dummies Questions & Answers

For SFTP connection - How to give password in UNIX Script (ksh)

Hi, I am not able to give the password in Unix script for SFTP connection. When I am trying to manully SFTP command for accessing the server , it asking for pwd and I could provide the pwd but I am not getting how to provide the pwd inside the Unix script. sftp -v user@xyz.com. ... (4 Replies)
Discussion started by: Vineeta Nigam
4 Replies

5. 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

6. Shell Programming and Scripting

testing postgres connection in shell script

I have a script that does db query in postgres. I'm trying to put in some error checking in the script. I keep running into the password prompt problem where when invalid credentials/or database is put it, it would prompt me for a password which hangs the script. Is there a way that I can check for... (0 Replies)
Discussion started by: zerofire123
0 Replies

7. Shell Programming and Scripting

oracle connection from shell script

Hi, For connecting to oracle my script is using the command sqlplus username/password@db_instance_name.For this to work i am setting ORACLE_HOME,TNS_ADMIN and ORACLE_SID in a seperate script.My question is,could we make a connection to oracle just by the command sqlplus... (4 Replies)
Discussion started by: DILEEP410
4 Replies

8. UNIX for Dummies Questions & Answers

sybase connection through shell-script

:mad: how do i connect to sybase through shell script written in linux (9 Replies)
Discussion started by: Amitabh
9 Replies

9. Shell Programming and Scripting

Connection to database through shell script

Hi when i am calling the shell script with two parameter like id and date it works fine.But the same shell script is call by java application it gives the error as shown below Thu Jan 8 04:13:22 EST 2009|The Get Segment Process Failed: SP2-0306: Invalid option. Usage: CONN where <logon>... (1 Reply)
Discussion started by: ravi214u
1 Replies

10. Shell Programming and Scripting

how to check DB connection in unix shell script

In the following script I need to find whether DB is established successfully or not. I need to find and display it. If <DB is connected successfully> then echo "DB connection success" else echo "DB connection failure" fi In the same way I need to do it for DB terminate. I don't... (1 Reply)
Discussion started by: kmanivan82
1 Replies
Login or Register to Ask a Question