LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-03-2018, 07:41 AM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 117
Blog Entries: 1

Rep: Reputation: Disabled
How to log internal-sftp chroot jailed users access log to /var/log/sftp.log file


Hi All,

I am getting /dev/log directory auto generated on user sftp home directory .

Operating system version : Redhat 7.1

I have followed below mentioned Redhat Article

https://access.redhat.com/articles/1374633


I have configured /etc/ssh/sshd_config as below


Subsystem sftp internal-sftp -f LOCAL6 -l INFO

Match Group sftponly
ChrootDirectory /chroots/welcome
AllowTcpForwarding no
ForceCommand internal-sftp -f LOCAL6 -l INFO
X11Forwarding no


added the following line in /etc/rsyslog.conf to ensure
that the sftp entries will be seperated out to sftp.log:


input(type="imuxsock" Socket="/home/welcome/dev/log" CreatePath="on")
local3.* /var/log/sftp.log




sFTP user home directory I could see /dev/log getting created after rsyslog service restart.


[root@porsche sftp]# ls -al
total 19
drwxr-xr-x. 7 root root 1024 Sep 3 18:15 .
drwxr-xr-x. 9 root root 1024 Sep 3 09:37 ..
-rw-r--r--. 1 sftp sftp 18 Aug 3 2017 .bash_logout
-rw-r--r--. 1 sftp sftp 193 Aug 3 2017 .bash_profile
-rw-r--r--. 1 sftp sftp 231 Aug 3 2017 .bashrc
drwxrwxrwx. 3 sftp sftp 1 Sep 2 23:30 test
drwxr-x---. 2 sftp sftp 1024 Sep 3 09:37 test_1
drwx--x--x. 2 root root 1024 Sep 3 18:18 dev
drwxr-xr-x. 3 root root 1024 Sep 3 09:37 welcome
drwxr-xr-x. 3 root root 1024 Sep 3 09:37 welcome_1
[root@porsche sftp]# cd dev/
[root@porsche dev]# ll
total 1
srw-rw-rw-. 1 root root 0 Sep 3 18:18 log

[root@porsche dev]# cd log
-bash: cd: log: Not a directory
[root@porsche dev]# ll
total 1
srw-rw-rw-. 1 root root 0 Sep 3 18:18 log

Last edited by LittleMaster; 09-03-2018 at 08:32 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to fix "Please have a look at the log file for details: /var/log/jockey.log" harisuciha Linux - Hardware 3 04-29-2012 12:59 PM
kernel log format in /var/log/kern.log sinu_nayak2001 Linux - Newbie 2 10-07-2009 08:34 AM
In Apache server, How to change log file location and log format for access log fil? since1993 Linux - Server 1 08-19-2009 04:14 PM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
Strange results in /var/log/apache/access.log subt13 Linux - Security 2 08-03-2004 01:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration