๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

TIL/ETC

vscode ssh ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ฐ˜๋ณต ์ž…๋ ฅ ์˜ค๋ฅ˜

์ƒˆ ๋…ธํŠธ๋ถ์„ ๊ตฌ๋งคํ•ด์„œ vscode๋ฅผ ๊น”๊ณ  ์„œ๋ฒ„์— ssh ์ ‘์†ํ–ˆ๋Š”๋ฐ

๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ์ฐฝ์ด ๋ฐ˜๋ณตํ•ด์„œ ๋œจ๋Š” ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒ..

์—ด์‹ฌํžˆ ๊ตฌ๊ธ€๋งํ•ด๋ณด๋‹ˆ ์›์ธ์€ vscode๋ฒ„์ „์ด ๋ณ€๊ฒฝ๋˜๋ฉด์„œ ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ๋ผ๊ณ  ํ•˜๋ฉฐ,

vscode๋กœ ์ ‘์†ํ•˜๋ ค๋Š” ์„œ๋ฒ„์— ํ„ฐ๋ฏธ๋„๋กœ ์ ‘์†ํ•˜์—ฌ vscode-server ํด๋”๋ฅผ ์‚ญ์ œํ•˜๋ฉด ํ•ด๊ฒฐ๋œ๋‹ค๊ณ ํ•จ

1. ํ„ฐ๋ฏธ๋„๋กœ ์„œ๋ฒ„์— ์ ‘์† ๋ฐ vscode-server ํด๋” ์ œ๊ฑฐ

#ํ„ฐ๋ฏธ๋„๋กœ ์„œ๋ฒ„์— ์ ‘์†
ssh [๊ณ„์ •id]@[์„œ๋ฒ„IP]
#vscode-server ํด๋” ์ œ๊ฑฐ
cd ~
rm -rf .vscode-server/

์ถœ๋ ฅ : ์—๋Ÿฌ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ, ์‹คํ–‰ ์ค‘์ธ vscode๊ฐ€ ์กด์žฌํ•ด์„œ ๋ชป ์ง€์šด๋‹ค๊ณ ํ•จ → ์‹คํ–‰ ์ค‘์ธ vscode๋ฅผ ์ง€์šฐ์ž

2. ๋‚˜์˜ ๊ณ„์ •์ด ์‹คํ–‰ ์ค‘์ธ vscode ๋ฅผ ๊ฒ€์ƒ‰ ๋ฐ ์‚ญ์ œ

#๋‚ด ๊ณ„์ •(inistory)๊ฐ€ ์‹คํ–‰ ์ค‘์ธ vscode ๊ฒ€์ƒ‰
sof | grep 'inistory'| grep 'vscode'

์ถœ๋ ฅ : ์‹คํ–‰์ค‘์ธ ํŒŒ์ผ์„ ๋„์›Œ์คŒ

๋„ˆ๋ฌด ๋งŽ์•„์„œ ํ•œ๋ฒˆ์— killํ•˜๊ธฐ ์–ด๋ ค์›€ → delete.sh ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด์„œ ํ•œ ๋ฒˆ์— ์ง€์šฐ์ž

vi delete.sh
#์•„๋ž˜ ๋‚ด์šฉ ๋ณต๋ถ™

#!/bin/bash
keyword="vscode"

# ํ‚ค์›Œ๋“œ์™€ ์ผ์น˜ํ•˜๋Š” ๋ชจ๋“  ํ”„๋กœ์„ธ์Šค์˜ PID๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
pids=$(pgrep -f "$keyword")

# ์ฐพ์€ PID๋กœ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค.
for pid in $pids; do
  kill "$pid"
done

ESC :wq! ๋ˆŒ๋Ÿฌ์„œ ์ €์žฅ

#์‹คํ–‰
./delete.sh

์‹คํ–‰ ์ค‘์ธ๊ฑฐ๋ฅผ ๋ชจ๋‘ killํ•ด์คŒ

๋‹ค์‹œ ํด๋” ์ง€์šฐ๊ธฐ ์‹œ๋„

rm -rf .vscode-server/

์ถœ๋ ฅ : X, ์ž˜ ์ง€์›Œ์ง

๋‹ค์‹œ ์ ‘์† → ์—ฌ์ „ํžˆ ์•ˆ ๋จ

ํ˜น์‹œ ๋ชฐ๋ผ ์˜ˆ์ „ ๋…ธํŠธ๋ถ์—์„œ ์ž˜ ๋˜๋Š”์ง€ ํ™•์ธํ–ˆ๋”๋‹ˆ ๊ทธ๊ฑด ์ž˜ ๋จ

์˜ˆ์ „๋…ธํŠธ๋ถ์˜ vscode ๋ฒ„์ „์„ ํ™•์ธ → 1.8.1

๊ธฐ์กด vscode ์‚ญ์ œ, vscode 1.81์„ ์ƒˆ ๋…ธํŠธ๋ถ์— ๋‹ค์‹œ ์„ค์น˜ → ํ•ด๊ฒฐ

๋ฌธ์ œ๊ฐ€ ๋๋˜ ์ตœ์‹ ๋ฒ„์ „ vscode : 1.82

๊ฒฐ๊ตญ vscode ๋ฒ„์ „ ๋ฌธ์ œ์˜€๋‹ค..ใ…œใ…œ

์ฐธ๊ณ ํ•œ ์ž๋ฃŒ

https://velog.io/@talisman/VScode-%EC%84%9C%EB%B2%84%EC%99%80-ssh-%EC%97%B0%EA%B2%B0-%EC%8B%9C-%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8-%EC%9E%85%EB%A0%A5-%EB%B0%98%EB%B3%B5%EB%90%A0-%EB%95%8C

https://velog.io/@bailando/VSCode-ssh-%EC%97%B0%EA%B2%B0%EC%98%A4%EB%A5%98