1

I'm using Ubuntu 22.04.1 LTS. I created the user "dom" when I first set up Ubuntu. From then, I created another user, named "schule" that also had sudo rights. Here is how I created the account:

sudo useradd -m schule 
sudo su
usermod -aG sudo schule

The terminal on schule is extremely weird:

  • it doesn't show the directory you're in
  • it doesn't show username@computername
  • when you paste commands they instantly execute (except sudo commands)
  • if you try to use ARROW_UP to get your last command back, it instead puts ^[[A in the console.
  • if you try to use ARROW_DOWN to go down in your command history, it instead puts ^[[B in the console
  • it is just a blank $ and then nothing afterwards

Tried some stuff, including resetting the .bashrc file, or copying the contents of dom's bashrc into schule's bashrc but nothing worked. Here is how it looks when you try to type a command, and then use arrow up: enter image description here

I even tried creating another user, named "test" but the terminal also acts weird on there. The terminal is completely fine on dom. Does anybody know how to fix this?

User1986
  • 371

2 Answers2

0

The default shell given to a new user is sh not bash which is the default shell on Ubuntu ... I would delete the user and recreate using

sudo deluser --remove-home  schule  #  delete user

sudo useradd -m -s /bin/bash schule # create user and give bash

New user will have a file ~/.bashrc .... to give a nice terminal prompt which shows the current dir add following to the bottom of the user's ~/.bashrc file

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \$ '
0

useradd is only for basic usage, so I'd suggest you are using adduser instead.

First delete your new user (the one you tested) with

deluser --remove-home schule 

Notice: Use this command with care. Deleting your main user (dom) is not a good idea.

Then try to create a user with its own home directory:

adduser -m -G sudo,adm,cdrom,video,lpadmin,dip,plugdev,sambashare schule

(you might not have all those groups, but those above I usually need to have a fullblown admin account)

log out and into the "schule" account.

kanehekili
  • 7,426