- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to modify the root account (changing its home ...
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
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
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
тАО03-19-2010 11:39 AM
тАО03-19-2010 11:39 AM
I wanted to change the home directory for the root accout from "/" to "/roothome"
I used usermod as follows and got a complaint:
****************************
$ id
uid=200(newa) gid=300(sa)
$ sudo /usr/sbin/usermod -m -d /roothome root
Login root is currently in use
****************************
All ideas on how to work around this?
Thanks a lot in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 11:46 AM
тАО03-19-2010 11:46 AM
Re: how to modify the root account (changing its home dir)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 11:46 AM
тАО03-19-2010 11:46 AM
Re: how to modify the root account (changing its home dir)
Use 'vipw' ... which is 'vi' wrapped with some lock protection for modifying the '/etc/password' file and some validity checking to make sure you do really mangle it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 11:49 AM
тАО03-19-2010 11:49 AM
Solutionmkdir /roothome
chmod 750 /roothome
chown root:sys /roothome
sudo vipw
Then edit the first line where the root user is listed and change :/: to :/roothome:
and save the result.
Now leave your current window open and start another window to login as root. If you can't login as root directly, you can probably use this:
sudo su - root
and that should login a new session. Then type pwd to verify your new $HOME directory. Now you can move all files in / to /roothome. Be sure to move (mv) the dot-files and dot-directories (/.profile, /.exrc, /.ssh, /Mail, etc) to /roothome. The / directory should only have directories, no files.
Now your system may have been compromised by unknowledgeable sysadmins or bad applications that stored files in /...you'll have to move those back as you discover them. Ideally you can get the error fixed so the application still works OK.
As all seasoned syadmins will tell you, / is never the right place for root's home, so /root or /roothome is a good choice.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2010 10:59 AM
тАО03-23-2010 10:59 AM