Я устанавливаю новый экземпляр proftp на новом и обновленном Debian Jessie 8.7, следуя https://www.howtoforge.com/tutorial/proftpd-installation-on-debian-and-ubuntu/ но новый пользователь снова отключается (любой пользователь - даже root e = если разрешено) после успешного входа в систему:
03:20:55 ~$ ftp otrupload@ftpserver:21
Connected to ftpserver.
220 ProFTPD 1.3.5 Server (Debian) [192.168.1.101]
331 Password required for otrupload
Password:
230 User otrupload logged in
Remote system type is UNIX.
Using binary mode to transfer files.
200 Type set to I
local: 21 remote: 21
229 Entering Extended Passive Mode (|||49865|)
550 21: No such file or directory
221 Goodbye.
03:22:14 ~$
Моя конфигурация выглядит следующим образом (я обрезал ее, чтобы увидеть, что происходит):
# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6 off
# If set on you can experience a longer connection delay in many cases.
IdentLookups off
ServerName "Debian"
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks on
TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200
DisplayLogin welcome.msg
DisplayChdir .message true
ListOptions "-l"
DenyFilter \*.*/
# Port 21 is the standard FTP port.
Port 21
MaxInstances 30
# Set the user and group that the server normally runs at.
User proftpd
Group nogroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on
TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
<Global>
RootLogin off
RequireValidShell off
</Global>
DefaultRoot /ftpshare/
<Limit LOGIN>
DenyGroup !ftpgroup
</Limit>
Домашний каталог otrupload
является \ftpshare
# echo ~otrupload
/ftpshare
и имеет следующие разрешения:
drwxrwxrwt 2 otrupload otrupload 4096 Jan 30 06:04 ftpshare
Есть предложения, что происходит? Он работал с моей последней установкой, и я следовал точно таким же указаниям?
ОК - решил проблему. Причиной были разрешения .
и ..
которые по неизвестным причинам были закрыты для доступа никому.
Я установил их на
drwxr-xr-x 22 root root 4096 Jan 30 09:46 .
drwxr-xr-x 22 root root 4096 Jan 30 09:46 ..
и теперь он работает.
Попробуйте добавить эту строку в свою конфигурацию:
Это приведет к перенаправлению и заключению пользователя в тюрьму в его каталоге
DefaultRoot ~
Для общего решения вы можете использовать
DefaultRoot ~
Это приведет к перемещению всех пользователей в их домашний каталог.