본문 바로가기

Tool/VS Code

[VSCode] VSCode 원격 서버 연결 장애 (feat. Remote SSH)

반응형

연결 방법이 궁금한 경우 아래 링크 참조

https://24hours-beginner.tistory.com/278

 

[VSCode] SSH 연결하기 (+ Docker Container 접근)

Ubuntu 18.04 서버안의 Docker(도커) container(컨테이너)에서 프로젝트를 테스트하고 있는데 vim밖에 사용이 안된다. 그래서 windows환경에서 연결하여 작업을 해보고자 vscode로 ssh연결을 시도하였다. 1. 준

24hours-beginner.tistory.com

1. permission denied

root 계정이 아닌 경우 권한 문제로 튕기는 경우가 있다. 그럴 경우 권한을 주면 된다.

sudo usermod -aG docker [username]

 

참조

 

2. 비밀번호 맞는데 3번 치고 안될 때

Client ~/user/.ssh/known_host : notepad++로 열어서 해당 port 삭제

# client
# ~/user/.ssh/known_host : notepad++로 열어서 해당 port 삭제
vim ~/user/.ssh/known_host

Server에서 passwd 설정

# server
passwd

 

 

3. 무한 패스워드 입력

vscode에서 서버로 ssh 접속을 하기 위해서 remote-ssh extension 은 서버에 무언가 설치?를 한다.

근데 여기서 아래 2개 문구가 나오면서 다운로드 받으면서 무한으로 기다리는 경우가 생긴다.

또는 패스워드가 맞는데 계속 패스워드를 다시 치라고 뜬다.

(새로 연결 하거나 vscode를 update했거나 등의 경우)

> ssh 호스트 설정 : (details) vs code 서버에 연결 - 횟수 다시 시도

더보기

>> details 보면 라고 나온다..

> Installation already in progress...

> If you continue to see this message, you can try toggling the remote.SSH.useFloc

...

Server installation process already in progress - waiting and retrying

> host ssh 호스트 설정 : vs code server 로컬로 다운로드하는 중

> host ssh 호스트 설정: scp를 사용하여 호스트에 vs code 서버를 복사하는 중

 

해결 - 삭제

패스워드가 맞는데도 계속 무한 패스워드 입력이 나온다면 (Got some output, clearing connection timeout)

안내창에 아래 두 문구가 뜨는 경우
> ssh 호스트 설정 : (details) vs code 서버에 연결 - 횟수 다시 시도

> host ssh 호스트 설정 : vs code server 로컬로 다운로드하는 중

 

server에 접속하여

.vscode-server 폴더를 삭제해준다.

그 후 다시 접속 시도

cd ~
rm -rf .vscode-server

보통 이거하고 접속시도하면 접속이 되거나 무한 로딩쪽으로 현상이 바뀐다.

 

4. 무한 로딩 (feat. update)

처음 접속할 경우 서버쪽에 vscode 관련 프로그램?을 다운로드 받는데

그거 받는데 원래 시간이 좀 걸린다

근데 아예 다운로드가 안되는 경우가 있다.. ㅠㅠ

copying VS Code Server to host with scp 에서 무한 다운로드 하고 있다;;

원인은 아직도 정확하지 않으나 vscode를 update 하는 경우 잘되다가 갑자기 안된다고 한다.

희한한건 되는 서버 있고 안되는 서버 있다.;;

해결 - install

vscode commit version 확인

방법은 2가지가 있다.

vscode에서 확인하거나 오류창?을 통해서

1. vscode - 도움말 - 정보 - 커밋쪽 확인

2. 터미널창 확인

접속 중지를 하거나 접속 중일때 출력쪽을 보면 아래와 같이 보이는데 여기서 commit 을 확인할 수 있다.

# example
/home/test/.vscode-server/bin/5235c6bb189b60b01b1f49062f4ff > a42384f8c91/vscode-remote-lock.test.5235c6bb189b60b01b1f49062f4ffa42384f8c91

 

설치파일 다운로드

vscode commit 버전에 맞는 설치 파일을 다운로드 받는다.

# stable version
https://update.code.visualstudio.com/commit:$COMMIT_ID/server-linux-x64/stable

# example
https://update.code.visualstudio.com/commit:5235c6bb189b60b01b1f49062f4ffa42384f8c91/server-linux-x64/stable

#insider version
https://update.code.visualstudio.com/commit:$COMMIT_ID/server-linux-x64/insider

 

설치파일 이동 / 압출 풀기

서버의 ~/.vscode-server/bin/$COMMIT_ID 경로에 해당 파일을 넣습니다.

cd ~/.vscode-server/bin/$COMMIT_ID
tar -xvzf vscode-server-linux-x64.tar.gz --strip-components 1

#example
cd ~/.vscode-server/bin/5235c6bb189b60b01b1f49062f4ffa42384f8c91
tar -xvzf vscode-server-linux-x64.tar.gz --strip-components 1

 

재연결 시도

해결 - vscode 재 인스톨

vscode uninstall > vscode install

 

잘됨

 

 

그러고도 안된다고 하면 server쪽 문제일 가능성이 높음

서버를 일단 재부팅해보고 그래도 안된다면

무언가 파일 시스템이나 권한 관련하여 문제점이 없는지 확인해봐야함.

 

5. windows 한글 계정명

https://hydroponicglass.tistory.com/382

 

[VS Code] 원격 접속 오류 : Bad owner or permissions

Visual Studio Code 원격 접속 오류 윈도우에서 VS Code로 리눅스 원격접속 시도 시 아래 문제가 있었다. 원격접속 시 Timeout 에러가 발생. Retry버튼을 눌러도 계속 같은 에러가 반복된다. 이는 C:\Users\user\

hydroponicglass.tistory.com

 

6. Shell server terminated (code: 255, signal: null) XSL

https://24hours-beginner.tistory.com/424

 

[VS Code] Shell server terminated (code: 255, signal: null) XSL

주인장은 아래 방법을 모두 동원해도 되지 않았다. 그냥 직접 연결로 해결 봤다. 그렇다고 하더라도 도움이 되길 바라며 적어보았다. https://24hours-beginner.tistory.com/391 [Docker] vscode에서 Container 직접

24hours-beginner.tistory.com

 

참조

https://stackoverflow.com/questions/56718453/using-remote-ssh-in-vscode-on-a-target-machine-that-only-allows-inbound-ssh-co

 

Using "Remote SSH" in VSCode on a target machine that only allows inbound SSH connections

Is there a way to use the VSCode Remote SSH extension to interact with a remote host that does not allow outbound internet connections? Is it possible to download the vscode-server files from anot...

stackoverflow.com

https://github.com/microsoft/vscode-remote-release/issues/2792

 

Failed to scp local download tar file to remote server · Issue #2792 · microsoft/vscode-remote-release

Failed to scp local download tar file to remote server. I think the reason for this issue is some special character in path. Logs: [13:21:02.905] Got request to download on client for {"platfo...

github.com

 

반응형