I'm trying to setup a remote-only user account on my MacBook Pro that is chrooted to
/chroot/tmux. I've followed the steps outlined here (http://thefragens.com/blog/2011/12/chrootd-sftp-on-mac-os-x-server/), but when I try to login in with (on my local network):
... I get an immediate connection closed:
❯ ssh email@example.com Password: Connection to 10.0.1.140 closed by remote host. Connection to 10.0.1.140 closed.
Removing this line in
/etc/sshd_config allows me to login fine, but my
tmux user is no longer chrooted:
Match User tmux # ... ChrootDirectory /chroot/tmux # removing this allows me to login
What do I have to do to get this to work?
This is what I get after the password prompt when I try to login from the client with
ssh -vv firstname.lastname@example.org:
debug2: input_userauth_info_req debug2: input_userauth_info_req: num_prompts 0 debug1: Authentication succeeded (keyboard-interactive). Authenticated to 10.0.1.140 ([10.0.1.140]:22). debug1: channel 0: new [client-session] debug2: channel 0: send open debug1: Requesting email@example.com debug1: Entering interactive session. debug1: channel 0: free: client-session, nchannels 1 Connection to 10.0.1.140 closed by remote host. Connection to 10.0.1.140 closed. Transferred: sent 1872, received 1880 bytes, in 0.0 seconds Bytes per second: sent 100689.1, received 101119.4 debug1: Exit status -1
Encouragingly, Mac's Console reports this:
6/15/12 9:57:42.679 AM sshd: fatal: bad ownership or modes for chroot directory "/chroot/tmux"
My current directory permissions:
~ ❯ ls -al /chroot/tmux total 8 drwxr-xr-x 7 tmux wheel 238 Jun 14 11:18 . drwxr-xr-x 3 root wheel 102 Jun 14 10:34 ..