knoti99
knoti99

Reputation:

chmod syntax in FTP-Client on all subdirectories

Which ftp client or which syntax allows easy chmod for sub-directories?

Upvotes: 2

Views: 14468

Answers (6)

syam
syam

Reputation: 815

chmod -R 755 {DIR}

You recurse with -R

Upvotes: 0

jfreak53
jfreak53

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

Tim
Tim

Reputation: 813

To chmod all subdirs from where you are (recursive):

chmod -R *

Upvotes: 0

Jonathan Leffler
Jonathan Leffler

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

Ken Gentle
Ken Gentle

Reputation: 13357

ncftp will support the chmod command if the FTP Server supports it.

Upvotes: 0

Eli
Eli

Reputation: 5610

I'm pretty sure Filezilla does it

Upvotes: 0

Related Questions