- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unexpected behaviour of useradd
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
04-30-2003 02:17 AM
04-30-2003 02:17 AM
I discovered only recently the following, and unspecified, behaviour of useradd.
I have a user account named "src" whose home is /home/src, and I need to create another one, named "srctm", with the same home directory. So I created it:
# useradd -u
... and I was very disappointed, least to be said, to discover that useradd horribly chowned -R srctm:srctm /home/src, which contains thousands of files eventually. I really would have liked this to be documented, but it is not. Hence, there is a bug somewhere, either in the docs, or in the code... or did I miss something?
What are your opinions about that? Is there a way to perform a useradd without that chown? I think that behaviour should be removed, since it is not specified.
Thanks for your help!
Olivier
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 02:21 AM
04-30-2003 02:21 AM
Re: Unexpected behaviour of useradd
When you add the user in SAM
it will give a alert for the existing home directory used by another user.
As for command line it does that silently.
As far as I know You cannot use the same home directory for two users.
the directory ownership will be only for one user.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 02:28 AM
04-30-2003 02:28 AM
Re: Unexpected behaviour of useradd
I don't agree with having same home dir for 2 uid's. as usual recently created uid will be owner that home dir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 03:25 AM
04-30-2003 03:25 AM
Re: Unexpected behaviour of useradd
I know that having two users share the same home directory is not common, but I have special needs, since that second user should get an environment chrooted to the first user's home directory (I changed the user's shell to * eventually), hence the need to set the user's home directory to that of the first user.
Any HP representative willing to reply "We're working on that"? That would be worth ten points! :o)
Regards,
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 03:39 AM
04-30-2003 03:39 AM
Re: Unexpected behaviour of useradd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 03:45 AM
04-30-2003 03:45 AM
SolutionIf you use SAM this is not a problem.
SAM --> add the shared home directory and uncheck the box that says
[ ] CREATE HOME DIRECTORY
SAM will also display a warning:
Directory "/home/cherylg" already exists. If you set the "Create Home Directory" toggle, SAM will change the permissions on this directory to match the new user and will copy default configuration files into the directory, possibly overwriting existing files. If you do not set the "Create Home Directory" toggle, SAM will not change the permissions on this directory nor will any configuration files be copied into the directory.
Would you like to use this home directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 03:48 AM
04-30-2003 03:48 AM
Re: Unexpected behaviour of useradd
I will try
What you can do is first create a user with the required home dir like /home/src
Then add additional users with different home dir's like /home/src1,/home/src2..
What you can do is after creating the users edit the /etc/passwd file and change the home dir of the other users to /home/src.
This will not do a chown.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 03:54 AM
04-30-2003 03:54 AM
Re: Unexpected behaviour of useradd
using the create home dir toggle button.
For the first user enable button.
For the other users disable the toggle button
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 07:07 AM
04-30-2003 07:07 AM
Re: Unexpected behaviour of useradd
Christopher: I could have written my own utilities, but I prefer to restrict myself to the HP interfaces, i.e. useradd or SAM, for consistency purposes, since user management is part of the system's work, and the system is developed by HP. I would not try to execute assembly language in real mode to bypass the system calls. It's in the same spirit that I prefer to use HP interfaces only for creating users, no matter that the interfaces are at a higher level or not.
Cheryl: That's the reply I was waiting for! But I'm surprised about your answer on using SAM, since I thought SAM was using useradd. Btw, I didn't find the reference 5003407825 in the technical knowledge base.
TG: I thought of making useradd with different directories, but with a usermod following. I don't want to edit the password file, since it bypasses the system interfaces. Eventually, I can tolerate using vipw, but I use it only when necessary, since I suspect that its file locking mechanism is not consistent with useradd's and SAM's, though it should be... But after all, maybe it is! Thanks for the effort anyway, and though you don't have the HP logo near such a nice hat, here are the ten points (6+4) :o)
Regards,
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 08:34 AM
04-30-2003 08:34 AM
Re: Unexpected behaviour of useradd
There is 1 ER and a number of SR's. If you would like, I can sort through which SR is the still open, and then I can register you in the SR Notify Database so that you are emailed when the issue is addressed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 08:44 AM
04-30-2003 08:44 AM
Re: Unexpected behaviour of useradd
It took me a couple of hours to straighten things out. I don't work very well with irate VPs breathing down my neck, asking when they can get their email back.
My coworker now has the nickname of "chown boy".
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 08:45 AM
04-30-2003 08:45 AM
Re: Unexpected behaviour of useradd
It took me a couple of hours to straighten things out. I don't work very well with irate VPs breathing down my neck, asking when they can get their email back.
My coworker now has the nickname of "chown boy".
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 08:47 AM
04-30-2003 08:47 AM
Re: Unexpected behaviour of useradd
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 12:50 PM
05-06-2003 12:50 PM
Re: Unexpected behaviour of useradd
Cheryl: Eventually, I don't know what ERs and SRs are, but I suppose that "R" means "Report", and that sounds interesting, thanks in advance if you can add me to the notify list about that useradd problem!
Martin: It's good to know that I'm not alone... in some sense! As I can see, I could have been less lucky... I hope I won't get that nickname too!
Regards,
Olivier