Change root user's home directory in Ubuntu?
Title says it all, how do I change the home directory of the 'root' user in Ubuntu 12.04?
Solution 1:
Here are the instructions, but be sure to know what you're doing.
On every *nix system you'll find a file called /etc/passwd
which lists all users and some settings. Here is the syntax of that file:
username:password:uid:gid:additional_info:home:shell
So, for example, you'll find:
root:x:0:0::/root:/bin/bash
Which means the user is called root, the password is hidden (it's on /etc/shadow
), uid is 0
, gid is 0
, no additional info, the home directory is /root
and the default shell is /bin/bash
.
Edit that file (I recommend vipw
to avoid corruption) and change the home directory.
However, I don't see any reason to do it.