Hi all
I have to move a “root” user into a normal user, without loss its configuration. Assuming “gino” as the new user, is it safe to make the following steps?
cp -pr /root/* /home/gino
chown -R gino /home/gino
ciao
rob
Hi all
I have to move a “root” user into a normal user, without loss its configuration. Assuming “gino” as the new user, is it safe to make the following steps?
cp -pr /root/* /home/gino
chown -R gino /home/gino
ciao
rob
What you are doing with the cp commands is copying files (and directories), not ‘moving a user root’. There is but one user root and it has to stay in the system and it is best to leave its home directory as /root/.
When you want to copy the files residing in /root/ to /home/gino/, that is OK, but to make *gino *the real owner you also have to change the group of the files. In most of the systems the group ‘normal’ users belong to is *users. *So change the chown to
chown -R gino:users /home/gino
This will be ‘save’ in the sense that as long as you do not delete/remove anything in /root/ no harm can be done.
It is not save when there are any files/directories in /home/gino/ at the moment, that you do not want to be overwritten. But I suppose /home/gino/ is empty now, or at least does not contain any files of importance.
Yes, the meaning of my question was “cloning” old root configuration, in order to use that with a normal user and dismiss using root for every-day operations.
Thanks for your suggestions Henk.
ciao
rob
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
That command assumes /home/gino already exists, and you could also set
the group at the same time substituting the second command with:
chown -R gino:users /home/gino
Good luck.
robermann79 wrote:
> Hi all
> I have to move a “root” user into a normal user, without loss its
> configuration. Assuming “gino” as the new user, is it safe to make the
> following steps?
>
>
> Code:
> --------------------
>
> cp -pr /root/* /home/gino
> chown -R gino /home/gino
>
> --------------------
>
>
> ciao
> rob
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJYgzF3s42bA80+9kRAmmpAJ9PtP9XdmbpsGIzZNGAgDmBOfAb3gCeMVeS
J4l9l9Ina0RYbLhqboCCIns=
=t2AQ
-----END PGP SIGNATURE-----
Your wildcard will not get any dotfiles in /root. If you want those also, you should do (notice the dot after the /):
cp -a /root/. /home/gino
chown -R gino:users /home/gino
Thanks for your suggestions. I used the following commands with also the cp -r flag (recursive).
cp -ar /root/. /home/gino
chown -R gino:users /home/gino
All worked fine
a implies r, so r was redundant. Can’t be too careful though.