LinuxQuestions.org
Review your favorite Linux distribution.
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-15-2005, 09:12 AM   #1
q.sa
LQ Newbie
 
Registered: Jun 2005
Posts: 11

Rep: Reputation: 0
Cannot set chmod for directory to 777 or 666


I logged as root and tried to change permission for directory to drw-rw-rw- so i used:
chmod 666 dir_name

result i got drw-r--r--

strangest thing is- i can change the permission for this dir. but i cannot set it to "write by all" mode... and i do need it for PHP file upload...

Ideas?
 
Old 07-15-2005, 09:23 AM   #2
rahmed
Member
 
Registered: Feb 2004
Location: somewhere over the rainbow...
Distribution: Slackware 10.1
Posts: 166

Rep: Reputation: 30
ok, i dont remember the numbers, but u can try chmod a+rw for everyone to have read write access to it.
 
Old 07-15-2005, 09:40 AM   #3
q.sa
LQ Newbie
 
Registered: Jun 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Using a+rw its the same as 777 - unfortunately for me its the same result cant set write permission for others (except owner - owner is set to full- both read+write+exec)
 
Old 07-15-2005, 10:18 AM   #4
rahmed
Member
 
Registered: Feb 2004
Location: somewhere over the rainbow...
Distribution: Slackware 10.1
Posts: 166

Rep: Reputation: 30
hmm...intersting..
maybe u could try changing the owner?
chown user file
where user is the username u want to have the ownership and file is the directory or file.
try changing the owner and then changing the permissions.
 
Old 07-19-2005, 06:39 AM   #5
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
Incidentally - if your directory doesn't have execute permissions, it won't work....you execute a directory when you cd into it:

[me@localhost ~]$ mkdir try_this
[me@localhost ~]$ cd try_this/
[me@localhost ~/try_this]$ touch a_file
[me@localhost ~/try_this]$ ls -l a_file
-rw-r--r-- 1 me users 0 2005-07-19 06:44 a_file
[me@localhost ~/try_this]$ cd ../
[me@localhost ~]$ chmod -x try_this/
[me@localhost ~]$ cd try_this/
bash: cd: try_this/: Permission denied

[me@localhost ~]$

So when you get this figured out...777's going to be the way to go, not 666 :-)
 
Old 07-19-2005, 09:01 AM   #6
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
are you (just a guess) trying to change permission on a filesystem that is not supporting permission ( like FAT32/NTFS/SMB/NFS/... ) ?
 
Old 07-19-2005, 09:36 AM   #7
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
I bet it's a problem with the permissions that are already set, preventing you from modifying the permissions on the directory. Make sure you have read, write, and execute permissions for the parent directory first. If you don't, then set them (chmod o=rwx /path/to/parent), and try chmoding the directory you want again. If it still doesn't work, try adding just execute permission for you first, then try adding the read-write permissions for everyone. If THAT doesn't work, then I have one last idea - it could be that something with umask is causing the issue. Try setting umask to nothing (umask 0000) and then try chmoding your directory. This probably shouldn't happen - it's only supposed to work this way if you don't specify an access class in chmod (like chmod +x for example).
 
  


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
did chmod 666 on a directory but it doesn't work r3dhatter Linux - Newbie 6 06-10-2005 10:06 AM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM
is it safe to set /var to chmod 777 carlosruiz Linux - Security 5 06-17-2004 05:57 AM
is it safe to set /var to chmod 777 carlosruiz Linux - Security 4 12-31-2003 04:00 AM
accidently set "chmod -R 777 *".. need help? scorpatron Linux - General 10 12-05-2003 03:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:47 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