How to remove UNIX user and groups

I created UNIX groups - oinstall, dba and UNIX user - oracle for the installation of Oracle 10g. But I might did something incorrectly. Oracle user account didn't created properly. How to remove these UNIX groups and user so that I can start over again to create them properly. Thanks.

You can use the userdel command, or just fix what's wrong by editing /etc/passwd, /etc/shadow, and /etc/group. What's the problem you are having?

System Shock:

I created UNIX user (oracle) and groups (oinstall and dba). Then I created oracle base directory as /u01/app/oracle and /u01/oradata. Then I chown them to oracle:dba and chmod them as 755. Then I want to login as user oracle. I did su - oracle, system told me that No Directory! What is the problem here? Did I miss some steps or something wrong? I tried to delete user and group completely, then re-create them to make it work. Please advise. Thanks.

yes, you forgot to create/set home directory for the oracle user.

You can edit the appropriate field in /etc/passwd to correct this.

I wanted to login as oracle user to set up oracle home directory. Now I even can not login as oracle user. Can I set home directory for oracle user as root user? How to do it? could you tell me more? Thanks.

Check in /etc/passwd if oracle has a defined home directory. If not, you can either use usermod to give it a home directory, or edit /etc/passwd. If, say, you made /u01/app/oracle the oracle home directory, then you should see an entry in /etc/passwd like:

oracle:x:9999:100::/u01/app/oracle:/usr/bin/ksh

If you use the usermod command, the following should do it

usermod -d  /u01/app/oracle oracle 

System Shock:

Thanks so much. You are guru. I followed your instruction to make oracle home diretory right. Now I can login as oracle user to do next step. Thanks and Happy Holiday to you and others in this forum.

Thanks for the compliment, but there are many much smarter and more knowledgeable people in this forum than me.