openssh5.1 ForceCommand = sftp problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hello everyone:
I have big problem with ForceCommand in openssh5.1

I want to configure login account to have shell access with
ForceCommand option enabled and also sftp access without Chroot

I configured ssh with following lines:

Subsystem       sftp    internal-sftp
##because there is no Match User section everyone have sftp access
Match User test  ## test user ;)
ForceCommand /home/forcetest

And wrote /home/forcetest:

  if [[ $SSH_TTY ]]; then
        if [[ ! $SSH_ORIGINAL_COMMAND ]] ; then
                  /home/$/.profileactive ;
                  echo "$DATE $LOGNAME - $SSH_CONNECTION - proba
naduzycia" >> /var/log/shell

         echo "$DATE $LOGNAME - $SSH_CONNECTION sftp - proba
naduzycia" >> /var/log/shell

When I disable ForceCommand option everything works. But when I
enable, users from Match User list for ForceCommand cannot get via

Is there any option for detect type of ssh service: shell or
sftp ?????
Or have somebody any idea for this problem...

In my opinion ForceCommand crosses out sftp access.

Thanks for help


Site Timeline