LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-22-2015, 03:55 PM   #1
mikenash
Member
 
Registered: Dec 2014
Posts: 84

Rep: Reputation: Disabled
useradd - user is different between red hat and suse


I execute the following command on Red Hat Enterprise 7.1 and Suse Enterprise 12 and I receive different results.
useradd -m -d /home/Sam -k /etc/skel -g root -r -o -u 0 -s /bin/bash Sam
When issue whoami on Suse the output is Sam but on Red Hat the output is root!
Why is it not Sam?
 
Old 10-22-2015, 05:39 PM   #2
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
It may be that you do not have the group root on the rhel system

You also specified uid 0 whih may cause an issue

Last edited by ericson007; 10-22-2015 at 05:53 PM.
 
Old 10-22-2015, 06:54 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You just created a duplicate of the root acct!!! DON'T do that - seriously.
If you have a user that needs root access either give them the root passwd or add them into sudoers.
 
Old 10-26-2015, 09:43 AM   #4
mikenash
Member
 
Registered: Dec 2014
Posts: 84

Original Poster
Rep: Reputation: Disabled
I issued the command groups against both user ids on both systems and the results are the same. There is a group root and both user ids are in the group root. The same useradd command was issued on both systems. However, on Red Hat 7.1 I am logged in as root. Interesting and still investigating on the different results. Any explanation or suggestions?
 
Old 10-26-2015, 09:48 AM   #5
mikenash
Member
 
Registered: Dec 2014
Posts: 84

Original Poster
Rep: Reputation: Disabled
I did investigate the -u 0 option which should be allowed with the -o option that allows for this.
-o, --non-unique
Allow the creation of a user account with a duplicate (non-unique) UID.
 
Old 10-26-2015, 09:18 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
also rhel and suse use different starting places for the root id
500 VS. 1000


and DO NOT try to make a second root account under a different name

use "sudo "


i would bet that SELinux on rhel will through a temper tantrum if you do
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Deleting User in Red Hat Linux ashali19 Red Hat 16 09-13-2012 10:51 AM
LXer: Red Vs. Green: SUSE Backs OpenStack, Red Hat Stands Alone LXer Syndicated Linux News 0 10-27-2011 07:20 AM
Red Hat 6 :Where can I find the source code of "useradd" redrat Linux - Software 3 09-08-2011 04:09 PM
how to create sftp user only in red hat 4 not ftp user ..only sftp user princeu28 Linux - Newbie 1 10-14-2008 08:10 AM
User manuals for Red Hat 8 funkenbooty Linux - Newbie 3 07-23-2003 09:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration