- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How directory, subdirectory, file permissions ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 05:32 AM
08-01-2001 05:32 AM
How directory, subdirectory, file permissions work
/dir set to r-x
/subdir set to r-x
/file set to rwx
I know "other" users should not be able to delete my file. But can they modify the contents of the file? Or are is my file protected from "other" based on the permissions of the /dir and the /subdir?
Any help would be appreciated.
Thanks
Rich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 05:42 AM
08-01-2001 05:42 AM
Re: How directory, subdirectory, file permissions work
Sorry, in this example, while they cannot delete the file, "others" can modify it -- you granted "r/w/e" permissions to 'other'.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 05:43 AM
08-01-2001 05:43 AM
Re: How directory, subdirectory, file permissions work
the directory itself contains an index of the files within it.
if a directory is rwx for others (ie not me or my group) others can delete any files I create, or at least remove the index from the directory. (even if the file is --- for others)
Other than that
user group others
- - - - - - - - -
#uid
from /etc/passwd
#gid
from /etc/group
others is anything not
in your gid nor your uid
Access Control lists (ACLs) can finetune group permissions man lsacl and chacl for more on that.
man ls for information on permissions and all the different file types
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 05:46 AM
08-01-2001 05:46 AM
Re: How directory, subdirectory, file permissions work
Others can write to it and hence modify or effectivley delete it.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 05:47 AM
08-01-2001 05:47 AM
Re: How directory, subdirectory, file permissions work
Because you donot have 'w' for directory for 'others' they cannot delete the files in the directory as deleting a file means modifying the content of the directory.
But as the file itself has w permission 'others' can write the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 05:54 AM
08-01-2001 05:54 AM
Re: How directory, subdirectory, file permissions work
If you have a directory with r/w/e permissions, like /tmp and you *don't* want users to be able to remove files other than those they own, then set the "sticky" bit on the directory:
# chmod 1777 /tmp
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 06:16 AM
08-01-2001 06:16 AM
Re: How directory, subdirectory, file permissions work
With dir & subdir having permission of r-x for other, no file can be created or deleted by others in directory. But in same dir/subdir if any file has rwx permission for others, file can be modified by others and not deleted.
Setting sticky bit on directory (with 1777) users can create files in that directory and delete those owned by them only.
Thanks.
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 03:18 PM
08-01-2001 03:18 PM
Re: How directory, subdirectory, file permissions work
or less the same. For directories privileges work
as follows:
x - allows access to files in the directory
(allows rwx to the file or directory as per
the files permissions. You need at least
this access to all files in the path to a
file you want to access.)
r - allows scanning the directory to see the contents
(which files are in the directory. Doesn't
imply access to the file.)
w - allows changes to the directory (create,
rename and delete files and directories
even if you don't have access to their contents.
Requires x access to be set. The t bit restricts
delete access to files you own.)
For files the access works as follows:
x - Indicates file contents are executable. (Treat the
file as a command if refenced as the first item
of a command line. Scripts can be execute with
out this bit by calling the shell with the file a
the command 'sh myscript'. Read access is
required.)
r - The contents of the file can be read.
w - Data can be written to the file. (The contents
of the file can be modified. Doesn't imply the
ability to delete the file. You can truncate though.)
The numeric bit values are x = 1, w = 2, r = 4.
The applicable access is determined by the following
criteria:
root - grant full access
file owner (u) - users UID = file UID
file group (g) - users belongs to the group that the
file belongs to (different approaches are
used to determine group membership)
other (o) - didn't match any of the above criteria
Usually only the first match applies. Therefore
----r--rw- (046) allows group read access, and others
read write access but prevents you from accessing the
file. As owner you can change the file permissions to
permit yourself access.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2001 07:32 PM
08-01-2001 07:32 PM
Re: How directory, subdirectory, file permissions work
Directory permissions control the EXISTENCE of a file.
File permissions control the CONTENTS of a file.
So a file can have 000 permission (no one except root can read or write the file) but if the directory for this file has 777 permissions, anyone can delete it. (try it in /tmp, assuming /tmp is 777 or -rwxrwxrwx and does not have the t-bit or sticky bit set).
Bill Hassell, sysadmin