본문 바로가기

vscode/error

vscode remote ssh user Error

반응형

vscode remote를 사용하다 보면 대량 추가해서 사용 할때 

user 이름이 설정해둔 이름으로 나오지 않고

root로 나오는경우가 있다.

Host ret
  Port 201
  HostName 192.168.0.100
  User root
  IdentityFile /mnt/Raid

Host main
  Port 202
  HostName 192.168.0.100
  User root
  IdentityFile /src

Host test1
  Port 203
  HostName 192.168.0.100
  User root
  IdentityFile /src
Host test2
  Port 204
  HostName 192.168.0.100
  User root
  IdentityFile /src
  
Host Rasp1
  Port 205
  User ret
  HostName 192.168.0.100
  IdentityFile /home/ret/src

Host Rasp2
  User ret
  Port 206
  HostName 192.168.0.100
  IdentityFile /home/ret/src

설정해둔 remote ssh

Rasp1으로 접속해도

root로 뜨는 에러발생

 

설정 폴더 삭제도 해보고

c:\Users\{사용자아이디}\.ssh\config

 

괜히 설정값만 날라감...

 

해결방법

 

순서를 바꿔버린다 root인거를 맨아래로

  
Host Rasp1
  Port 205
  User ret
  HostName 192.168.0.100
  IdentityFile /home/ret/src

Host Rasp2
  User ret
  Port 206
  HostName 192.168.0.100
  IdentityFile /home/ret/src
  
Host ret
  Port 201
  HostName 192.168.0.100
  User root
  IdentityFile /mnt/Raid

Host main
  Port 202
  HostName 192.168.0.100
  User root
  IdentityFile /src

Host test1
  Port 203
  HostName 192.168.0.100
  User root
  IdentityFile /src
  
Host test2
  Port 204
  HostName 192.168.0.100
  User root
  IdentityFile /src

이렇게 하니가 일단은 정상적으로 뜸

 

임시 조치인거 같지만 이게 버그인지 뭔지 모르겠다...

일단 이렇게 조치함