openssh and chroot.

Hi all. I have installed openssh 5.3 and set up jailed root.

It works almost as I want it to I cant cd to any directory above my ch root.

my config :
entry in passwd:

test2:x:103:113::/users2/test2:/bin/false

sshd_conf:

Match User test2
ChrootDirectory /users2/%u
#       X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

directories:
/users2 owner root:root 755
/users2/test2 owner root:root 755
/users/test2/ftpfiles owner test2:mygroup 755

When I do sftp test2@testhost I enter in /users2/test2 but there I cant write so I have to cd into ftpfiles
Is this the expected behavior? ? I expected to enter directly to a directory where I could write preferably, /users2/test2.

Should I use other options to ChrootDirectory?

Thanks in advance.

/Jan

your /user2/test2 directory should be owned by the user test2. it is currently owned by root with permission 755.

change your shell for test2 from /bin/false to a valid shell

Changing the shell did not resolve the problem Maybe I have to do otherthings to?

Changing owner of /users2/test2 to test2:mygroup 755
made things change but showed a strange behavior.

sftp from winxp using wincsp logs me in to /users2/test2 and I can write and not change to any other directory exactly as I wanted it to be.

BUT issuing sftp at command line from another solaris host
after entering the passwd I get a "connection to host closed by remote host"
I tried the ssh client that comes with solaris and /usr/local/bin/ssh but both fails.
What is the difference between winscp and the cmd line sftp in solaris?

you can use the -v option to increase verbosity of sftp/ssh connection. max of 3 v's for maximum verbosity. should show you what's the problem.

$ sftp -vvv user@host