LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-14-2005, 10:11 AM   #1
mgmax
Member
 
Registered: Jul 2005
Location: Erlangen, DE
Distribution: Debian testing/unstable
Posts: 82

Rep: Reputation: 16
Question FTP: recursive chmod (separate for directories and files)


Hello,

does anyone know a tool or an application with which I can do the following via FTP:
chmod -R 755 <all dirs>
chmod -R 644 <all files>

mgmax
 
Old 07-14-2005, 03:26 PM   #2
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
most ftp clients will chmod recursivley by default, so it could be trickey to make the file one thing and the directories somthing else.


why do you need to do this?


If you want to allow uploading, but not allow changing of files, it would be easier and safer to have a seperate upload directory
 
Old 07-14-2005, 04:20 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Recently, I had to change the names of around 500 files on a few dozen devices with an ftp network interface.

I cut and pasted the directory listing to a file, and then used sed to extract the file names I needed to work with. This created a script of ftp commands. Using linux you can run a script by redirecting a file.

ftp ftp://name:password@ipaddress <ftpscript

In my case, I needed to perform this on a number of machines so the last command was 'bye'. Then the line above could be placed in a for loop, where I used a variable for the last IP number.
 
Old 09-10-2005, 09:41 AM   #4
matthias_k
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Rep: Reputation: 0
Quote:
Originally posted by Kahless
most ftp clients will chmod recursivley by default, so it could be trickey to make the file one thing and the directories somthing else.


why do you need to do this?


If you want to allow uploading, but not allow changing of files, it would be easier and safer to have a seperate upload directory
You need this if you want to setup a CMS or Wiki or discussion board or any other piece of software which is configured through a webinterface. For this to work, you usually have to make the config directory and all files in it world writable and you don't want to chmod 150 files in 20 different (sub-)folders by hand, trust me.

I'm using gFTP and it doesn't chmod recursively and it's a major pain in the back. So is there any Linux FTP client which can chmod recursively? It's not true that most of the ftp clients do it automatically, I don't know one which actually does, because 90% of the Linux ftp clients are frontends to 'ftp' and 'ftp' doesn't chmod recursively, at least not by default.
 
Old 09-10-2005, 09:54 AM   #5
mgmax
Member
 
Registered: Jul 2005
Location: Erlangen, DE
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 16
yes, for a cms setup, but not only for config directory, but for images, etc, etc, too.

my solution was:

copy offline folder to /tmp/something
chmod it locally as you want
transfer with gftp and swith on the option "keep permissions" somewhere.

mgmax
 
Old 09-10-2005, 11:04 AM   #6
matthias_k
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Rep: Reputation: 0
Yep, that's the best one can do right now. Still I think it would be more than just a nice feature to have a recursive chmod command in e.g. gFTP (which I'm using exclusively). I wonder why this isn't a standard feature of ftp clients, it can't be that hard to implement since the chmod command itself already has this option!
 
Old 09-10-2005, 11:41 AM   #7
mgmax
Member
 
Registered: Jul 2005
Location: Erlangen, DE
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 16
the unix chmod command has this, but not the one in the ftp server called by SITE CHMOD.
But as clients have features for recursive copying etc., it wouldn't be a problem to implement recursive chmod, ls, etc.

mgmax
 
Old 06-19-2006, 01:45 PM   #8
ah.fouladi
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Just use lftp
it supports recursive chmod
 
Old 10-01-2007, 03:38 PM   #9
mgmax
Member
 
Registered: Jul 2005
Location: Erlangen, DE
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 16
Lightbulb Konqueror - THE best ftp program

I found a really good solution - Konqueror (yes, the KDE file browser)

You can use it for ftp - simply enter ftp://username@server.xyz into the address bar and type enter

You can chmod recursively by right-clicking on an item (or multiple items) and choosing "Settings" - Now a settings dialogue appears. Click on "Rights" - now you can select all options you like - don't forget about the checkbox "apply to all subfolders and their contents".

After clicking on OK, a status dialogue appears that only says "logon successful" - simply wait for some time until it disappears and the rights have been changed.

(Sorry, I don't know the exact english texts - if someone could look them up for me, it would be nice.)

If someone has other experiences, please write back.

mgmax
 
Old 10-01-2007, 03:46 PM   #10
matthias_k
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Rep: Reputation: 0
Quote:
Originally Posted by mgmax View Post
I found a really good solution - Konqueror (yes, the KDE file browser)
...
How weird to get an answer to a question posted 2 years ago. But, thanks, anyway :-D

I use Nautilus now. It can serve any folder from any source transparently via a VFS. I'm pretty sure it can also chmod recursively.
 
Old 12-01-2008, 12:11 AM   #11
jprovostla
LQ Newbie
 
Registered: Dec 2008
Posts: 1

Rep: Reputation: 0
Cool Konqueror to recursively change permissions

I just used Konqueror to change file permissions recursively [to any depth] on my laptop and it works very well...
the regular Linux file browser only does it to the immediate folder contents... CHMOD with -R only applies changes to the immediate folder contents...
I was looking for a tool that would apply the changes to all subordinate files and folders... and Konqueror did it very quickly & easily...
Thank you for the hint, J.
 
Old 01-29-2011, 08:06 AM   #12
neils_f
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
FileZilla can also recursively chmod your remote files/directories. You can even decide if you want both chmoded or files only or directories only.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using chmod to recursively change directories / files [GOD]Anck Linux - Software 6 11-10-2008 06:16 PM
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 03:22 PM
chmod recursive on files on dlublink Linux - Newbie 6 03-02-2005 08:45 AM
chmod.....recursive help stateq2 Linux - General 3 03-28-2004 07:28 PM
chmod directories and files seperately robeb Linux - General 2 05-23-2003 08:01 PM


All times are GMT -5. The time now is 11:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration