0

I tried to type in 'exit' and tried cntrl+d too but they both just close the terminal. Why is this? Is there another way to move away from root user?

6
  • 2
    It sounds like you're asking How to change default user in WSL Ubuntu bash on Windows 10 Commented Aug 30, 2020 at 21:55
  • That is indeed the same question, But if I type in this: 'ubuntu2004 config --default-user <username>' I get this returned: 'ubuntu2004: command not found' Commented Aug 30, 2020 at 22:02
  • Are you typing it in the Ubuntu terminal? You need to type it in a Windows cmd.exe or PowerShell window Commented Aug 30, 2020 at 22:15
  • Yes I was typing it in the ubuntu terminal. Now I typed it in cmd.exe and PowerShell window where I receive in both cases: /usr/bin/id: ‘younes’: no such user Commented Aug 30, 2020 at 22:26
  • 1
    Hi, I think I solved the problem by using useradd. After that I changed from root user to the other non root user by the following command: su - <username>. Feel free to share your thoughts about this approach. Anyway, thanks for your time! Commented Aug 31, 2020 at 16:42

1 Answer 1

0

You can alway switch users with su. simply use

su <username> 
3
  • I see why it wasn't possible. I only have one account, which is the administrator account. Is this harmful/risky? Commented Aug 30, 2020 at 21:53
  • root and admin are NOT the same. always using root is however indeed not recommended since you might accidentialy break or change something, that you are not supposed to. if you need root privileges temporarily you should use sudo Commented Aug 30, 2020 at 21:56
  • if your username is something other than root, then it is not root but propably admin (capable of sudo and such but not everything) Commented Aug 30, 2020 at 21:58

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.