LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with useradd (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-useradd-923650/)

venom4u31 01-13-2012 02:11 PM

Problem with useradd
 
Hi there! I have an issue with useradd. If I type
Code:

useradd -m -d /home/test/ -u 2012 test
and I log in as the respective user (su test), it seems that the PS1 variable is empty (it shows only $) and the arrow keys don't work as they should. They type ^[[A, ^[[B, ^[[C or ^[[D. Can you please tell me how to fix the problem and make the respective user behave normally, as if it would have been created by the adduser command?

T3RM1NVT0R 01-13-2012 02:22 PM

@ Reply
 
Hi venom4u31,

Which distribution you are using. The reason I am asking because useradd command works in a different way for different distributions. For example: In RHEL useradd <username> will create the user account as well as home dir where as if you run the same command on SLES it will create the user account but not the home directory.

So if you could let us know which distribution you are using then we can suggest you on tweaking useradd command.

Another thing that you said that only $ is showing up when you login using this user. It appears that the default files are not being copied under home directory.

venom4u31 01-13-2012 02:34 PM

Quote:

Originally Posted by T3RM1NVT0R (Post 4573869)
Hi venom4u31,

Which distribution you are using. The reason I am asking because useradd command works in a different way for different distributions. For example: In RHEL useradd <username> will create the user account as well as home dir where as if you run the same command on SLES it will create the user account but not the home directory.

So if you could let us know which distribution you are using then we can suggest you on tweaking useradd command.

Another thing that you said that only $ is showing up when you login using this user. It appears that the default files are not being copied under home directory.

Actually the problem was in the shell the user was using. The default was sh and I had to either include the -s /bin/bash parameter in useradd or change the $SHELL value from the file /etc/default/useradd to /bin/bash.

T3RM1NVT0R 01-13-2012 02:37 PM

@ Reply
 
Good to hear that you got it sorted. Enjoy linux!!!


All times are GMT -5. The time now is 05:50 PM.