How can I disable some commands in SFTP
for my clients, like ln
& symlink
?
I've checked man sftp, but didn't find what I'm searching for.
How can I disable some commands in SFTP
for my clients, like ln
& symlink
?
I've checked man sftp, but didn't find what I'm searching for.
You did not specify, what SFTP server are you using. I'm assuming the OpenSSH.
The sftp-server
(and the compatible internal-sftp
) has the -P
and -p
switches to black/white list certain SFTP requests.
You can use them to disallow the symlink
requests:
Subsystem sftp internal-sftp -P symlink
ForceCommand
though (but that would disallow shell access, what you actually want to do anyway probably, if you want to limit what user can do).
Aug 24, 2017 at 12:49
You can only pass args to the sftp command when using ForceCommand
, not Subsystem
. If you do what the other answer says, the -P
arg will be silently ignored!
The correct way:
Subsystem sftp internal-sftp
ForceCommand internal-sftp -P symlink
(you possibly also want to put a Match
block around the second line)