๐Ÿ ์šฐ๋ถ„ํˆฌ ํ™ˆ ์„œ๋ฒ„ ๊ตฌ์ถ•๊ธฐ - ๋ฐ์Šคํฌํ†ฑ ํ™˜๊ฒฝ ๊ตฌ์ถ•๐Ÿ 

๊น€ํƒœ์›ยท2022๋…„ 2์›” 18์ผ
4
post-custom-banner

๊ฐœ์š”


๋ณธ ์‹œ๋ฆฌ์ฆˆ๋Š” Ubuntu Server 20.04 ๋ฒ„์ „์„ ๊ธฐ์ค€์œผ๋กœ ํ•œ๋‹ค.

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” ์šฐ๋ถ„ํˆฌ ์„œ๋ฒ„์— ๋ฐ์Šคํฌํ†ฑ ํ™˜๊ฒฝ์„ ์„ค์น˜ํ•˜๋Š” ๊ณผ์ •์„ ๋‹ค๋ฃฐ ์˜ˆ์ •์ด๋‹ค.

์ตœ์ดˆ ์„ค์น˜ ์‹œ ์šฐ๋ถ„ํˆฌ ๋ฐ์Šคํฌํ†ฑ์œผ๋กœ ์„ค์น˜ํ•˜์ง€ ์•Š๊ณ  ์šฐ๋ถ„ํˆฌ ์„œ๋ฒ„๋ฅผ ์„ค์น˜ํ•œ ์ดํ›„์— ๋ฐ์Šคํฌํ†ฑ ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•˜๋Š” ์ด์œ ๋Š” AWS, GCP์™€ ๊ฐ™์€ ๋Œ€๋ถ€๋ถ„์˜ ํด๋ผ์šฐ๋“œ ํ”Œ๋žซํผ์€ ์šฐ๋ถ„ํˆฌ ๋ฐ์Šคํฌํ†ฑ ์ด๋ฏธ์ง€๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.


1. ํŒจํ‚ค์ง€ ์—…๊ทธ๋ ˆ์ด๋“œ

sudo apt update && sudo apt upgrade

๋จผ์ € ํŒจํ‚ค์ง€ ์—…๋ฐ์ดํŠธ ๋ฐ ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค.


2. tasksel ์„ค์น˜ ๋ฐ ์‹คํ–‰

tasksel ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•œ๋‹ค

sudo apt install tasksel -y

tasksel์„ ์‹คํ–‰ํ•œ๋‹ค.

sudo tasksel

๋ฐฉํ–ฅํ‚ค ์œ„, ์•„๋ž˜์™€ ์ŠคํŽ˜์ด์Šค๋ฐ”, ํƒญ์„ ์‚ฌ์šฉํ•˜์—ฌ ์กฐ์ž‘ํ•  ์ˆ˜ ์žˆ๋‹ค.

์•„๋ž˜ ์‚ฌ์ง„๊ณผ ๊ฐ™์ด Ubuntu desktop์„ ์„ ํƒํ•œ๋‹ค.
tasksel-ubuntu-desktop

์„ค์น˜์— ๊ฝค ์˜ค๋žœ ์‹œ๊ฐ„์ด ์†Œ์š”๋˜๋‹ˆ ์ธ๋‚ด์‹ฌ์„ ๊ฐ–๊ณ  ๊ธฐ๋‹ค๋ฆฌ์ž.


3. graphical.target ์„ค์ •

์šฐ๋ถ„ํˆฌ์—์„œ ๋ฐ์Šคํฌํ†ฑ ํ™˜๊ฒฝ์„ ์ธ์‹ํ•  ์ˆ˜ ์žˆ๋„๋ก graphical.target์„ ์„ค์ •ํ•œ๋‹ค.

sudo systemctl set-default graphical.target

์„œ๋ฒ„๋ฅผ ์žฌ๋ถ€ํŒ…ํ•œ๋‹ค.

sudo reboot

4. xrdp ์„ค์น˜ ๋ฐ ์„ค์ •

xrdp ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•œ๋‹ค.

sudo apt install xrdp -y

xrdp๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰ ์ค‘์ธ์ง€ ํ™•์ธํ•œ๋‹ค.

sudo systemctl status xrdp

Status๊ฐ€ active (running)์ด๋ฉด ์ •์ƒ์ด๋‹ค.

xrdp๋ฅผ ssl-cert ๊ทธ๋ฃน์— ์ถ”๊ฐ€ํ•œ๋‹ค.

sudo usermod -a -G ssl-cert xrdp

