Open williamstein opened 2 months ago
WORKAROUND: Setup ssh keys as explained at https://doc.cocalc.com/account/ssh.html, then start your compute server. If the ip address is 35.212.240.37, then you can ssh to root on the compute server via:
ssh root@35.212.240.37
After you ssh in, change the ssh server configuration to NOT forward user into the compute server as follows, then restart the ssh server:
sed -i 's/^Match User user$/Match User xxx/' /etc/ssh/sshd_config
service ssh restart
Now when you ssh to the compute server, you are signed in as "user" and have full access to your filesystem, but you don't have the special software environment. For vscode that is probably fine, since you just need to access to the filesystem.
Now just follow the directions at https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh:
ssh user@35.212.240.37 -A
and connectI tried making a compute server then ssh'ing to user@[ip] and that didn't work, due to some docker group error.
This is now fixed via commit 827c0697eff58bf2963d9357965ee7dc80102c15
Another way to support odd users of ssh in the compute container, but still ensuring that standard ssh to root works, would be to run a second ssh server only in the compute container on port 2222, via supervisord.
I tried making a compute server then ssh'ing to user@[ip] and that didn't work, due to some docker group error. This was easy to fix by editing /etc/group and adding user to the docker group:
Next tried VS Code's remote ssh extension https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh and it does not work. It involves running
ssh -v -T -D 50010 -o ConnectTimeout=15 user@35.212.240.37
(presumably) and this doesn't work because of how ssh works into the container:At this point (months later after implementing this), I think I should rewrite the ssh for compute servers as follows:
Then vs code remote ssh should work, and probably a lot of other subtle things that just can't be supported via forcecommand.