erhlee-bird / dotfiles

0 stars 0 forks source link

dotfiles repo breaks SSH into codespaces #1

Open erhlee-bird opened 2 weeks ago

erhlee-bird commented 2 weeks ago
$ gh cs ssh
? Choose codespace: 
vscode@localhost: Permission denied (publickey,password).
shell closed: exit status 255
$ sudo service ssh stop
$ # edit /etc/ssh/sshd_config to enable logging
$ sudo /usr/sbin/sshd -D -p 2222 -e
...
debug1: trying public key file /home/vscode/.ssh/authorized_keys
debug1: fd 5 clearing O_NONBLOCK
Authentication refused: bad ownership or modes for directory /workspaces
...
ls -al ~/
...
lrwxrwxrwx  1 vscode vscode    53 May 20 14:28 .ssh -> /workspaces/.codespaces/.persistedshare/dotfiles/.ssh
...

so it seems that because my dotfiles repo has a .ssh/ directory, sshd is tripping up because it is hosted under /workspaces and not /home/vscode


to workaround, move ssh config files to ~/.config/.ssh and update the combine-my-ssh command to source configs from there.

erhlee-bird commented 2 weeks ago

Looks like .config/ is a reserved directory that codespaces will not link in. Will alternatively move to .local/share/ssh/ and try that.

Also notably .ssh/ is no longer created in the codespace but SSH is working now.