Page 2 of 3

Re: root user.

Posted: 2019/11/09 12:22:51
by lightman47
Apologies - I'd never considered anyone would ever do that.

Re: root user.

Posted: 2019/11/09 12:40:33
by hack3rcon
lightman47 wrote:
2019/11/09 12:22:51
Apologies - I'd never considered anyone would ever do that.
Another user configured this server and I want to know why this happening.

Re: root user.

Posted: 2019/11/09 13:32:03
by tunk
Please carefully reread jlehtone's post.

Re: root user.

Posted: 2019/11/09 13:32:22
by TrevorH
Because they did it wrong. You should never add another user with a duplicate uid - you have two of them that are uid==0 which is root. One of your root users is called 'testuser'.

Do not do this. Set up a normal user and configure sudo to allow its access to the things it actually needs to do.

Re: root user.

Posted: 2019/11/09 16:14:22
by hack3rcon
TrevorH wrote:
2019/11/09 13:32:22
Because they did it wrong. You should never add another user with a duplicate uid - you have two of them that are uid==0 which is root. One of your root users is called 'testuser'.

Do not do this. Set up a normal user and configure sudo to allow its access to the things it actually needs to do.
Thanks.
How can I convert "testuser" to the normal?

Re: root user.

Posted: 2019/11/09 16:35:33
by tunk
Don't know if it's recommended, but you could remove "testuser"
from /etc/passwd+shadow and then create a new user.
Edit: Also look at the userdel command (NB: do not use the "-r"
option).

Wonder how many other questionable "surprises" are left in your
system: You may be better off with a complete reinstall. If so,
use CentOS 7 or 8, as 6 only has one year support left.

Re: root user.

Posted: 2019/11/09 17:42:07
by lightman47
So - testuser was logging in and had no restrictions, and everything "he" did got logged as root? (I don't know but it seems that way to me) - I'd be clean installing, as tunk suggests, if it were a machine for which I was responsible.

Re: root user.

Posted: 2019/11/09 18:28:24
by TrevorH
He had it set up with two users with the same iud so they are the same user by different names.

Re: root user.

Posted: 2019/11/09 19:03:53
by lightman47
bends the brain as to how that might have worked; I'll need to think more about this. I always just 'accepted' the group and passwd files without actually knowing their actual use/purpose(s).

And, testuser in this case was 500 (initial user during install back then) in 'group', but 0:0 in 'passwd'. Clearly, I need to lookup/study.

Re: root user.

Posted: 2019/11/10 06:18:48
by hack3rcon
I can't do a clean installation. It is a web server.
I'm afraid to use "deluser" command because the user act as root and...