LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-18-2006, 12:56 AM   #1
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Rep: Reputation: 0
Default CHMods


Hi,

I'd like to know how I can set a default CHMod for folders and a default CHMod for files. In a specific web directory on my server I want the CHMod for dirs to be 0755 and for file 0644. It does this on my web host, but I can't figure out how to do it on my home server!

Thanks!
-M
 
Old 08-18-2006, 01:16 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Look into 'umask'. I think you want 'umask 022'.
 
Old 08-18-2006, 01:52 AM   #3
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks Matir! It fixed folders, but not files. Now folders are 755 by default but files are 600 (I don't think that's changed). Any ideas?

-M
 
Old 08-18-2006, 01:54 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Files should be 644 with 022... tested it on my box, even.
 
Old 08-18-2006, 02:10 AM   #5
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Original Poster
Rep: Reputation: 0
Not so on my PC

I just did a couple things and it's doing the same thing. I typed "umask -p" which is supposed to return the current umask and it says 0022.

I'm stumped! This isn't very easy.
-M
 
Old 08-21-2006, 08:33 PM   #6
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Original Poster
Rep: Reputation: 0
Ideas anyone?

-M
 
Old 08-31-2006, 07:39 PM   #7
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Original Poster
Rep: Reputation: 0
I still need an answer.

Maybe I should start a new thread about this. People probably aren't answering because there are so many posts and they're figuring that the problem is solved.
 
Old 08-31-2006, 07:54 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Please try the following script in an empty directory (for easy cleanup afterwards):

Code:
umask 022
mkdir tempdir
touch tempfile
ls -al
umask
 
Old 09-01-2006, 05:17 PM   #9
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Original Poster
Rep: Reputation: 0
Ok, thanks, I did this. Now what? Am I supposed to paste what it did back? (after umask it said 0022).
 
Old 09-01-2006, 05:33 PM   #10
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Yes, sorry, I should've been more specific. Please paste the output.

I'm not aware of any reason it should not have 644 permissions.
 
Old 09-01-2006, 05:50 PM   #11
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by Moogey
People probably aren't answering because there are so many posts and they're figuring that the problem is solved.
Not in my case. I didn't respond because in the decades and decades I've been using *nix systems, never once have I seen it do what you're describing. A umask of 022 always gives me new directories of 755 and new files of 644. So I don't know what to tell you.

Also, could I ask why the unusual capitalization of "chmod"? You're typing "CHMod". I've never seen it typed that way. I didn't recognize what your post was about by the subject line alone. I had to read the word in context to see what you were talking about.

I've definitely seen different pronunciations though. I personally pronounce "chmod" as "change mode". But I once knew a guy who always said "sha-MOD" (which sounds like some French word to my ears).
 
Old 09-01-2006, 06:05 PM   #12
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Original Poster
Rep: Reputation: 0
drwxr-xr-x 2 root root 48 Sep 1 18:53 tempdir
-rw-r--r-- 1 root root 0 Sep 1 18:53 tempfile
/home/site31-x # umask
0022

-----

Ok so this appears to be working. However, whenever my FTP program uploads a new file it's set to -rw-------. I can't see how this can be a problem of my FTP client because on another server everything is fne and it uploads as 0664. Strange, any ideas?

haertig: Yes, interesting observation! I really don't know why I spell it that way. I probably saw it spelled like that once and just started doing it that why myself. And I pronounce it "key-mod"

Last edited by Moogey; 09-01-2006 at 06:06 PM.
 
Old 09-01-2006, 06:21 PM   #13
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by Moogey
I can't see how this can be a problem of my FTP client
I would suspect some setting on your FTP server, not the client. But I don't run FTP so I don't know what setting it might be.
 
Old 09-01-2006, 06:25 PM   #14
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
That's the first time you mentioned ftp ... you may want to read up
on your ftp-daemons set-up ;}


Cheers,
Tink
 
Old 09-01-2006, 06:58 PM   #15
Moogey
LQ Newbie
 
Registered: Oct 2005
Distribution: openSUSE 10.1, Ubuntu 6.06
Posts: 17

Original Poster
Rep: Reputation: 0
No wait guys, sorry, it's not just FTP.

I just used File Browser (Nautilus) on the same directory and did Right Click > Create Document > Empty File and the permissions on this were 600. Now when I type "touch file" as the same user in the same folder, the permissions are 0644. I tried restarting Nautilus just in case it cached the permissions, but it still did this.

Wow, weird. Should I try restarting the computer? Shouldn't need to... it's linux!!!

Edit for additional info: If I create a new file in gedit, it has the correct permissions: 0644. It's just creating a new file in Nautilus and in FTP that's the problem.

Last edited by Moogey; 09-01-2006 at 07:09 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Details about default web Browser & default Email client sudhasmyle Linux - Software 4 06-15-2006 11:45 AM
Web-server chmods Gujiz Linux - Newbie 1 12-18-2004 07:24 AM
Default Drowser & Default E-mail Cli sudhasmyle Linux - Networking 1 11-20-2004 10:42 AM
setting default page size and default tray lived4eva Linux - General 1 11-04-2003 02:39 PM
New Virtual Servers Default to Default Server Page? DigiDave Linux - Software 4 10-18-2003 03:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration