0

Am looking to add an alias for the root user to log to the server with a different password

So I followed this advice https://serverfault.com/a/870301/429729

by using the following command

useradd -o -u 0 -g 0 -N -d /root/ -M root2 

it works but when I logged in as root, all root owner permeation become root2 in the server.

lrwxrwxrwx   1 root2 root              8 Aug 21  2019 sbin -> usr/sbin

Please kindly how can I correct this to get back the correct permeation as root root?

Thank you for your time.

1 Answers1

0

Well after searching i found the following

The 'root2' user is actually not a different user, it is just the root user with a different username. You cannot use the userdel command to remove it, as it can cause further issues. You will instead need to use the 'vipw' and 'vipw -s' commands to remove the 'root2' entries from the passwd and shadow files.

I just run those two commands.

[root@10-2-71-113 ~]# ls -lahtr
total 8.0K
dr-xr-xr-x. 18 root2 root 4.0K Aug  8 14:08 ..
drwx------   3 root2 root   23 Aug  8 14:09 .cpanel
drwxr-xr-x   3 root2 root   42 Aug  8 14:09 .
-rw-------   1 root2 root  340 Aug  8 14:09 .bash_history

[root@10-2-71-113 ~]# vipw
You have modified /etc/passwd.
You may need to modify /etc/shadow for consistency.
Please use the command 'vipw -s' to do so.

[root@10-2-71-113 ~]# vipw -s
You have modified /etc/shadow.
You may need to modify /etc/passwd for consistency.
Please use the command 'vipw' to do so.

[root@10-2-71-113 ~]# ls -lahtr /root
total 8.0K
dr-xr-xr-x. 18 root root 4.0K Aug  8 14:08 ..
drwx------   3 root root   23 Aug  8 14:09 .cpanel
-rw-------   1 root root  340 Aug  8 14:09 .bash_history
drwx------   3 root root   20 Aug  8 14:10 .config
drwxr-xr-x   4 root root   57 Aug  8 14:10 .