Do you know how can I set permissions beforehand for a folder that I want to upload on a linux server? I'm working on a piece of software (php/mysql) on my local windows machine, I then tar the folder and upload it to my ubuntu web server. When I untar the contents, all the files and folders have automatically 777 permissions. Can I change that some way?

link|improve this question
feedback

2 Answers

up vote 2 down vote accepted

Since Windows does not have Unix-style permissions, tar-ing up files on Windows will not result in usable Unix permissions when it is unpacked on a Unix system.

When creating, use --mode to set a specific mode.
When unpacking, use --no-same-permissions to ignore the stored permissions and use the current users' umask.

man tar :)

link|improve this answer
Thanks adaptr. Does --mode enforces the permissions for every file? --no-same-permissions worked fine for the time being (files were unpacked as 755). – Ion Dec 21 '11 at 19:30
feedback

You can try a --no-same-permissions parameter, when you untaring the contents of archive.

link|improve this answer
Yeah, I didn't read the question properly the first time either ;) He's not talking about samba anywhere - he's talking about tar(1). – adaptr Dec 21 '11 at 9:06
Yes, it was a my fault, I did't read a question carefully... I've gave you a vote. – Jan Marek Dec 21 '11 at 9:08
well thank you :) – adaptr Dec 21 '11 at 9:09
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.