0

There are only few commands available in sftp environment. Is it possible to make available any custom command in sftp.

For example any other executable (that is not available by default), or any shell script or alias.

sourav c.
  • 44,715

1 Answers1

2

You're treating SFTP and SSH as if they're the same.
That's your problem here; they aren't the same.

SFTP is very deliberately locked down for handling files and nothing else.

The only way I can imagine doing what you suggest is by replacing /usr/lib/openssh/sftp-server with something else that does support a remote command syntax. I don't know any drop-in replacements that will. You would also need a client that knew what to do... This is asking a lot.

I'd suggest using SSH (if you have access) when you need to fire commands off. It can also do some limited file moving but that's really not what it's for.

Oli
  • 293,335