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

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

So I incorporated the above in the existing script as follows:

 
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 :frowning: How to resolve it?

-dips

Please post the error as well, thanks.

Well....actually it just throws the usage for the sftp command

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

Have the options first and host at the end

sftp -b batchfile -oPort=22 -oServerAliveInterval=60 -oServerAliveCountMax=5 -oTCPKeepAlive=yes 192.168.1.2

--ahamed

1 Like

Hi ahamed,

I tried the way you suggested

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. :frowning:

-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