1

I have been experimenting with WSL Ubuntu terminal and I notice that w and who commands don't display any user, apparently I'm not logged but if I assure typing whoami and id actually display my user and ID

I lost my mind, Can I use bash without be logged? How can be possible? and if am not logged, How could the terminal know that's me?

1 Answer 1

4

When you invoke a Linux distribution in WSL1 or WSL2, you are automatically logged in as the default user you created when you installed the distribution. You can verify this with the id command.

That commands such as w, who, logname and users return no useful information is a known "feature" of WSL1 and WSL2. Why? Because by default, no /var/run/utmp is created.

See https://github.com/microsoft/WSL/issues/573 for full details and a workaround.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .