LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   $ Prompt for new user account (https://www.linuxquestions.org/questions/linux-newbie-8/%24-prompt-for-new-user-account-902773/)

larrry 09-13-2011 08:08 AM

$ Prompt for new user account
 
I've created a new user account, but when logging in with that account, only the $-Prompt is seen. I'd like the user to see <newuser>@<hostname>:/<directory>$.

I've copied all files from /etc/skel to /home/<newuser> and made sure that .bashrc is identical to other users. Permissions to files and home directory are also in accordance with <newuser>.

What have I missed?

Thanks for your help!

rahulchandrak 09-13-2011 08:17 AM

Hi,would you please tell me the procedure you followed to create the account, a user can be created in 3 ways

1) using the "useradd" command
2) using the "adduser" command
3) From GUI.

Let us know the linux flavour you are using, it will be more helpful.

MTK358 09-13-2011 10:36 AM

Try adding:

Code:

PS1='\u@\h:\w\$ '
to your .bashrc.

lystor 09-13-2011 01:17 PM

Quote:

Originally Posted by larrry (Post 4470558)
I've created a new user account, but when logging in with that account, only the $-Prompt is seen. I'd like the user to see <newuser>@<hostname>:/<directory>$.

Hi
Check a command shell on /etc/passwd:
Code:

lystor:x:520:520::/home/lystor:/bin/bash
Line must be terminated by /bin/bash for bash.

larrry 09-14-2011 12:20 AM

thanks for your responses!

it's debian.
the PS1 is in .bashrc which I copied from /etc/skel and checked against another working user's.
I used useradd.

thanks again.

chrism01 09-14-2011 12:52 AM

Have you checked .bash_profile ?

larrry 09-14-2011 05:13 AM

haven't got a .bashprofile. it's using only /etc/profile, then .bashrc .

thanks for your input.

samtoddler 09-14-2011 05:35 AM

$ Prompt for new user account
 
Hi,

You can retry adding users( if it is not production server) using the following command

useradd -d <specify the home directory> -m <username> -s <shell>

where -m create the home directory if not exists and copy the structure for the user.
-s specify the shell (like /bin/bash)

if you just want to give it a fancy look you can try setting the PS1 variable.


regards
samtoddler


All times are GMT -5. The time now is 02:40 AM.