Unix/Linux Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Problems creating and accessing with user

HP-UX


Tags
solved

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-16-2017   -   Original Discussion by anaigini45
anaigini45's Unix or Linux Image
anaigini45 anaigini45 is offline
Registered User
 
Join Date: Oct 2009
Last Activity: 14 February 2018, 5:02 AM EST
Posts: 105
Thanks: 4
Thanked 0 Times in 0 Posts
Problems creating and accessing with user

Hi,

I have created the user 'mastersa' in several servers.
I need to change the user ID to '0'. However, after doing this, I am not able to login (Access denied).
Even after I change the password, I still get this error.
Why is this?

Also, when I attempt to delete the user account, I get the error :



Code:
# userdel -r mastersa
Login mastersa is currently in use
#

Whereas, the user is not even logged on anymore, as I logged the user out already :



Code:
# w
  5:18pm  up 135 days,  9:17,  1 user,  load average: 0.03, 0.03, 0.03
User     tty           login@  idle   JCPU   PCPU  what
emoaigin pts/0         5:16pm                      w
#

How do I resolve this error?
Sponsored Links
    #2  
Old Unix and Linux 08-16-2017   -   Original Discussion by anaigini45
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 20 February 2018, 9:54 AM EST
Location: NM
Posts: 11,304
Thanks: 586
Thanked 1,135 Times in 1,045 Posts
The user group zero is reserved for privileged accounts, namely root. And you have to be root to use the userdel command. That is the direct cause of the error, I think.

I'm not sure how to fix your problem. When you need special privileges for a user there are special tools like sudoer (sudo), which allows you to give good control over what the user can and cannot do. Do not fiddle around with reserved group numbers like that.
Sponsored Links
    #3  
Old Unix and Linux 08-16-2017   -   Original Discussion by anaigini45
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 20 February 2018, 2:37 AM EST
Location: Simplicity
Posts: 3,981
Thanks: 342
Thanked 1,337 Times in 1,206 Posts
There is UID 0 for root.
By adding a second UID 0 user you make it an alias for root.
Still it logs in with its separate password.
I don't know why the login fails. Look at error messages in /var/adm/syslog/syslog.log
How do you login? With ssh? Then, perhaps there is "PermitRootLogin no" in sshd_config, and sshd treats all UID 0 users accordingly.

Once logged in as the alias user, a "whoami" will say "root". Some odd things can happen.
So userdel fails because it sees that "root" has running processes.

Adding a second UID 0 account is no good practice.
A better way is sudo and an appropriate entry in sudoers file.


Code:
man sudo
man sudoers

    #4  
Old Unix and Linux 08-16-2017   -   Original Discussion by anaigini45
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 20 February 2018, 10:48 AM EST
Location: Aachen, Germany
Posts: 12,141
Thanks: 367
Thanked 3,739 Times in 3,436 Posts
I'm afraid the poster doesn't talk of group 0 but of UID 0 i.e. the root user! A bad idea ... can you post the relevant parts of the /etc/passwd file, confidential data obfuscated?
Sponsored Links
    #5  
Old Unix and Linux 08-16-2017   -   Original Discussion by anaigini45
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 20 February 2018, 9:11 AM EST
Location: Switzerland - GE
Posts: 6,521
Thanks: 301
Thanked 558 Times in 520 Posts
Was your idea because root can not log in in the first place? If so you discovered it is true for any account with UID 0... and so the is no error, just the normal behaviour of HP-UX...
2 possibles reasons : security mainly :
Not allow ssh with root account ( as mentionned ) - OR -
the presence of securetty file that allows root most commonly from a console...
That said you could have tried to su...
Sponsored Links
    #6  
Old Unix and Linux 08-17-2017   -   Original Discussion by anaigini45
anaigini45's Unix or Linux Image
anaigini45 anaigini45 is offline
Registered User
 
Join Date: Oct 2009
Last Activity: 14 February 2018, 5:02 AM EST
Posts: 105
Thanks: 4
Thanked 0 Times in 0 Posts
Hi,

I believe the problem lies in the sshd_config file.
I tested the steps I provided in my first post in a test server, and this problem did not happen.

When I compared the sshd_config file for both test and production, I found that in the test server, the parameter

Code:
"PermitRootLogin"

was

Code:
"Yes"

, whereas in production it was

Code:
"without-password"

.

And in production, I used a normal user account to login to the server, then su -mastersa, and I could login.

Regards,
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Creating Frequency of words from a file by accessing a corpus gimley Shell Programming and Scripting 7 07-24-2013 10:15 AM
[SSH] Accessing remote directory with user-passed path lgb3 Shell Programming and Scripting 2 10-19-2011 01:30 PM
Sabayon - KDE4.2 Problems accessing system management - all greyed out Tony_photoplus Linux 3 05-11-2009 02:15 PM
SUSE 9 - problems accessing CD ROM drive GandalfWhite SuSE 11 06-24-2004 12:43 PM



All times are GMT -4. The time now is 11:56 AM.