2017-06-15 06:17 PM
Hello,
I'm trying to install this shell for sending log files from a Centos Host. I created an 'sftp' user with root privileges, a ''$HOME/.ssh" folder for the public and private keys, both keys with the command 'ssh-keygen -b 1024 -t rsa -f $HOME/.ssh/id_rsa', a "/usr/local/sa" folder for process files. So I configured the "sasftpagent.sh" this way:
DATA_DIRECTORY=/var/log
SA_DIRECTORY=/upload/killswitch/dsctest
PERSINFO_DIRECTORY=/usr/local/sa
IDENTITY=$HOME/.ssh/id_rsa
FILESPEC=*.unx
But when I execute the shell, I got this error:
[root@localhost sa]# ./sasftpagent.sh
*******************************************************
**** Time: 20170615120454
**** Data Directory(s): /var/log
**** SA Directory: /usr/local/sa
**** SA: 10.226.6.215
**** SA Directory: /upload/killswitch/dsctest
*******************************************************
Checking for old tracking files in /usr/local/sa/var/log
**** Scanning directory /var/log...
**** Processing test5.unx...
**** Reading new data from /var/log/test5.unx
**** Skipping file header.
**** Automatic tail syntax checking. You may see an error that can be ignored.
**** Use tail syntax 2.
**** Error detected during transfer:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Couldn't read packet: Connection reset by peer
**** Removing temporary data file test5.unx-sa.20170615120454-1.tmp
**** Transfer Errors processing /usr/local/sa/var/log/test5.unx-sa.20170615120454-1.tmp
**** Exiting Script
**** removing running files
**** Done processing directory /var/log
**** removing running files
**** Script Completed.
Already ran these commands (on Host):
chmod 700 $HOME/.ssh
chmod 700 $HOME/.ssh/id_rsa*
chmod 755 /usr/local/sa/sasftpagent.sh
Also check that my Log-collector server be on the "known_hosts" on my host (sftp ip_collector) and the public key of my host was registered on "cat /upload/.ssh/authorized_keys" file on Log-collector server.
So I can't figure it out what is wrong.
2017-06-15 09:51 PM
Hi Omar,
Please check directory permissions in Logcollector.
1. Ensure the destination directory owned by user and group "sftp". If not, then run below to set it:
chown -R sftp:sftp /var/netwitness/logcollector/upload/killswitch/dsctest
2. Ensure the destination directory has the correct permissions:
chmod -R 775 /var/netwitness/logcollector/upload/killswitch/dsctest