HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- quick permissions question - I hope
Operating System - HP-UX
1836365
Members
2032
Online
110100
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
01-08-2007 08:53 PM
01-08-2007 08:53 PM
Hi,
Can somebody clarify something. I have a file which is owned by a specific user with permissions 666 and I want to move it as another user to an alternate directory. The mv works fine however it gives an error saying it can't set the file owner or group as I'm not the owner. It just seems a little strange to me that you can move a file yet you can't change its ownership. Is it simply that I would need execute permission to be able to do this.
Thanks
Can somebody clarify something. I have a file which is owned by a specific user with permissions 666 and I want to move it as another user to an alternate directory. The mv works fine however it gives an error saying it can't set the file owner or group as I'm not the owner. It just seems a little strange to me that you can move a file yet you can't change its ownership. Is it simply that I would need execute permission to be able to do this.
Thanks
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 09:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2007 07:54 PM
01-10-2007 07:54 PM
Re: quick permissions question - I hope
Are you moving it to another filesystem? If not, the owner/group will not change.
There may be additional issues if the sticky bits are set?
There may be additional issues if the sticky bits are set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2007 11:18 PM
01-10-2007 11:18 PM
Re: quick permissions question - I hope
This is a common question. There are two permissions settings for every file. The file's permissions only affect the file's contents and not it's existence. A file can have wide open permissions (666) and yet you are not allowed to create a file, remove it, rename or move the file unless you have permission to do so from the directory.
There is a big difference between copy and move. For a cp to succeed, you only need read permission for the source file. But the mv command must have read permission for the source file plus write permission for the parent directory of the source file. Always remember this:
A file's contents are governed by it's permission, but the file's existence (create, remove) are governed by it's directory.
To create, rename, move or remove a file, the directory must allow write privileges. A file with 000 permissions can be removed by anyone if the directory has world write permissions. That's why 777 directories are only useful for temporary or junk files. To control the random removal of files, you can set the t bit (also called the sticky bit) to prevent any user except the owner to remove a file. The chmod command is chmod 1777 /some_dir
Now execute bits on a file are often misused, especially when trying to fix a problem with 'permission denied' error messages. 777 is the worst possible setting for any file since it can be run by accident as a script. You also never want 777 permissions on any file because the contents can be changed by every user on the system.
The same is true for 666. Any user can destroy the contents of a 666 file.
Bill Hassell, sysadmin
There is a big difference between copy and move. For a cp to succeed, you only need read permission for the source file. But the mv command must have read permission for the source file plus write permission for the parent directory of the source file. Always remember this:
A file's contents are governed by it's permission, but the file's existence (create, remove) are governed by it's directory.
To create, rename, move or remove a file, the directory must allow write privileges. A file with 000 permissions can be removed by anyone if the directory has world write permissions. That's why 777 directories are only useful for temporary or junk files. To control the random removal of files, you can set the t bit (also called the sticky bit) to prevent any user except the owner to remove a file. The chmod command is chmod 1777 /some_dir
Now execute bits on a file are often misused, especially when trying to fix a problem with 'permission denied' error messages. 777 is the worst possible setting for any file since it can be run by accident as a script. You also never want 777 permissions on any file because the contents can be changed by every user on the system.
The same is true for 666. Any user can destroy the contents of a 666 file.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP