3

How to disable any option people could login into a local WSL Ubuntu (say, with SSH)? What steps should be taken right after the WSL instillation?

  • I need that I myself should be able to login outwards with OpenSSH.
  • There are no webservers or databases on the local WSL.

I believe asking this question is 99% like asking it on regular Ubuntu, but I'm not sure, and hence I ask.

3
  • Do you have concerns about people logging in to your WSL account Windows? (no password prompt for the user, which runs as root by default) I think this might be an equally important concern.
    – Joshua K
    Dec 7, 2018 at 16:34
  • 1
    @JoshuaK thank you for replying. I think whatever user one uses, the very same concern is there - I updated the question to explain what I'm trying to do --- in what context I try to protect Ansible. I now also offer bounty, please re read the updated question.
    – user423047
    Dec 13, 2018 at 23:03
  • @JohnDea Jajuke's answer will take care of the SSH concern, however i have not found a way to prevent someone with access to the logged in Windows user (physical access to terminal) from accessing WSL/shell prompt. I assume you have already changed the default user and set a password, but it still doesn't prompt separately for the password when opening bash, only when executing commands using sudo. I'm interested in a solution though. I've considered changing the shortcut properties so that it runs as admin which would prompt, but it would only address the shortcut.
    – Joshua K
    Dec 14, 2018 at 15:33

1 Answer 1

3

Lets rephrase what you want:

  • Disable ssh server (others can't connect to your machine)
  • Enable ssh client (you can connect to other machines)

In fact, the easiest thing is to install openssh-client and remove openssh-server package:

apt-get install openssh-client
apt-get remove openssh-server

If you want something different, please clarify.

0

You must log in to answer this question.