Linux - NewbieThis 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
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.
Because of the fact that you've already deleted the user before, without deleting his home directory, now there's no association between that user and that home directory, because the user simply doesn't exist. Therefore, the home directory has become a normal folder. If you don't associate it with another user, for instance by creating a new user and pointing to that home directory (useradd user -d /home/student), then your only choice is to simply delete that directory with rm -rf /home/student.
On the other hand, if you haven't deleted any users and you think that the user associated with /home/student might still exist in your system, you can check /etc/passwd:
Code:
cat /etc/passwd | grep student
If no output is displayed, then it means that no user is associated with that home directory.
I would also suggest looking at the users home directory (ls -ld /home/name), just in case the directory has been given to a different user. If only the UID shows in the ownership, then there is no user id association.
This is because just looking at the /etc/passwd file may not be sufficient - the user may be in LDAP/NIS or other naming system - which would still be a valid user, just not listed in the /etc/passwd file.
If this is a local user and you want to delete user along with his / her home directory then you should user the command:
Code:
userdel -r <username>
If you don't like to -r switch then you can create an alias for userdel to be run as userdel -r. Remember once you created the alias it will userdel will work as userdel -r so if sometime you don't want to delete the user's home directory and just the user, either you remove the alias or move home directory somewhere else before running that command.
Since it is showing uid instead of the username I would say the directory went orphaned (not sure if it is the right term) and system allotted UID of the user which use to own then directory.
I doubt that it was an LDAP user but still to confirm you can run:
I got a new problem,when i logged in as a root it should be # sign but its gonna showing me regular user sign. You guys have any idea whats wrong with my system?
Ok,Guys i got my problem solution when i tried to remove the user from home directory its said "userdel: user 'username' does not exist
" when i used useradd command its said
"useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
Creating mailbox file: File exists" Finally i used this command "sudo rm -rf /home/username" and its deleted.
Ok,Guys i got my problem solution when i tried to remove the user from home directory its said "userdel: user 'username' does not exist
" when i used useradd command its said
"useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
Creating mailbox file: File exists" Finally i used this command "sudo rm -rf /home/username" and its deleted.
We're all happy you haven't read any of our posts. You're welcome.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.