I'm also struggling to solve the same problem. I've tried a bunch of different stuff to try and auth as user b
before vscode connects to userA
s remote connection server, such as:
- adding various additional parameters to my ssh config, authing as
userB
as above,
- adding a similar
su userB
command to userA
's bashrc file on the remote server,
- same for bash_profile.
... all to no avail. In all cases, whatever I do, the vscode remote session will be instantiated under the under-privileged user a
account, with the remote server launched in user a
's user directory. If I auth through a standard terminal app, things work as expected and the su userB
command triggers immediately after userA
login. If I open a vscode terminal session in the same workspace (i.e. hit the plus sign in the same window as the ssh tunnelling session) and auth as userB
, this also works but the session authed as userA
persists unchanged.