Results 1 to 3 of 3

Thread: multiple allowed ForceCommand arguments in sshd

  1. #1
    Join Date
    Jan 2006
    Beans
    35

    multiple allowed ForceCommand arguments in sshd

    I would like to restrict my users to two uses of ssh: running a particular script, say /usr/local/bin/myscript.sh and regular sftp. Using ForceCommand in /etc/sshd_config seems to restrict me to only one: I can either of:

    ForceCommand /usr/local/bin/myscript.sh
    ForceCommand internal-sftp

    either works great, but I would like to enable them both. If both lines are included, it parses the first and ignores the second. Is there any way allow both commands?

    Also, I'm on a production server with LTS, so am limited to openssh 4.7. If this problem is only solvable in a newer version of openssh, which version would I need?

    Thanks, all.

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: multiple allowed ForceCommand arguments in sshd

    Just a wild guess, would something like this work?

    Code:
    ForceCommand /bin/sh -c '/usr/local/bin/myscript.sh; /usr/libexec/openssh/sftp-server'

  3. #3
    Join Date
    Jan 2006
    Beans
    35

    Re: multiple allowed ForceCommand arguments in sshd

    Unfortunately not. The best bet seems to be using samba for the scp needs, and use the single forcecommand. Alas.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •