Solaris / OpenSolarisThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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....
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855
Rep:
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.