passwordless sftp with debug options


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting passwordless sftp with debug options
# 1  
Old 10-28-2011
passwordless sftp with debug options

Hi,

In our project we already have a passwordless sftp with -b (batchfile) option working but there have been some new application rolled out at the client site and they want us to raise the DEBUG option somebody suggested to use following options with sftp command

Code:
 
-oLogLevel=DEBUG -oServerAliveInterval=60 -oServerAliveCountMax=5 -oTCPKeepAlive=yes

So I incorporated the above in the existing script as follows:
Code:
 
sftp -b BATCH_FILE_NAME USER@IP_ADDRESS -oLogLevel=DEBUG -oServerAliveInterval=60 -oServerAliveCountMax=5 -oTCPKeepAlive=yes

But now this command is giving error!! OR may be I don't know how to use the options Smilie How to resolve it?

-dips
# 2  
Old 10-28-2011
Please post the error as well, thanks.
# 3  
Old 10-28-2011
Quote:
Originally Posted by dude2cool
Please post the error as well, thanks.
Well....actually it just throws the usage for the sftp command

Code:
usage: sftp [-1Cv] [-B buffer_size] [-b batchfile] [-F ssh_config]
            [-o ssh_option] [-P sftp_server_path] [-R num_requests]
            [-S program] [-s subsystem | sftp_server] host
       sftp [[user@]host[:file [file]]]
       sftp [[user@]host[:dir[/]]]
       sftp -b batchfile [user@]host

That's why I suspect I might be using it in a wrong manner!!

-dips
# 4  
Old 10-28-2011
Have the options first and host at the end
Code:
sftp -b batchfile -oPort=22 -oServerAliveInterval=60 -oServerAliveCountMax=5 -oTCPKeepAlive=yes 192.168.1.2

--ahamed
This User Gave Thanks to ahamed101 For This Post:
# 5  
Old 10-31-2011
Hi ahamed,
Quote:
Originally Posted by ahamed101
Have the options first and host at the end
Code:
sftp -b batchfile -oPort=22 -oServerAliveInterval=60 -oServerAliveCountMax=5 -oTCPKeepAlive=yes 192.168.1.2

--ahamed
I tried the way you suggested
Code:
sftp -b BATCH_FILE_NAME -oLogLevel=DEBUG -oServerAliveInterval=60 -oServerAliveCountMax=5 -oTCPKeepAlive=yes USER@IP_ADDRESS

NOTE: I will have to use USER@IP_ADDRESS construct because only using IP_ADDRESS as you have showed in your example will not work as the key-pair generated for passwordless sftp has been created for only a particular USER which has to be specified while using the "sftp -b BATCH_FILE" command.

And it still gives the same error i.e. throws the usage of the sftp command. Smilie

-dips


Sorry I was using the wrong command I forgot to use -o (ssh-option) with ServerAliveInterval=60 ServerAliveCountMax=5 TCPKeepAlive=yes. It is working !! thanks

Last edited by dips_ag; 10-31-2011 at 02:31 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to use passwordless sftp in script?

Hi I am trying to do SFTP in shell script in such a way that it should not ask for password. for this is use below script but it prompt for password. here I am not abled to understand where I am making mistake. #!/bin/bash # SFTP TO remote server USER="ITO" PASSWORD="abcd@1234"... (4 Replies)
Discussion started by: scriptor
4 Replies

2. Windows & DOS: Issues & Discussions

Passwordless sftp connection from UNIX to windows server

HI , I am trying to make a passwordless sftp connection from a unix server to windows server I have used a existing script which is like this cd /home150/adm/.ssh/ ssh-agent /usr/bin/ksh <<EOF ssh-add IDBNEWKEY ssh-add -l sftp IDBUSER@abc.com cd /home/IDBUSER/Share/IDB/ rm ${FILE}... (0 Replies)
Discussion started by: Jcpratap
0 Replies

3. Solaris

Passwordless sftp issue

Hello Experts, I am trying to setup passwordless sftp from one of linux box to solaris box. I have generated key-pair and below is the permissions of the respective files. drwx------. 2 sftpuser sftpuser 4096 Dec 17 23:57 .ssh drwx------. 2 sftpuser sftpuser 4096 Dec 17 23:57 .... (16 Replies)
Discussion started by: sai_2507
16 Replies

4. Shell Programming and Scripting

Passwordless file transfer using sftp

Hello all, I have a requirement, in which we need to stage a package to Unix remote server in an automation (we cant use ssh key generation) , do u have any idea how we can transfer the package to remote server using sftp .if you have any script plz share it to me (4 Replies)
Discussion started by: Ramji Sundaram
4 Replies

5. Shell Programming and Scripting

Passwordless SFTP - SCP Option?

I have read documentation on SCP and just trying to figure out how go about doing this - below are two pieces of code, one is SFTP and one is SCP. My goal is to have this done via password-less authentication, fully automated. Currently we use SFTP and the script asks for the password of the... (20 Replies)
Discussion started by: Stigy
20 Replies

6. Cybersecurity

SFTP passwordless (kind of works)

Hi, I set up the keys on local and remote server. If I simply do: sftp xxx.xxx.xxx.xxx It works without asking for a password. But if I change the command to: sftp user@server it prompts me for password. Anybody know how to rectify this? Thanks a bunch. EDIT: I copied the key... (3 Replies)
Discussion started by: tetra
3 Replies

7. Shell Programming and Scripting

keypair generation for passwordless sftp

Hi, I want to establish a passwordless sftp between the two servers. I've searched the net and know the steps to be taken; which are as follows: $ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (~/.ssh/id_rsa): ~/.ssh/id_rsa already... (3 Replies)
Discussion started by: dips_ag
3 Replies

8. Shell Programming and Scripting

passwordless authentication of SFTP script

Dear All I need to discuss about the problem which has been discussed so many times here. I need to transfer a file from server A to server B via passwordless SFTP script. By reading the threads on this topic here, I followed the below steps but still it's not working .. Pls find the steps... (13 Replies)
Discussion started by: uday.shankar
13 Replies

9. Shell Programming and Scripting

Passwordless SFTP

Hi, When Iam trying to do SFTP it is asking for password everytime. Can I have any alternative where I can provide the password in script itself. Because there are some control-M jobs which runs without user interaction. So please let me know the script where we can provide the password in the... (2 Replies)
Discussion started by: manneni prakash
2 Replies

10. Shell Programming and Scripting

Passwordless sftp from UNIX to windows site

Hallo all , I researched many article in this forum as well as googled. But could not get any help. I request the forum to extend some help. Issue: Want to do a passwordless sftp from an unix machine to windows action taken : 1) on local unix machine ssh-keygen -t dsa 2) Next step ,... (2 Replies)
Discussion started by: konark
2 Replies
Login or Register to Ask a Question