vscode remote ssh Error: EACCES: permission denied

https://github.com/microsoft/vscode/issues/48659

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```

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



  

[![](https://1.bp.blogspot.com/-FXedlr85sQM/Xuw5z-9I5kI/AAAAAAAAZso/-0XXb2R1LWI7qAlYkZvN31GjVuKov9e_gCK4BGAsYHg/w625-h483/dddddd.jpg)](https://1.bp.blogspot.com/-FXedlr85sQM/Xuw5z-9I5kI/AAAAAAAAZso/-0XXb2R1LWI7qAlYkZvN31GjVuKov9e_gCK4BGAsYHg/s1606/dddddd.jpg)



Get Problem: 

  

mesg: ttyname failed: Inappropriate ioctl for device

  

[https://unix.stackexchange.com/questions/48527/ssh-inside-ssh-fails-with-stdin-is-not-a-tty](https://unix.stackexchange.com/questions/48527/ssh-inside-ssh-fails-with-stdin-is-not-a-tty)

  

  

RequestTTY Yes
RemoteCommand sudo -i