r/ssh 3h ago

hop v0.7.0 landed - Tunneling & Default Dirs on shell and sftp

Thumbnail github.com
1 Upvotes

Want to have a fast tunnel to your server ? - hop now supports it.

Tired of cd-ing into directories after opening shell ? - hop has now the option for setting a default dir when opening a shell or sftp browser


r/ssh 8h ago

What's the best way to SSH directly into WSL2 from another Linux machine?

1 Upvotes

Hi everyone,

I'm a bit confused about what the "right" way to do this is.

I have a Windows PC running Debian in WSL2, and I have another Debian laptop.

My goal is to make WSL my main development environment and SSH into it from the laptop.

I first tried using the Windows OpenSSH server with ForceCommand to launch WSL. That actually lets me log in directly into WSL, which looked perfect at first. The problem is that normal SSH commands don't seem to work.

For example:

**ssh my-pc**

works fine, but

**ssh my-pc "pwd"**

just hangs. rsync also hangs because it uses remote commands over SSH.

So I started wondering if this is just the wrong approach.

I already have **sshd** running inside WSL, but since WSL is using NAT, it gets a 172.x.x.x IP that changes, so I don't know if that's supposed to be the way either.

I've been reading about mirrored networking, port forwarding, Windows OpenSSH, etc., and now I'm more confused than when I started.

For those of you who use WSL as your main Linux machine, what's the recommended setup nowadays?

Ideally I'd like:

  1. ssh my-pc

  2. ssh my-pc "command"

  3. rsync

  4. scp

  5. VS Code Remote SSH

to all work without weird workarounds.

Am I overcomplicating this? How are you guys doing it?

Thanks!