LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 07-10-2012, 11:17 AM   #1
nap-ster
LQ Newbie
 
Registered: Jun 2012
Posts: 11

Rep: Reputation: Disabled
Arrow unable to delete user...


hi.....
i have created users in solaris, now i am unable to delete those users i have used command "userdel username" but it shows cannot delete user,, it is in use,, cant understand where these users are in use.... and plz tell me how to stop users....
 
Old 07-10-2012, 11:44 AM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
User has some processes running under their name. Do a ps auxww | grep username and kill those processes.

---------- Post added 07-10-12 at 09:44 AM ----------

Could also be open files, also do an lsof | grep username
 
Old 07-10-2012, 01:57 PM   #3
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
All the user login info is in /etc/passwd and /etc/shadow/. If these are the users you created then you can delete the users from there (Be sure that you have a backup of these files just in case ...). After that you can simply go to /home and remove the home folders.
Since the advice contains some steps that can be problematic make sure that you know what you are doing.
According to the man page of userdel (Linux ofcourse) it is possible to delete users even if the user is logged in. You simoly have to execute 'userdel -f username'
Hope this helps some.
 
Old 07-10-2012, 02:10 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
The -f will work but it will miss part of its removal. This is usually caused by a running process under the user or having an open file in the home directory of the user. The best practice would be to identify this and either kill the process or remove the file lock, then remove the user via the proper method.
 
Old 07-10-2012, 03:11 PM   #5
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
The -f option removes home directory so make sure that is what you want. Check for user processes and kill any that belong to the user.

Solaris and Linux handle things differently with users, for example if I log in and then want to change my username via the usermod command in Solaris after su'ing to root I will get an error and in Linux it will change it while I'm logged in.

Last edited by Blinker_Fluid; 07-10-2012 at 03:13 PM.
 
  


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
How can I trace user's web surfing & delete large mail sent by the user by? mostafaashish Linux - Networking 4 08-07-2009 08:43 AM
Unable to delete folder arctuniol Red Hat 2 10-11-2004 02:07 PM
Unable to delete trash entropyv Mandriva 1 09-26-2004 11:29 AM
Unable to logon on as non-root user after update as unable to set executable context pls198 Fedora 2 04-09-2004 11:41 AM
I am unable to delete my post MOZ LQ Suggestions & Feedback 1 01-19-2002 04:26 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 07:34 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