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
  • 321
  • What do you exactly mean by "clone the Dom" account? Did you use the system tools or did you manually copy files? And how did you create the Dom account, which is as per your post a root account? Ubuntu has no root account by default. Did you tweak the system to get a true root account? If so: how? – noisefloor Feb 04 '23 at 10:19
  • try sudo apt purge gnome-terminal and then sudo apt install gnome-terminal to reset the gnome-terminal. – Rishon_JR Feb 04 '23 at 10:45
  • @noisefloor I overhauled the question, it should be much clearer now – User1986 Feb 04 '23 at 13:02

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\] \$ '
  • Please warn the OP and future readers of permanent data loss in the deleted user's home directory. – Raffa Feb 04 '23 at 13:36
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
  • 6,402
  • Please warn the OP and future readers of permanent data loss in the deleted user's home directory. – Raffa Feb 04 '23 at 13:36
  • It's pretty clear that the data gets lost if the command is literally named "DELETE USER" – User1986 Feb 04 '23 at 15:21
  • @User1986 Not necessarily if the option --remove-home isn’t passed … Alternatively the option --backup can be added to automatically backup data before deletion … It’s a fact that some readers focus on solving the problem in the question and copy/paste commands to later discover their valuable data disappeared forever … This site is accessible to beginner Ubuntu users as well hence the need for a fair warning :-) – Raffa Feb 04 '23 at 17:05
  • As the OP seems to be German-speaking (at least that's what I'm guessing from some of the sames), you may also want to read https://wiki.ubuntuusers.de/adduser/. The 2nd paragraph has some additional info on adduser vs. useradd ob Ubuntu. – noisefloor Feb 04 '23 at 17:14
  • @Raffa He was supposed to delete the faulty user "schule", not his main user. Still good advice, updated my answer – kanehekili Feb 04 '23 at 23:39