Remote VS Code into FreeBSD 14.3-Release fails

After a fresh install of 14.3-RELEASE amd64,
MacOS Visual Studio Code 1.102.0 (Universal) Remote SSH from macOS fails to log in.

Its almost working, so what am I missing?

FreeBSD console displays
Code:
linux jid 0 pid 2567 (tokio-runtime-w): syscall pid_open not implemented
Jul 13 17:00:07 repeater sshd-session[2584]: error: PAM: Authentication error for rpt from 192.168.1.35
# but sometimes.
linux jid 0 pid 2567 (tokio-runtime-w): syscall pid_open not implemented
linux jid pif 2061 (node): syscall io_uring_setup not implemented
linux jid pif 2061 (node): inotify_ini1 not implemented
linux jid pif 2061 (node): syscall io_uring_setup not implemented
This is how I configured FreeBSD
Code:
freebsd-update fetch
freebsd-update install
pkg install nano openmdns

# appended to /etc/rc.conf, making the server advertise itself as repeater.local
#    mdnsd_enable="YES"
#    mdnsd_flags="igc0"

pkg install emulators/linux_base-rl9 # where 'linux-rl9-libsigsegv' was recently merged
sysrc linux_enable="YES"
service linux start

cat /etc/rc/conf
hostname="repeater"
ifconfig_igc0="DHCP"
sshd_enable="YES"
ntpd_enable="YES"
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
mdnsd_enable="YES"
mdnsd_flags="igc0"
linux_enable="YES"
On MacOS, added to ~/.ssh/config
Code:
Host Repeater-BSD
  HostName repeater.local
  User rpt
  RequestTTY force
  RemoteCommand /compat/linux/usr/bin/bash
and enabled the VSCode Settings for Remote.SSH: Enable Remote Command.
 
Its almost working, so what am I missing?
Seems obvious looking at the error message:
Code:
Jul 13 17:00:07 repeater sshd-session[2584]: error: PAM: Authentication error for rpt from 192.168.1.35
Wrong password? Instructions recommend using public/private key logins though. You might want to add your public key to ~rpt/.ssh/authorized_keys on the destination host.

Also have a look at /var/log/auth.log, it might have more details why the login failed.
 
Seems obvious
VS Code claims it's 'Connected to remote', but the remote home folder doesn't appear in TERMINAL and I can't 'Open Folder'. I can ssh into FreeBSD just fine. However, there isn't an '.ssh' folder
Code:
rpt@repeater:~ $ ls -la
total 67
drwxr-xr-x  4 rpt  rpt     13 Jul 16 13:00 .
drwxr-xr-x  3 root wheel    3 Jul 12 20:26 ..
drwxr-xr-x  3 rpt  rpt      3 Jul 13 15:56 .cache
-rw-r--r--  1 rpt  rpt    950 Jul 12 20:26 .cshrc
-rw-------  1 rpt  rpt     20 Jul 13 16:09 .lesshst
-rw-r--r--  1 rpt  rpt    311 Jul 12 20:26 .login
-rw-r--r--  1 rpt  rpt     79 Jul 12 20:26 .login_conf
-rw-------  1 rpt  rpt    289 Jul 12 20:26 .mail_aliases
-rw-r--r--  1 rpt  rpt    255 Jul 12 20:26 .mailrc
-rw-r--r--  1 rpt  rpt    966 Jul 12 20:26 .profile
-rw-------  1 rpt  rpt    236 Jul 16 13:00 .sh_history
-rw-r--r--  1 rpt  rpt   1003 Jul 12 20:26 .shrc
drwxr-x---  5 rpt  rpt      7 Jul 16 16:57 .vscode-server
First VS CODE attempt after rebooting
Code:
root@repeater:~ # tail -f /var/log/auth.log
Jul 16 17:17:49 repeater sshd-session[1957]: Accepted keyboard-interactive/pam for rpt from 192.168.1.35 port 52670 ssh2
Jul 16 17:18:20 repeater sshd-session[1960]: Received disconnect from 192.168.1.35 port 52670:11: disconnected by user
Jul 16 17:18:20 repeater sshd-session[1960]: Disconnected from user rpt 192.168.1.35 port 52670
Jul 16 17:20:24 repeater sshd[1908]: Timeout before authentication for connection from 192.168.1.35 to 192.168.1.40, pid = 2586
Yes, I'm still using password authentication. Where do I find ' Instructions recommend using public/private key logins', so I can try that?
 
