brent saner via plug on 27 Mar 2025 15:10:09 -0700 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] Problems chrooting for sftp on RedHat |
I'm having a problem on a Red Hat cluster. We want the users to be able to only sftp in, and only to their own home directory. Pretty standard.So here's the setup. We have a folder structure /sftp-area/vendor/<user>. All users are a member of a group called "FileCollector". Here's what it looks like:<snipped out other directories>
[root@PHAFTP002 /]# ls -la
total 36
drwxrwxrwx. 5 root FileCollector 4096 Jul 26 2022 ftp-area
[root@PHAFTP002 ftp-area]# ls -la
total 28
drwxrwxrwx. 5 root FileCollector 4096 Jul 26 2022 .
dr-xr-xr-x. 21 root root 278 Mar 27 09:14 ..
drwx------. 2 root root 16384 Jul 25 2022 lost+found
drwxr-x--x. 6 root root 4096 Jul 25 2022 nfsinfo
drwxrwxr-x. 10 root FileCollector 4096 Mar 27 10:53 vendor
[root@PHAFTP002 ftp-area]#
[root@PHAFTP002 vendor]# ls -la
total 40
drwxrwxr-x. 10 root FileCollector 4096 Mar 27 10:53 .
drwxrwxrwx. 5 root FileCollector 4096 Jul 26 2022 ..
drwxrwxr-x. 4 lowespro FileCollector 4096 Mar 27 11:19 lowesproOK, so the user "lowespro" has a home directory of /ftp-area/vendor/lowespro.[root@PHAFTP002 vendor]# cat /etc/passwd
lowespro:x:1009:1001::/ftp-area/vendor/lowespro/home:/bin/bash
[root@PHAFTP002 vendor]#
And is a member of the right group:[root@PHAFTP002 vendor]# groups lowespro
lowespro : FileCollector
[root@PHAFTP002 vendor]#We're chrooting like this:# override default of no subsystems
# Subsystem sftp /usr/libexec/openssh/sftp-server
# Subsystem sftp internal-sftp -d /home
subsystem sftp internal-sftp
Match Group FileCollector
ChrootDirectory /ftp-area/vendor/%uSo why doesn't this work?(SNIP)
debug1: pledge: filesystem full
The log seems to indicate permissions, but I'm failing to see where:
Mar 27 14:32:44 PHAFTP002.pha.phila.gov sshd[114622]: fatal: bad ownership or modes for chroot directory component "/ftp-area/" [postauth]
Mar 27 14:50:28 PHAFTP002.pha.phila.gov sshd[137342]: fatal: bad ownership or modes for chroot directory component "/ftp-area/" [postauth]
I'm missing something simple here, but what??
___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug