I have added a user ftp_user with the /etc/passwd line:
ftp_user:x:1002:1003:ftp user,0,0,0,0:/home/ftp_user/files:/usr/sbin/nologin
In order to limit that user to only being able to r/w/list that one directory and not any others.
When I try to sftp in as that user I get:
Received message too long 1416128883
sftp worked fine when I had the shell be /bin/sh in the passwd file
UPDATE
I am using the sftp subsystem with this in sshd_config:
Match group sftp
ChrootDirectory /home/ftp_user/files
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
Match User ftp_user
PasswordAuthentication yes
Now, when I try to sftp in, I get:
debug3: send packet: type 61
debug3: receive packet: type 60
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 0
debug3: send packet: type 61
debug3: receive packet: type 52
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to x.x.x.x ([x.x.x.x]:22).
debug2: fd 5 setting O_NONBLOCK
debug3: fd 6 is O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: send packet: type 1
packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
Connection closed