יצירת CHROOT מבלי לירות בעצמי
Sorry for the English.
Tapuz's simply horrible with it's auto-indentations...
I want to create a "jailed" directory for a certain user to be able to browse some log files securely.
Let's say the directory is as follows:
/root/gloader/logs
And the user requiring the access is:
loguser
To my understanding:
-All parent directories must be owned by root
-/root/gloader/logs must be owned by the user
- Change the user's home directory using: usermod -d /root/gloader/logs loguser
- /etc/sshd/sshd_config should be edited and added the following lines:
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
Match User loguser
ChrootDirectory /root/gloader/logs
ForceCommand internal-sftp
I've done all of the above but when trying to access from outside using winscp I always get "access denied"
or
fatal: bad ownership or modes for chroot directory component "/root/gloader/logs"
What am I missing?
Thanks!
Sorry for the English.
Tapuz's simply horrible with it's auto-indentations...
I want to create a "jailed" directory for a certain user to be able to browse some log files securely.
Let's say the directory is as follows:
/root/gloader/logs
And the user requiring the access is:
loguser
To my understanding:
-All parent directories must be owned by root
-/root/gloader/logs must be owned by the user
- Change the user's home directory using: usermod -d /root/gloader/logs loguser
- /etc/sshd/sshd_config should be edited and added the following lines:
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
Match User loguser
ChrootDirectory /root/gloader/logs
ForceCommand internal-sftp
I've done all of the above but when trying to access from outside using winscp I always get "access denied"
or
fatal: bad ownership or modes for chroot directory component "/root/gloader/logs"
What am I missing?
Thanks!