Use a login shell for coder ssh #18805
Replies: 2 comments
-
I think the dbus thing is happening because Tailscale is started by systemd, whereas in most situations Coder is started through an init script or cloudinit. |
Beta Was this translation helpful? Give feedback.
-
No on our VMs Coder is also started by Systemd.
The DBUS I'm referring to is specific to user sessions and is started by the login process. It is typically started by You can see the difference in name of the process for Coder vs Tailscale and OpenSSH. Launching the shell as Coder
Tailscale
OpenSSH
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Write now it looks like the coder agent handles a lot of the environment setup when connecting ssh. However this creates limitations, especially when connecting to full system environments like VMs. It does not initialize things like
.profile
, and on systems with systemd things like DBUS are not initialized preventing usage of things like systemd user services or environment configuration through systemdShell to a VM with regular SSH or Tailscale
Shell to same VM through coder
Rather than start the shell directly you should use the
login
orsu
commands, these are available even in most containers, and only fall back to directly starting the shell if necessary.This is the same thing that occurs when you login from a terminal or through SSH, it takes care of changing to the $HOME directory, runs PAM to setup things like DBUS or pam_mkhomedir, etc.
Beta Was this translation helpful? Give feedback.
All reactions