xrdp๋ฅผ ํ†ตํ•ด ์„œ๋ฒ„์— RDP ์ ‘์†ํ•˜๋ฉด ๊ฒ€์€ ํ™”๋ฉด๋งŒ ์ถœ๋ ฅ๋˜๋Š” ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋‹ค. ํ•ด๋‹น ๋ฒ„๊ทธ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

nano ์—๋””ํ„ฐ๋กœ /etc/xrdp/startwm.shํŒŒ์ผ์„ ์—ฐ๋‹ค. (vi๋ฅผ ์‚ฌ์šฉํ•ด๋„ ๋ฌด๋ฐฉํ•จ)

sudo nano /etc/xrdp/startwm.sh

์•„๋ž˜ ๋‚ด์šฉ์„ test -x /etc/X11/Xsession && exec /etc/X11/Xsession ์œ„์— ์ถ”๊ฐ€ํ•œ๋‹ค.

Unset DBUS_SESSION_ADDRESS
Unset XDG_RUNTIME_DIR
sudo systemctl restart xrdp

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์ •๋˜์–ด์•ผ ํ•œ๋‹ค.
xrdp_config

๋งŒ์•ฝ ๐Ÿ ์šฐ๋ถ„ํˆฌ ํ™ˆ ์„œ๋ฒ„ ๊ตฌ์ถ•๊ธฐ - ์„œ๋ฒ„ ๊ธฐ๋ณธ ์„ค์ •๐Ÿ ์˜ 4. ๋ฐฉํ™”๋ฒฝ ์„ค์ •์—์„œ 3389ํฌํŠธ๋ฅผ ๊ฐœ๋ฐฉํ–ˆ๋‹ค๋ฉด 3rd party RDP ํด๋ผ์ด์–ธํŠธ๋‚˜ ์œˆ๋„์šฐ์˜ ์›๊ฒฉ ๋ฐ์Šคํฌํ†ฑ ์—ฐ๊ฒฐ ๊ธฐ๋Šฅ์„ ์ด์šฉํ•ด ์„œ๋ฒ„์— RDP ์—ฐ๊ฒฐ์ด ๊ฐ€๋Šฅํ•ด์ง„๋‹ค.


5. ์ƒ‰์ƒ ํ”„๋กœํŒŒ์ผ ์„ค์ •

xrdp๋ฅผ ํ†ตํ•ด ์„œ๋ฒ„์— RDP ์ ‘์†ํ•˜๋ฉด Authentication is required to create a color managed device ๋ฉ”์‹œ์ง€๊ฐ€ ๊ณ„์†ํ•ด์„œ ํŒ์—… ๋˜๋Š” ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋‹ค.
color-profile

ํŒจ์Šค์›Œ๋“œ๋ฅผ ์ž…๋ ฅํ•ด๋„ ํ•ด๋‹น ๋ฉ”์‹œ์ง€๊ฐ€ ๊ณ„์† ํŒ์—… ๋œ๋‹ค.

ํ•ด๋‹น ๋ฒ„๊ทธ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

sudo nano /etc/polkit-1/localauthority/50-local.d/color.pkla

๋งŒ์•ฝ /etc/polkit-1/localauthority/50-local.d ํด๋”๊ฐ€ ์—†๋‹ค๋ฉด ์ƒ์„ฑํ•ด ์ค€๋‹ค.

์•„๋ž˜ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜๊ณ  ์ €์žฅํ•œ๋‹ค.

[Allow colord for all users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=yes
ResultInactive=yes
ResultActive=yes

์„œ๋ฒ„๋ฅผ ์žฌ๋ถ€ํŒ…ํ•œ๋‹ค.

sudo reboot

๋งˆ์น˜๋ฉฐ

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” ์šฐ๋ถ„ํˆฌ ์„œ๋ฒ„์— ๋ฐ์Šคํฌํ†ฑ ํ™˜๊ฒฝ ๋ฐ xrdp๋ฅผ ์„ค์น˜ํ•˜๊ณ  ์ž์ฃผ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๊ณผ์ •์„ ๋‹ค๋ค˜๋‹ค.

๋‹ค์Œ ํฌ์ŠคํŒ…์—์„œ๋Š” Guacamole๋ฅผ ์„ค์น˜ํ•˜๋Š” ๊ณผ์ •์„ ๋‹ค๋ฃฐ ์˜ˆ์ •์ด๋‹ค.

profile
๊ฐœ๋ฐœ์ด ์žฌ๋ฐŒ์–ด์„œ ํ•˜๋Š” Junior Backend Developer
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€