Linux – sftp chmod recursive


I have logged into a server via sftp via terminal.

When I run the command

chmod -R 755 ./*

I get the error You must supply a numeric argument to the chmod command.. How do I apply a recursive chmod 755 while in sftp?

Best Answer

You may not be able to. There's a good chance the chmod available to you via FTP or SFTP does not support the recursive option. Commands available under FTP/SFTP are often somewhat crippled versions of what you'd have available locally under the shell. If you're lucky, chmod may act recursively even without the -R option but if you're unlucky, you'll have to traverse the tree, chmod'ing each level one-at-a-time.