The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
permission of /var/tmp a2156z SUN Solaris 7 03-18-2009 05:59 PM
Denying IPaddress for Multiple Failed Login Attempts metzgerh AIX 1 12-13-2006 04:13 PM
Permission 711---RWX---X---X bobo UNIX for Dummies Questions & Answers 6 03-29-2006 12:50 PM
permission help eloquent99 UNIX for Dummies Questions & Answers 2 02-12-2003 04:30 AM
su permission siavoush UNIX for Dummies Questions & Answers 12 06-16-2002 12:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-23-2009
#moveon #moveon is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 40
Why is it denying me permission?

I have created a file and set the permission to read and write only for user and group. Here is how I did it:

chmod filename 660

I used ls -l to see and the changes are right so, why is it saying permission denied when I try to change into it. When I type cd filename, I am told permission denied. Why?
  #2 (permalink)  
Old 04-23-2009
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Directories need execute permissions.
Try...
chmod 770 dirname
  #3 (permalink)  
Old 04-23-2009
#moveon #moveon is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 40
Yeah I tried with execution, even 700 it works. But I don't understand because this is homework given us by the teacher and unless it is a mistake, it is stated clearly that we should create three directories and then change their permission to read and write only for user and group. And then they said we should change to one of the directories. Maybe it was a mistake?
  #4 (permalink)  
Old 04-23-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514
Quote:
Originally Posted by #moveon View Post
I have created a file and set the permission to read and write only for user and group. Here is how I did it:

chmod filename 660

I used ls -l to see and the changes are right so, why is it saying permission denied when I try to change into it. When I type cd filename, I am told permission denied. Why?
the correct syntax is
chmod 660 filename

also, make sure you(user) is the owner or belong to the group of the filename.


cheers,
Devaraj Takhellambam
  #5 (permalink)  
Old 04-23-2009
#moveon #moveon is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 40
Quote:
Originally Posted by devtakh View Post
the correct syntax is
chmod 660 filename

also, make sure you(user) is the owner or belong to the group of the filename.


cheers,
Devaraj Takhellambam
Sorry, my mistake but I wrote it as chmod 660 filename. And yes, the PC belongs to me.
  #6 (permalink)  
Old 04-23-2009
robsonde robsonde is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 163
access permissions take a different meaning for directories. Here's what they mean:

• Read determines if a user can view the directory's contents, i.e. do ls in it.
• Write determines if a user can create new files or delete file in the directory. (Note here that this essentially means that a user with write access to a directory can delete files in the directory even if he/she doesn't have write permissions for the file! So be careful with this.)
• eXecute determines if the user can cd into the directory.
To be safe you should keep R and X together on directories.


in your case you have no "X" and so cant CD into the directory.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0