- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Chown doesn't work in certain circumstances
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
тАО07-11-2003 09:41 AM
тАО07-11-2003 09:41 AM
Chown doesn't work in certain circumstances
A user logs in to one of our systems (HP,Linux, or Sun) The user creates a file in their home directory which is NFS mounted from a network storage device (EMC). They try to chown the file to another user and they get an error telling them they are not the owner. The same behavior occurs if the user tries this same test on a file system mounted from a Linux machine etc. I have attached a small spreadsheet giving the scenarios we tested. Two machines running each platform were tested. It seems like the problem is NIS related. The HP machines are running HP-UX 10.20. The Linux machines are Redhat 7.1 and 7.2. The Sun machines are running Solaris 7 and Solaris 8. I'm sure more information will be required to help solve this, but my brain is a bit fried from working on this this morning. I will gladly supply any additional info you may need to help me. Thank you in advance!
Randy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 09:48 AM
тАО07-11-2003 09:48 AM
Re: Chown doesn't work in certain circumstances
It also depend on how you export and mount.
Because via nfs you can change the user id
by adding number to it, or you didn't give
option for users a root/rw on the nfs point.
Check your export to this machines and the mount that you made on them.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 10:04 AM
тАО07-11-2003 10:04 AM
Re: Chown doesn't work in certain circumstances
look at /etc/passwd
The various user is on multiple machines right?
Accessed by multiple machines.
So, the OS really works by user number not username.
Hence potential problems.
I solved this by making sure that users get the same user and group numbers on my various machines.
NIS also solves this problem, though I don't know if it can be used in a mixed environment such as yours.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 10:08 AM
тАО07-11-2003 10:08 AM
Re: Chown doesn't work in certain circumstances
The users UID should be consistent across your NFS clients (UNIX servers). If this is not the case in your environment you may have all kinds of problems.
Elena.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 11:13 AM
тАО07-11-2003 11:13 AM
Re: Chown doesn't work in certain circumstances
Thanks again.
Randy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 11:25 AM
тАО07-11-2003 11:25 AM
Re: Chown doesn't work in certain circumstances
I can't duplicate your environment here so all we can do is try to look at things that maybe you haven't already looked at.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 11:40 AM
тАО07-11-2003 11:40 AM
Re: Chown doesn't work in certain circumstances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 12:22 PM
тАО07-11-2003 12:22 PM
Re: Chown doesn't work in certain circumstances
Here are a mount point's permissions:
drwxr-xr-x 7 root root 8192 Jun 30 17:53 shared
A sub directory of shared and it's permissions:
drwxr-xr-x 109 root users 25600 Jul 11 15:56 home
A subdirectory of home and it's permissions
drwxrwxr-x 26 rbrown users 25600 Jul 11 15:50 rbrown
If I log in as user rbrown and touch a file in my home directory, I can't chown to another user.
The file system mounted on /shared is mounted from the EMC network storage server.
Now, another example: I logged in to and HP system that has it's home directory mounted from another HP system.
Perms on /home mounted form HP host
drwxr-xr-x 29 root root 3072 May 29 14:29 home
Perms on subdirectory of /home:
drwxr-xr-x 3 brianm users 1024 Jul 11 20:16 brianm
I touch a file here and try to chown it to another user and I am successful.
Maybe this will help clarify what's happening here. Hopefully, I'll still have hair left when this is all over. If any hair left is still brown, I'll consider that a bonus. :-)
Thanks,
Randy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 12:47 PM
тАО07-11-2003 12:47 PM
Re: Chown doesn't work in certain circumstances
This might explain it:
"The [...] chown program will change the ownership if the operating system it is
running upon allows it. If you can't change file ownership then it is the
operating system which is restricting you and not the chown program.
"[...] calls the kernel system call chown() just like any other program (e.g.
perl, ruby, etc.) If the OS allows it then it will change the ownership of the
file. Different systems handle this differently. Traditional System V UNIX
systems allow anyone to give a file away to other owners.
"But on most modern systems BSD semantics are followed and only the superuser
can change the ownership of the file.
Excerpt taken from:
GNU Core Utilities Frequently Asked Questions - Why can only root chown files?
http://www.gnu.org/software/fileutils/doc/faq/#Why%20can%20only%20root%20chown%20files%3f
- - -
It may come down to BSD vs. System V semantics. HP-UX is closer to Sys V while
Solaris is descended from BSD and Linux is a mixture of both. The EMC server OS
is a UNIX variant, and based on these findings and information, I'd say there is
a good chance the EMC server OS follows BSD semantics wrt. chown.
Comments? Maybe this is all for naught. Have a wonderful weekend everyone. Thanks for the input. I'll check back on Tuesday for more comments. If I get too bored this weekend, I'll check back sooner.
Randy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2003 12:50 PM
тАО07-11-2003 12:50 PM
Re: Chown doesn't work in certain circumstances
Of course root can chown any file anywhere, the UID is always zero.
Try this out.
In a secure directory on the hp machine.
copy /etc/passwd to hppasswd
get the passwd file from all of the machines.
Then start running diff commands, compare them, see whats different.
To clarify my response:
user schmobagel is UID 510 on hp
if he's UID 512 on Linux or Solaris, how the system thinks of schmobagel is different from system to system.
NFS does permissions based on the home machine of the exported filesystem.
Example:
schmobagel on Linux has a file on the NFS export called bagel
The UID is 512
From the HP machine on that very same NFS mount, user schmobagel runs the following command
chown root:root bagel
It fails, invalid UID.
Why?
Because the UID in question in this example is 510.
Numbers take precedence over names.
You probably already understood that, and if so, I apologize for insulting your intelligence. My original explanation should have been much more detailed.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com