- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File Ownership/Permission on Softlinks
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
Discussions
Discussions
Discussions
Forums
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
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
тАО02-21-2011 08:46 PM
тАО02-21-2011 08:46 PM
Suppose softlink points like this:
moon --->/opt/a/b/c
Also moon has ownership root:sys
In case we want to change ownership of moon then do we change ownership of /opt/a/b/c or moon ?
Is same rule applies while changing permission of moon also ?
Thanks,
Manoj
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2011 09:10 PM
тАО02-21-2011 09:10 PM
SolutionThe "-h" option of chown command conditions the behavior.
-h Change the owner or group of a symbolic link.
By default, the owner or group of the target file that a symbolic link points to is changed. With -h, the target file that the symbolic link points to is not affected.
In your case, if you execute:
#chown -h bob:users moon
The new ownership (bob:users) only afect at softlink (moon), and real file (/opt/a/b/c) keeps original ownership.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2011 09:58 PM
тАО02-21-2011 09:58 PM
Re: File Ownership/Permission on Softlinks
If chmod is used on a symbolic link, the mode of the file referred to by the link is changed.
Rgds...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2011 10:40 PM
тАО02-21-2011 10:40 PM
Re: File Ownership/Permission on Softlinks
"man 4 symlink" says this:
-----
The mode and ownership of a symbolic link is ignored by the system, which means that chmod affects the actual file, but not the file containing the symbolic link (see chmod(1)).
-----
Think about it: any normal user can create softlinks, pointing to any file at all. If the permissions of a softlink had any meaning, it would be an easy way to access any file whose pathname is known.
(In other words, a regular user might try making a softlink pointing to /etc/shadow or /tcb/files/auth/r/root. If the ownership & permissions of the link were effective, s/he could now read the root password hash, crack it on his/her own computer, and later come back to login/su to root. But in reality, this does not work.)
Jose already told you how to change the ownership of a softlink if you need to.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2011 10:52 AM
тАО02-22-2011 10:52 AM
Re: File Ownership/Permission on Softlinks
Well the permissions could be additive, only providing extra security.