internal-sftp for chroot: How do automatically run command at login?
- From: jtidmore@xxxxxxxxx
- Date: Wed, 21 May 2008 17:18:59 -0700 (PDT)
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
files.
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.
.
- Prev by Date: Re: from= option of authorized keys
- Next by Date: Re: from= option of authorized keys
- Previous by thread: plink 0.60 ignoring command options for hostname and username.
- Next by thread: sshd_config settings
- Index(es):
Relevant Pages
|
|