1822147 Members
4134 Online
109640 Solutions
New Discussion юеВ

SFTP Logging

 
SOLVED
Go to solution
Nick Tarmey_3
Occasional Advisor

SFTP Logging

Hi folks,

does anyone know if HP-UX Secure Shell can log sftp file transfers? I want to write a script to check if a scheduled transfer was succesful or not. Currently this file transfer is handled by an application but its reporting is a bit flakey hence the need for the script.

Thanks in advance,
Nick
7 REPLIES 7
Michael Tully
Honored Contributor

Re: SFTP Logging

Well it does, but the version I have only logs the acceptance of the connection into syslog at the destination. It does not have the extra logging you after.

subsystem reuqest for sftp
Accepted password for xxxxx from xx.xxx.xxx.xxx


Anyone for a Mutiny ?
Muthukumar_5
Honored Contributor

Re: SFTP Logging

We can not get the transfer information of files as like ftp using sftp. ftp will log informations in xferlog. But sftp is logging in syslog with a small details as,

Jul 15 00:33:32 test sshd[15706]: Accepted password for root from x.x.x.x port 54282 ssh2
Jul 15 00:33:32 test sshd[15706]: subsystem request for sftp

We can run the sftp as a batch mode.
Start the sftp and log informations with tee or script command. It will be useful to log all informations.

We can use that to debug and to analyse the successful transfer.

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
Nick Tarmey_3
Occasional Advisor

Re: SFTP Logging

Hi Michael, the version I'm using is 3.50 there is a later version available, are you saying this has a better logging facility? I'm seeing what you are at the moment also, but I was hoping for a separate logfile like the ftp xferlog with more detail.
Michael Tully
Honored Contributor

Re: SFTP Logging

Hi Nick, The version I have is older unfortunately. Perhaps we are looking in the wrong place. Suggest have a look at the release notes for the lates version and see if there is something there. That's about all I can help with right now. Not sure if there is a better logging facility, but here's hoping. (I was too!.)
From here:
http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/openssh-3.7.1p2/
or
http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA

Regards
Michael
Anyone for a Mutiny ?
Bill Hassell
Honored Contributor

Re: SFTP Logging

To be sure that the transfer took place, you'll probably have to use the dir command and look at the size of the remote file(s).


Bill Hassell, sysadmin
Muthukumar_5
Honored Contributor

Re: SFTP Logging

hai,

We can use resursive scp instead of sftp for file transfers. It is effective to analyse the tranfer success. It will state the problem and return type on the shell.

IF $? is 0 then it is successful;
else it is in problem and details will come to STDERR mode. Redirect it to a log file. Use the date command before and after to know the tranfer time or cause of error occured time.

See scp man page to know more. It will be heplful to you more.
Easy to suggest when don't know about the problem!
Tim Maletic
Valued Contributor
Solution

Re: SFTP Logging

See

http://sftplogging.sourceforge.net/

and

http://www.derkeiler.com/Mailing-Lists/securityfocus/Secure_Shell/2003-03/0014.html

As the 2nd link mentions, let the openssh team know you need sftp logging by writing to them at openssh@openssh.com. Also, use your standard support channels in HP to request that HP-UX Secure Shell add logging of sftp transactions, since HP might be more effective at getting the attention of the openssh team (and HP will need to be prepared to backport the patch if it ever becomes available).