1

When opening my terminal (Ubuntu16.04) I am logged in as root. Everytime I have to type this command 'su - ' to log in as non-root user. So I already made a non-root user but how do I set this non-root user as default? Thanks in advance

  • How did you set up your system to act this way in the first place? Reverse that. What you describe is not a default behaviour of an Ubuntu system. What is more: the root account is disabled by default. Check your .bashrc file to see what is happening when a terminal is opened. – vanadium Sep 27 '20 at 11:09
  • I made my non-root user using the command "adduser". If I change from root to non-root I don't have to type in a password. I do have to type in a password when going to root from non-root user. I can't find anything particular in the .bashrc file. Where do I have to look specifically within the .bashrc file? – Younes Boubker Sep 27 '20 at 13:54
  • How did you manage to have the root account in the first place? This is not how Ubuntu works by default. su - does not proceed on a standard Ubuntu install. Are you graphically also logging in the root account? – vanadium Sep 28 '20 at 16:00
  • I don't know how I managed to have the root user, but it was there from the beginning I think. It's quite some time ago that I installed Ubuntu. I only use the GUI for text editors, plotting and CFD simulations. – Younes Boubker Oct 01 '20 at 15:28
  • You tell that su - logs you in as a non-root user? su -, on systems that enable the root account, switches one to root, so please also check that statement in your question and eventually correct it. How do you know/recognize you are suddenly in a root account when you merely open the terminal? – vanadium Oct 01 '20 at 19:21
  • Actually, that's exaclty what I meant. When opening the terminal I recognize I'm in the root account because it shows the following before typing in any command: root@DESKTOP-68URG92: – Younes Boubker Oct 02 '20 at 14:33
  • That could only happen if you are logged in in the graphical environment as user "root". That a colon is displayed after the command suggests indeed that you may be logging in as a user with login name "root". A prompt with elevated privileges ends with "#" in Ubuntu (and Debian, I suspect). You probably should just create a fresh account with toot privileges for yourself to solve the issue. – vanadium Oct 03 '20 at 09:06
  • I think you will find this interesting. https://askubuntu.com/questions/816732/how-to-change-default-user-in-wsl-ubuntu-bash-on-windows-10 – Gabriel Nieto Apr 15 '22 at 01:16

0 Answers0