Publish:

ํƒœ๊ทธ: , ,

์นดํ…Œ๊ณ ๋ฆฌ:

๐Ÿ“Œ SSH

SSH (๋ณด์•ˆ ์…ธ, Secure Shell)์€ ๋„คํŠธ์›Œํฌ ํ”„๋กœํ† ์ฝœ๋กœ, ์ปดํ“จํ„ฐ์™€ ๋„คํŠธ์›Œํฌ ์žฅ์น˜ ์‚ฌ์ด์˜ ์•ˆ์ „ํ•œ ๋ฐ์ดํ„ฐ ํ†ต์‹ ์„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•œ๋‹ค.

์›๊ฒฉ ๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ์„ ํ†ตํ•ด Ubuntu ์— ์ ‘์†ํ•ด๋ณด์ž.

๐Ÿ“‹ ์„ค์น˜

๊ธฐ๋ณธ์ ์œผ๋กœ ์ ‘์†ํ•˜๊ณ ์ž ํ•˜๋Š” ๊ธฐ๊ธฐ์— ssh server ๊ฐ€ ์žˆ์–ด์•ผ ์ž‘๋™ํ•˜๋Š”๋ฐ ubuntu ์—๋Š” ๊น”๋ ค์žˆ์ง€ ์•Š๋‹ค.

๋ชจ๋‹ˆํ„ฐ๋ฅผ ์—ฐ๊ฒฐํ•˜์—ฌ ssh server ๋ฅผ ์„ค์น˜ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

1
2
sudo apt update
sudo apt install openssh-server

์„ค์น˜ ํ›„ ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰ ์ค‘์ธ์ง€ ํ™•์ธํ•œ๋‹ค.

1
sudo systemctl status ssh

๐Ÿ“‹ ํฌํŠธ

๊ธฐ๋ณธํฌํŠธ

๊ธฐ๋ณธํฌํŠธ๋Š” 22๋ฒˆ์ด๋‹ค.

1
sudo ufw allow ssh

ํฌํŠธ๋ณ€๊ฒฝ

1
2
3
4
sudo vi /etc/ssh/sshd_config

#Port 22
Port 1234

๋ณ€๊ฒฝํ–ˆ์œผ๋ฉด ์žฌ์‹œ์ž‘ํ•œ๋‹ค.

1
sudo service ssh restart

๋ณ€๊ฒฝํ•œ ํฌํŠธ์—์„œ ๋Œ์•„๊ฐ€๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์ž.

1
netstat -tnlp

net-tools

๋งŒ์•ฝ netstat ๋ช…๋ น์–ด๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด net-tools ๋ฅผ ์„ค์น˜ํ•˜์ž.

1
sudo apt install net-tools

๋ฐฉํ™”๋ฒฝ ์—ด์–ด์ฃผ๊ธฐ

1
2
sudo ufw deny 22
sudo ufw allow 1234

๐Ÿ“‹ ์—ฐ๊ฒฐ

1
2
3
# ๋ฐ”๊พผ ํฌํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์ž.

ssh -p 1234 baecrong@192.168.0.0
๋ฐฉ๋ฌธํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!๐Ÿ˜Š

์—…๋ฐ์ดํŠธ:

๋Œ“๊ธ€๋‚จ๊ธฐ๊ธฐ