1. make sure that sudo -u newuser -i works in a regular ssh session without requesting a password
2. remove "-o RemoteCommand=none" and "bash" from extension.js like so
Get Problem:
sed -i s/"-o RemoteCommand=none"/""/ ~/.vscode/extensions/ms-vscode-remote.remote-ssh-*/out/extension.js
sed -i s/"bash"/""/ ~/.vscode/extensions/ms-vscode-remote.remote-ssh-*/out/extension.js
3. create an ssh config entry with a RemoteCommand like this one:
Host pi-for-newuser
Hostname pi
User pi
RemoteCommand sudo -u newuser -i
mesg: ttyname failed: Inappropriate ioctl for device
RequestTTY Yes
RemoteCommand sudo -i