I setup the new chroot jail for sftp in openssh 5.0p1. I was
wondering how I can have a command executed automatically after login
with sftp. If it were ssh, I simply could add a command to /etc/
profile, /etc/bashrc, ~/.bashrc, etc. But sftp doesn't read those

My setup is:

Subsystem sftp internal-sftp
Match Group ftpuser
ChrootDirectory /opt/ftproot/%u
ForceCommand internal-sftp

So when I use logins, the user cannot write to its $HOME since that is
chown root:root due to the requirements of chrootdirectory. So I
created a directory called 'pub' in each $HOME that is writable by
that user. So instead of users having to 'cd pub' manually after each
login, I want them to be dumped automatically into pub after login.

I've tried adding 'cd pub' to /etc/ssh/sshrc and /opt/ftproot/%u/.ssh/
rc but they don't seem to be read by sftp.