Reputation:
Which ftp client or which syntax allows easy chmod for sub-directories?
Upvotes: 2
Views: 14468
Reputation: 2349
LFTP allows for recursive CHMOD if the client allows it. You can accomplish this by logging in with LFTP from a Unix/Linux CLI and then run the following:
chmod -R 0755 /www/directory/*
You could also setup a real nifty Bash script for this:
#!/bin/bash
lftp <<EOF
set ftp:ssl-allow no
set ftp:passive-mode true
set ftp:list-options -a
open -u [user],[password] [host]
chmod -R 0777 /www/directory/*
EOF
Of course LFTP does not distinguish between files and folders, for running this command on only files/folders respectively I would suggest using FileZilla. It allows this when running the command on a folder.
Upvotes: 1
Reputation: 754160
As the answer from @Ken G suggests, this is more likely to be a question of "what does the FTP server support".
I tried ncftp (running under Cygwin on Win XP) against Sun FTP running on Solaris 10 (where chmod -R
is supported by the o/s version of chmod
). I got an error back:
ncftp /work1/jleffler/tmp > chmod -R g+x *
chmod g+x: server said: 'SITE CHMOD -R g+x': command not understood.
chmod *: server said: 'SITE CHMOD -R xx.pl': command not understood.
ncftp /work1/jleffler/tmp >
My suspicion is that few if any systems make it easy. It would be worth checking out whether the NCFTP server helps you.
Upvotes: 0
Reputation: 13357
ncftp will support the chmod
command if the FTP Server supports it.
Upvotes: 0