Я хочу заключить в тюрьму группу пользователей с доступом только к a /var/www/mysitename.com
шаблон каталога через sftp
один. Я не хочу обеспечивать доступ оболочки также.
Можно попробовать что-то как:
Match Group group-name
ForceCommand internal-sftp
ChrootDirectory /var/www/mysitename.com
в /etc/ssh/sshd_config
.
Из страницы справочника:
ChrootDirectory
Specifies the pathname of a directory to chroot(2) to after
authentication. All components of the pathname must be root-
owned directories that are not writable by any other user or
group. After the chroot, sshd(8) changes the working directory
to the user's home directory. [...]
ForceCommand
Forces the execution of the command specified by ForceCommand,
ignoring any command supplied by the client and ~/.ssh/rc if
present. [...] Specifying a command of “internal-sftp” will
force the use of an in-process sftp server that requires no
support files when used with ChrootDirectory.
Эти условия требуют что:
/var/www/mysitename.com
должен принадлежать корню, и не перезаписываемый другими или корнем. /
(корень), или эти chroot
перестанет работать. Поочередно, можно установить ChrootDirectory
на /var/www
и установить корневые каталоги всех этих пользователей к /mysitename.com
.
Соответствующее чтение: