Topic "Change permissions on files and directories"

Author Message
lloyd_borrett

Guest


G'day,

I've used WinSCP to transfer a Tar/GZip from a Windows XP system to a Linux system.

When expanded to the Linux system, the permissions on files are set to 640 not 644, and the directories aren't being set to 755.

Is there a way to specify this in WinSCP?

Or is there a way to quickly change a complicated directory structure to have files set to 644 and directories to 755?

I've already worked out how to change the permissions manually. But it's not a practical solution if the structure transferred is complicated. Can you imagine how long it would take to go through say a phpBB or WordPress install and change the permissions of all of the files and directories manually?

Would there be a way using WinSCP, to recursively go through a directory structure and set files to 644 and directories to 755?

Or if not using WinSCP, some other solution?

Best Regards, Lloyd Borrett.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26572
Location: Prague, Czechia
Use change properties function, set the permissions to 644 and make sure the Add X to directories option is enabled.
_________________
Martin Prikryl
marty.mcgee

Guest


martin wrote:
Use change properties function, set the permissions to 644 and make sure the Add X to directories option is enabled.


This works! Just make sure to also check Set group, owners, and permissions recursively so that this happens to all sub-files and sub-directories: sub-files are assigned 0644 and sub-directories are assigned 0755 (which is 0644 plus 0111, or "X on directories"). Perfect, thanks!
ryanv

Guest


is this also available via command prompt? i need to change to permission (CHOWN / CHMOD) of the directory using batch file?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26572
Location: Prague, Czechia
ryanv wrote:
is this also available via command prompt? i need to change to permission (CHOWN / CHMOD) of the directory using batch file?

There's chmod:
https://winscp.net/eng/docs/scriptcommand_chmod

There's no chown.
ron423d
[View user's profile]

Joined: 2017-06-24
Posts: 3
Location: UK
this is NOT working on version 5.9.2 -

right click (on public_html), choose properties,

set octal to: 0644

check "Add X to directories"

check "set O,G, permissions recursively"

click OK,

Result: Public_Html is set properly to 0755 (good)
Files in Public_Html are set properly to 0644 (good)

any subfolders below Public_html are not changed (ie NOT set to 0755, but set to 0644). (not good)

(ie /public_html/image/ set to 0644 , even though its a directory and should have been set to 0755 )

thus recursive part + add X to directories is not working.....
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26572
Location: Prague, Czechia
ron423d wrote:
this is NOT working on version 5.9.2 -

What protocol?
ron423d
[View user's profile]

Joined: 2017-06-24
Posts: 3
Location: UK
martin wrote:
ron423d wrote:
this is NOT working on version 5.9.2 -

What protocol?


SCP
(should have included that in my post)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26572
Location: Prague, Czechia
ron423d wrote:
SCP
(should have included that in my post)

That's as designed:
https://winscp.net/eng/docs/ui_permissions#other_options
Use SFTP instead.
Advertisements

You can post new topics in this forum






Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License