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.
usually home directory of user is /home/username.When I type # cd /home and long list the file,I see all the users. But here happens two case
1. lets say user tom, I types # id tom, its shows the tom information(UID,GID etc). But I can't see the tom in /home directory. I even tried # grep tom /etc/passwd, no information available. what to do?
2. I created a user with # useradd -M <user-name>. user is created but this user is not present under /home. How would I set/make home directory for this user as /home and that I can see this user.
Thank you.
Last edited by linuxmantra; 04-21-2014 at 10:34 PM.
-M
Do not create the user's home directory, even if the system wide setting from /etc/login.defs (CREATE_HOME) is set to yes.
Indeed, command you're looking for is '-m', not '-M'. Capitalization is important in pretty much every computer system out there, 'm' and 'M' and completely different characters.
-m, --create-home
Create the user's home directory if it does not exist. The files
and directories contained in the skeleton directory (which can be
defined with the -k option) will be copied to the home directory.
By default, if this option is not specified and CREATE_HOME is not
enabled, no home directories are created.
-M
Do no create the user's home directory, even if the system wide
setting from /etc/login.defs (CREATE_HOME) is set to yes.
This can also happen when using things like NIS or LDAP to hold login information. The login data exists, but the account on the specific system doesn't.
This can also happen when using things like NIS or LDAP to hold login information. The login data exists, but the account on the specific system doesn't.
Yes you are right. If the user is under IdM ( Identity Management) then user information (#id <user name>) can be seen but can't be seen in /home directory which is the defautl home directory. In order to see the user in /home directory, we need to do
#cp -rp /etc/skel/ <user-name>
The user will be seen in /home directory. And this was the reason why I earlier did not see the user in /home directory. So, in IdM user can be granted read only access which I camed to know while working in this issue with the team in my office.
Indeed, command you're looking for is '-m', not '-M'. Capitalization is important in pretty much every computer system out there, 'm' and 'M' and completely different characters.
I can create user with -M option (-M does not create home directory) as #useradd -M <user name> , proble with doing this is, this user can't be seen in /home directory. In order to see the user in /home directory we need to do
#cp -rp /etc/skel/ <user name>
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.