Results 1 to 7 of 7

Thread: Home Directory for the users using useradd

  1. #1
    Join Date
    Nov 2010
    Posts
    36

    Home Directory for the users using useradd

    Why I can not get the Home Directory for the users that I have created. Well for creating the users I have used the useradd command and the thing is that is the only command that I am aware of that is going to work here. Well there is no problem at all in creating the user I have created the users and in addition to that I can even see change the password of them. But the only issue with it is that when I try to add the user, it simply fails to add the Home Directory for the same. When I try to add the user using the command $useradd username I can see that the user is added but with the following output: useradd: cannot create home directory/home/username. I really do not know what the problem here is. Any help in the same matter will be really appreciated. Please do come up with some useful solutions. Hope to see the response soon.

  2. #2
    Join Date
    Nov 2009
    Posts
    758

    Re: Home Directory for the users using useradd

    Well I think that this problem is occurring because you are running out of the space. I would suggest you to see for the space. I would suggest you to check for the space on the system and see if you have the required amount of space. Just type the following command to see if there is space at all or not. Type the following command: df –h usually the h is placed so that it can be made human readable. Well in addition to that I have one more command for you that can help you check the disk space for directories and that is du. du-h will help you see the size of all the directories including the sub directories. In addition to that if at all you want to know the size of the current directory then you can type du-sh. Well see if what I am saying is the problem that you are facing at the moment. If at all space is the problem then releases some space so that you can have the proper thing for you. Please let me know about the same.

  3. #3
    Join Date
    Nov 2009
    Posts
    1,416

    Re: Home Directory for the users using useradd

    I am probably of the opinion that you are missing on some of the vital things and I think that you will have to look for it on your own. Well I can see that you have not used the useradd -m username you have simply used the useradd username. The –m factor is missing and I think that it is the key for the issue that you are getting at the moment. If you are going to use the useradd alone then you will not be able to get the thing that you want. The –m factor will help make the new directory for all the other users. Also in addition to that I would suggest you to add -k so that the files from the skeleton can be added to the directory. Well try to do this and let me know if I am correct with this.

  4. #4
    Join Date
    Nov 2009
    Posts
    687

    Re: Home Directory for the users using useradd

    Well doing the things using the useradd is altogether nice but in addition to that I would like you to try some other command. Well as an alternative to the useradd I think you can try the adduser. It also does the same sort of thing but one never knows if the alternative can bring the change in the scenario. Well if at all you want to use the adduser command then you will have to create a new user with a different name or you will be required to delete the original user and then proceed with the procedure. In order to delete the original user you can use the userdel command. Well in addition to that I would also suggest you to use try making the home directory manually for that you will have to use the following lines: useradd -d /home/user1 user1. Well let me know if that worked at all.

  5. #5
    Join Date
    Nov 2009
    Posts
    1,292

    Re: Home Directory for the users using useradd

    Well looking at the problem of yours closely I have brought some thing really useful for you. I am sure that the following commands will help you in creating the home directory for your users that you have created. Just give it a try:
    Code:
    #groupadd youruser
    #useradd -g youruser -s /bin/bash -m -k /dev/null youruser
    The above commands will create the home directory for the users and in addition to that will set the default shell to bash. Once all the above things are over successfully then I will suggest you to point the skeleton to /dev/null and then set the same id for the userid and groupid. Or if you want you can use the simple code #adduser youruser. I am of the opinion that this time you will get through the problem of yours.

  6. #6
    Join Date
    Nov 2010
    Posts
    36

    Re: Home Directory for the users using useradd

    Thanks for all the replies, well I tried to see for the space but I do not think that there is anything that is to do with the space. Well I tried the commands and I have found that there is ample amount of space there and hence I do not think that there is any issue with the same. In addition to that I would just love to know how I can use the adduser command. Well I really think that the useradd is not the command that is fitting my criteria and I think that it will be wise to switch to the alternative. Well can anyone else help me with the same? Any help with this one will be really appreciated. Well for all the other solutions I will try them and see if any of them helped me in any other manner. Will post soon.

  7. #7
    Join Date
    Nov 2009
    Posts
    1,269

    Re: Home Directory for the users using useradd

    Well I think that you will have to start with the basics. Well useradd or adduser is the command that is used to create a new user or update default new user information. The syntax for the useradd is as follows:
    Code:
    useradd [-c comment] [-d home_dir]
    and
    Code:
    useradd -D [-g default_group] [-b default_home]
    . When the useradd command is brought into play without the -D option, then it produces a new user account by making use of the values that are mentioned on the command line and the default values from the system. Also the home directory will be formed, and preliminary files will be copied, depending on the command line options. I would suggest you to see if you have given the options clearly.

Similar Threads

  1. Auditing users on Active Directory server
    By poke147 in forum Active Directory
    Replies: 3
    Last Post: 09-09-2014, 05:19 PM
  2. Active Directory Users missing attribute
    By tim.creemers in forum Active Directory
    Replies: 4
    Last Post: 27-03-2012, 04:42 PM
  3. useradd: cannot create directory
    By MobiNuX in forum Operating Systems
    Replies: 2
    Last Post: 30-07-2009, 10:51 PM
  4. Move Users directory to another drive.
    By Robert McMillan in forum Vista Help
    Replies: 2
    Last Post: 29-07-2008, 08:51 PM
  5. Replies: 3
    Last Post: 05-06-2007, 06:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,045,386.08998 seconds with 16 queries