I can ssh into FreeBSD just fine.
Alright, definitely good to check. Do you also get the /compat/linux/usr/bin/bash shell?

However, there isn't an '.ssh' folder
It doesn't exist if you've never used it. You can simply create it yourself, just make sure to set 700 permissions on it, SSH is going to complain if the permissions are too liberal.

Code:
Jul 16 17:17:49 repeater sshd-session[1957]: Accepted keyboard-interactive/pam for rpt from 192.168.1.35 port 52670 ssh2
Jul 16 17:18:20 repeater sshd-session[1960]: Received disconnect from 192.168.1.35 port 52670:11: disconnected by user
Jul 16 17:18:20 repeater sshd-session[1960]: Disconnected from user rpt 192.168.1.35 port 52670
Jul 16 17:20:24 repeater sshd[1908]: Timeout before authentication for connection from 192.168.1.35 to 192.168.1.40, pid = 2586
So it accepted the password (first message) and the client disconnects 30 seconds later. 30 seconds is more than enough to run some automated checks, maybe the client doesn't like or understood what it received? Any verbose logging you could enable on the remote ssh plugin?

Where do I find ' Instructions recommend using public/private key logins', so I can try that?
I got that from here: https://code.visualstudio.com/docs/remote/ssh

You simply copy the contents of the public key of your account (on MacOS) to the ~/.ssh/authorized_keys file of the destination (FreeBSD) host.
 
Remembered I actually have VSCode installed on my Windows workstation. Haven't used in quite some time and it needed to be updated first. Then installed that "Remote SSH" plugin. It connects, logs in (with password) but then complains about FreeBSD not being a supported platform 😁 Haven't set up linux compatibility yet so that seems correct. Need to go to the gym now, I'll try and fiddle with it some more when I get back. I'm sure I once got this (somewhat) working without having to resort to a Linux shell, but that was quite a while ago.
 
/compat/linux/usr/bin/bash shell?
Correctly reports 'bash-5.1'

Code:
/compat/linux/usr/bin/bash --version
/compat/linux/usr/bin/uname -a

Code:
rpt@repeater:~ $ mkdir .ssh
rpt@repeater:~ $ chmod 700 .ssh

Attempt to remote access from macOS using VSCode Remote SSH.
FreeBSD console message:
Code:
linux jid 0 pid 2797 (tokio-runtime-w): syscall pid_open not implemented

Nothing appears in the .ssh folder.

I've read https://code.visualstudio.com/docs/remote/ssh and FreeBSD Handbook Chapter 16.
There's so much to read with so many options, I'm left utterly confused. However, I found something on https://stackoverflow.com/questions/66113731/how-to-save-ssh-password-to-vscode

So I generated the keys and copied the public key to FreeBSD '~/.ssh/authorized_keys with permission 600 - and get the same error message on the console.
 
In VSCode there should be a tab with "Output" when you use the remote SSH plugin. On mine it complained about not supporting FreeBSD (which would be correct). Any messages on yours that might shed some light on the issue?

As far as I understood this "remote" connection is that VSCode tries to install something on the destination, some scripts or framework of sorts. Perhaps that's what's failing.

I'll try and have another look tonight when I get home. Wanted to do this yesterday but was absolutely knackered when I got back from the gym. So I crashed and burned on the couch 😁
 
Back
Top