- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- uid and NIS
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
05-18-2002 11:38 PM
05-18-2002 11:38 PM
When performing gtar to archive a few filesystems with the option:
gtar -cvfh /dev/rmt1 nwdv.uav.4,
where nwdv.uav.4 is the filesystem to be archived, and I realized that upon restoration at another remote site with a different NIS server, the ownership of the filesystems would be that of root(I tar-ed these filesystems as a root).
i.e
drwxrwx--- 3 root wmt 512 nwdv.uav.4
Is there a way for preserving the ownerships/uid of the the filesystems during archive and restore?
If I'm not mistaken, there isn't an option in tar/gtar to maintain ownership of filesystems during archive/restore. Anyone has ideas on how to solve this matter?
Also, when these files have been restored at a remote site, they would be need to be sync-ed with the source fileserver. When this happens, the ownership of the filesystem looks as follows:
drwxrwx--- 3 14716 wmt 512 ... nwdv.uav.4
The uid(col 3) of the original user would appear as the owner of the filesystem. Could some one explain this scenario, and how do I solve this matter?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2002 11:59 PM
05-18-2002 11:59 PM
Re: uid and NIS
The default action for the root user when restoring files is to restore the original ownership and permissions. See the 'tar' man pages, particularly the 'p' option.
The ownership of the files on the receiving system shows the 'uid' of the file on the source system because there is no account with this matching 'uid' on the receiving server.
From you example, it appears that there is no uid=14716 on the system to which you restored your file.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2002 12:16 AM
05-19-2002 12:16 AM
Re: uid and NIS
I looked at the -p option, seems like it only preserves the permission settings of the filesystem. After looking at the man pg as you suggested, I found this "--same owner" option. Is this the option which you're really referring to?
About the original uid appearing as the owner of the filesystem upon restoration, you seem to imply that the destination NIS server is unable to map that uid to its central db to obtain the name, so that's why it only appears as the uid to represent the owner of the file?
But how does the local system actually knows of the uid of the filesystem restored on its site from a remote site? Does tar/gtar actually maintains the uid during archiving ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2002 03:53 AM
05-19-2002 03:53 AM
Re: uid and NIS
when you restore the backup the new server can only cross reference the UID with the new NIS UID if it does not exist it will complain if it does it will give the UID of the new NIS UID.
as the others have said you can use the -p option to preserve permissions but this only works if the NIS is in sync.
If it complains you may wish to change globally the file ownerships have a look at this thread wich we have covered previously.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x037b3f490f4ed61190020090279cd0f9,00.html
hope ths helps
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2002 09:44 PM
05-19-2002 09:44 PM
Re: uid and NIS
whenever you backup or restore the files using tar the permissions are preserved.
When restoring to a remote machine the files will check for a username and uid matching for the backed-up file.
Else it will list only the uid because there is no uid matching the backed up file uid with the passwd file entry.
There is this case where you have file owner as 14716.Now as there was no uid in the passwd file of the remote machine it has listed only the uid of the file.
If this uid has a different user name associated in the remote machine it will make that user the owner of the file.
To resolve create the user with 14716 uid to get the ownership.
Here the restored file has preserved it's group,the group wmt has the same gid on both the machines.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2002 12:09 AM
05-20-2002 12:09 AM
Re: uid and NIS
Does this mean that if the same user already exists on both of the remote sites, then tar would be able to preserve the rightful OWNERSHIP of the filesystem? and not assume the ownership of the person executing the tar?
I'm executing the tar as a root, & when I restore those filesystems, all I see is:
rw-r--r-- 1 root system 78789 tarFile1.tar
where tarFile1 is the tar-ed filesystem, using tar -cvfh tarFile1.tar dir1
Please advice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2002 12:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2002 09:24 PM
05-20-2002 09:24 PM
Re: uid and NIS
I thought if the user names are the same in both the local and remote machines, but having different uid:
local machine remote machine
usrname: A username: A
uid : 1700 uid : 1800
file1 file1 (restored from local machine)
then for user A to access its file1 in remote machine, then it would need to login into remote machine and be mapped to the local NIS server, and hence its username mapped into the local uid, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 12:46 AM
05-21-2002 12:46 AM
Re: uid and NIS
the UID is what is passed over to the server so if on system a user John has UID 777 then the files are transferred to system b which has a user called fred with UID 777 then the files will be listed as belonging to Fred.
effectively the username is an alias of the UID on the local system.
cheers
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 12:51 AM
05-21-2002 12:51 AM
Re: uid and NIS
i am talking of a normal passwd file authentication.
local machine remote machine
usrname: A username: A
uid : 1700 uid : 1800
file1 file1 (restored from local machine)
if you restore a file backedup on a machine A.If you restore it on machine B,it will take the uid 1700 and it will try to get the username for that UID as owner of the file
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 01:03 AM
05-21-2002 01:03 AM
Re: uid and NIS
So as long as the user names exists on both sites, regardless of their uids, therefore file1 in the example would assume the ownership of A, if there are no other users having the same uid of A from the local machine. Am I on the right track?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 01:44 AM
05-21-2002 01:44 AM
Re: uid and NIS
it is dependent on UID.
I have a file backed up as uid 1700.
If I restore it on another machine then it will look for the user with the 1700 UID.
Like,
I have a user called money with UID 1700 on machine A.
I have also the user money on machine B with UID 1800.Also on machine B i have another user chen UID 1700.
If I take a backup of file on machine A with owner as money and if I restore on machine B,then Chen will be the owner.
If you do not have any user with UID 1700 then the ls -l of that file will only show the UID 1700.
Am I pointing things right!!