SFTP Logging using Chroot users in CentOS 7.9

Issues related to applications and software problems
Post Reply
jesus.vm1
Posts: 2
Joined: 2021/11/13 00:13:52

SFTP Logging using Chroot users in CentOS 7.9

Post by jesus.vm1 » 2021/11/13 00:19:04

Someone have the correct configuration to enable the logging using chroot users, I was looking in internet and forums but I cant enable the SFTP logging, If I dont use the Chroot I can enable the SFTP logging, I was looking arround 2 weeks but is impossible

Program: OpenSSH server


Please help

BShT
Posts: 583
Joined: 2019/10/09 12:31:40

Re: SFTP Logging using Chroot users in CentOS 7.9

Post by BShT » 2021/11/17 13:42:06

there was a question about /etc/shells, nologin and ftp users

i don´t know if it has something to do with sftp...

el_lascar@bluewin.ch
Posts: 3
Joined: 2021/11/22 14:20:57

Re: SFTP Logging using Chroot users in CentOS 7.9

Post by el_lascar@bluewin.ch » 2021/11/23 13:33:06

Hello,

below my script to enable a new sftp user:

Code: Select all

adduser my_user
passwd my_user 
chown root:my_user  /home/my_user 
chmod 750 /home/my_user 
mkdir /home/my_user/upload
chown my_user:my_user /home/my_user/upload
ls -ld /home/my_user/upload
vi /etc/ssh/sshd_config

Code: Select all


==>
Match User my_user
        ChrootDirectory /home/my_user
        ForceCommand internal-sftp
        AllowTcpForwarding no
        X11Forwarding no
service sshd restart

I don't know if this is the information you need but with this configuration, all user actions will be logged in /var/log/secure

Post Reply