Добрый день.Пытаюсь настроить sftp с пользователями в chroot. Создал пользователя и группу /etc/passwd
sftp_user_1:x:1000:1001::/home/sftp_user_1:/sbin/nologin
sftp:x:1001:sftp_user_1
Конфиг sshd /etc/ssh/sshd_config
#Subsystem sftp /usr/lib/ssh/sftp-server
Subsystem sftp internal-sftp
Match Group sftp
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /home/%u
ForceCommand internal-sftp
С правами на папку пробовал несколько вариантов. Сейчас вот так:
ls -lha /home/
total 4.0K
drwxr-xr-x 3 root root 24 Jul 13 10:18 .
drwxr-xr-x 23 root root 4.0K Jul 13 09:57 ..
drwxr-x--- 6 sftp_user_1 sftp 133 Jul 13 10:18 sftp_user_1
При попытки подключиться аутентификация проходит успешно, но сразу обрывает соединение
sftp -v sftp_user_1@ip
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to 192.168.181.188 ([192.168.181.188]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
packet_write_wait: Connection to 192.168.181.188 port 22: Broken pipe
Connection closed
Включил LogLevel VERBOSE в sshd_config в логе вроде все хорошо
type=USER_AUTH msg=audit(1531470338.715:1166): pid=16896 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=pam_unix acct="sftp_user_1" exe="/usr/sbin/sshd" hostname=192.168.181.187 addr=192.168.181.187 terminal=ssh res=success'
type=USER_ACCT msg=audit(1531470338.715:1167): pid=16896 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_unix acct="sftp_user_1" exe="/usr/sbin/sshd" hostname=192.168.181.187 addr=192.168.181.187 terminal=ssh res=success'
type=CRED_ACQ msg=audit(1531470338.719:1168): pid=16894 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="sftp_user_1" exe="/usr/sbin/sshd" hostname=192.168.181.187 addr=192.168.181.187 terminal=ssh res=success'
type=LOGIN msg=audit(1531470338.719:1169): pid=16894 uid=0 old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=99 res=1
type=USER_ACCT msg=audit(1531470338.743:1170): pid=16914 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_unix acct="sftp_user_1" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=USER_START msg=audit(1531470338.743:1171): pid=16914 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:session_open grantors=pam_selinux,pam_selinux,pam_systemd,pam_limits,pam_unix,pam_umask,pam_env acct="sftp_user_1" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=USER_START msg=audit(1531470338.783:1172): pid=16894 uid=0 auid=1000 ses=99 msg='op=PAM:session_open grantors=pam_loginuid,pam_systemd,pam_limits,pam_unix,pam_umask,pam_env,pam_lastlog acct="sftp_user_1" exe="/usr/sbin/sshd" hostname=192.168.181.187 addr=192.168.181.187 terminal=ssh res=success'
type=CRED_ACQ msg=audit(1531470338.783:1173): pid=16920 uid=0 auid=1000 ses=99 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="sftp_user_1" exe="/usr/sbin/sshd" hostname=192.168.181.187 addr=192.168.181.187 terminal=ssh res=success'
type=USER_END msg=audit(1531470338.787:1174): pid=16894 uid=0 auid=1000 ses=99 msg='op=PAM:session_close grantors=pam_loginuid,pam_systemd,pam_limits,pam_unix,pam_umask,pam_env,pam_lastlog acct="sftp_user_1" exe="/usr/sbin/sshd" hostname=192.168.181.187 addr=192.168.181.187 terminal=ssh res=success'
type=CRED_DISP msg=audit(1531470338.787:1175): pid=16894 uid=0 auid=1000 ses=99 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="sftp_user_1" exe="/usr/sbin/sshd" hostname=192.168.181.187 addr=192.168.181.187 terminal=ssh res=success'