NB! The recipe below does not work. Please see other posts for newer suggestions. For activated users, you can replace /bin/bash with /bin/false in copssh inst. dir/etc/passwd.
I had problem using the code as it is, sshd didn't give any error but just terminated the connection but when I changed to following it worked, probably $@ was blank which is interpreted as eof by ssh client.#!/bin/bash if ; then echo "SFTP only!" exit 1 fi exec /libexec/sftp-server
I had problem using the code as it is, sshd didn't give any error but just terminated the connection but when I changed to following it worked, probably $@ was blank which is interpreted as eof by ssh client. #!/bin/bash
if ; then
echo "SFTP only!"
exit 1
fi
exec /libexec/sftp-server
AFAIK, there is no /libexec directory on a standard copssh installation.
NB! The recipe below does not work. Please see other posts for newer suggestions.
For activated users, you can replace /bin/bash with /bin/false in copssh inst. dir/etc/passwd.
That will block shell access via ssh.
That didn't work I think. Could you integrate scponly?
altenativly http://www.pizzashack.org/rssh/index.shtml
Thanks for your feedback. You're right! /bin/false was simply a false answer.
I have tested the procedure below and verified that it works:
NB! Shell command (!) within sftp will not work as of copssh v1.3.6. You can simply override this behaviour by creating a /bin/sh link to /bin/bash.
I had problem using the code as it is, sshd didn't give any error but just terminated the connection but when I changed to following it worked, probably $@ was blank which is interpreted as eof by ssh client.#!/bin/bash
if ; then
echo "SFTP only!"
exit 1
fi
exec /libexec/sftp-server
I had problem using the code as it is, sshd didn't give any error but just terminated the connection but when I changed to following it worked, probably $@ was blank which is interpreted as eof by ssh client.
#!/bin/bash
if ; then
echo "SFTP only!"
exit 1
fi
exec /libexec/sftp-server
AFAIK, there is no /libexec directory on a standard copssh installation.