Ubuntu new user login but username@ does not exist

I have installed ubuntu 19 on my virtual server and connected root user. Console appears like following:

root@localhost:~# 

And I created a new user useradd -m newuser

Added newuser to sudo group.

When I login with newuser, console appears only:

$: 

But, should it be like following?

newuser@localhost:~# 
1

2 Answers

did you set the shell to /bin/bash or it is currently /bin/sh ? Check /etc/passwd either via less /etc/passwd or:

grep yourusername /etc/passwd 

Or to change the User's shell do (via root):

chsh --shell /bin/bash username 

and relogin with that user.

4

I would like to respond to the question "why does not it automatically change when user created?"

You are using 'useradd', which works with the skeleton file /etc/default/useradd There should be a variable in there 'SHELL', which is the default shell that will be set when creating a new user with useradd.

You could also consider using the more user friendly 'adduser' instead of 'useradd'. Which uses /etc/adduser.conf as defaults.

Source:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like