Enabling SSH server in NixOS and connecting from (Windows) localhost? #112
-
I'd like to enable SSH server in NixOS so that I can connect from localhost through SSH. I'm not very familiar with configuring an SSH server and using NixOS-WSL is my first time using NixOS (although I've dabbled with Nix and Home Manager before on a Mac). I've tried adding the following to my services = {
openssh = {
enable = true;
ports = [ <some-port> ]; # I think this needs to be changes from default because Windows OpenSSH is already listening on 22?
passwordAuthentication = false;
};
}; but after restarting the WSL instance I don't see @nzbr In this comment #31 (comment), I see that you were able to successfully set this up. Could you share the relevant steps and config? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The config snippet looks correct; have you executed What do you need to have sshd for? If you just want to use vscode, you don't need to use SSH anymore, the regular WSL remote works just as well. I'm asking because I have found that there are better WSL-native solutions for everything I had used SSH in WSL for |
Beta Was this translation helpful? Give feedback.
The config snippet looks correct; have you executed
nixos-rebuild switch
? Restarting the WSL VM should not be necessary in most casesWhat do you need to have sshd for? If you just want to use vscode, you don't need to use SSH anymore, the regular WSL remote works just as well. I'm asking because I have found that there are better WSL-native solutions for everything I had used SSH in WSL for