LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-13-2012, 03:11 PM   #1
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Rep: Reputation: Disabled
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?
 
Old 01-13-2012, 03:22 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ 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.
 
Old 01-13-2012, 03:34 PM   #3
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by T3RM1NVT0R View Post
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.
 
Old 01-13-2012, 03:37 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ Reply

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
useradd problem mbanwi Linux - Newbie 5 08-03-2009 10:24 AM
useradd problem trebek Debian 8 04-15-2008 06:52 AM
useradd problem john83reuben Linux - Newbie 15 02-22-2008 12:17 AM
useradd -p problem john83reuben Linux - Security 3 02-21-2008 07:35 AM
Useradd - Cannot locate /etc/default/useradd in Solaris Paean Solaris / OpenSolaris 4 12-09-2005 02:36 AM


All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration