본문 바로가기
Linux

[Ubuntu24.04] XRDP로 윈도우에서 리눅스 화면 열기

by Yoon_estar 2024. 11. 8.
728x90
반응형

2024.04.01 - [Linux] - 리눅스 우분투 설치 후 기본 설정

 

리눅스 우분투 설치 후 기본 설정

패키지 설치 $ sudo apt -y update $ sudo passwd root $ su - # apt -y install openssh-server vim net-tools ssh 설정 root 계정으로 ssh 접속하기 위한 설정 # vi /etc/ssh/sshd_config 34 PermitRootLogin yes // yes로 변경 58 PasswordAuthentic

estar987.com

 

시작전...

이전에 포스팅 한 우분투 기본 설정을 한 후 진행한다.

 

개요

인터넷(외부망)이 안되는 환경에서 XRDP를 설치하여 실행하는 과정을 포스팅하려고 한다.

 

필요한 deb 파일들

  • apt-get download <패키지 명> 으로 받으면 된다.
# ls
keyboard-configuration_1.226ubuntu1_all.deb  libudev1_255.4-1ubuntu8.4_amd64.deb
libaudit1_1%3a3.1.2-2.1build1_amd64.deb      libunwind8_1.6.2-3build1_amd64.deb
libc6_2.39-0ubuntu8.3_amd64.deb              libxau6_1%3a1.0.9-1build6_amd64.deb
libdbus-1-3_1.14.10-4ubuntu4.1_amd64.deb     libxcvt0_0.1.2-1build1_amd64.deb
libdrm2_2.4.120-2build1_amd64.deb            libxdmcp6_1%3a1.1.3-0ubuntu6_amd64.deb
libegl1_1.7.0-1build1_amd64.deb              libxfont2_1%3a2.0.6-1build1_amd64.deb
libepoxy0_1.5.10-1build1_amd64.deb           libxshmfence1_1.3-1build5_amd64.deb
libfuse2t64_2.9.9-8.1build1_amd64.deb        pipewire-module-xrdp_0.2-2_all.deb
libgbm1_24.0.9-0ubuntu0.2_amd64.deb          udev_255.4-1ubuntu8.4_amd64.deb
libgcrypt20_1.10.3-2build1_amd64.deb         x11proto-dev_2023.2-1_all.deb
libgl1_1.7.0-1build1_amd64.deb               xfce4_4.18_all.deb
libpciaccess0_0.17-3build1_amd64.deb         xorg-sgml-doctools_1%3a1.11-1.1_all.deb
libpixman-1-0_0.42.2-1build1_amd64.deb       xserver-common_2%3a21.1.12-1ubuntu1.1_all.deb
libselinux1_3.5-2ubuntu2_amd64.deb           xserver-xorg-core_2%3a21.1.12-1ubuntu1.1_amd64.deb
libsystemd0_255.4-1ubuntu8.4_amd64.deb       xtrans-dev_1.4.0-1_all.deb
  • xrdp deb 파일
    • 설치하면 데몬이 생성될 것이다. 
# ls
xorgxrdp_1%3a0.9.19-1_amd64.deb  xrdp_0.9.24-4_amd64.deb
  • 패키지 설치
dpkg -i <패키지 명.deb>

데몬 확인

# systemctl status xrdp
xrdp.service         xrdp-sesman.service
root@fianl:~/xrdp# systemctl status xrdp.service
● xrdp.service - xrdp daemon
     Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-11-05 14:58:25 KST; 16s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
    Process: 20582 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
    Process: 20591 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 20592 (xrdp)
      Tasks: 1 (limit: 4613)
     Memory: 860.0K (peak: 1.6M)
        CPU: 41ms
     CGroup: /system.slice/xrdp.service
             └─20592 /usr/sbin/xrdp

Nov 05 14:58:24 fianl systemd[1]: Starting xrdp.service - xrdp daemon...
Nov 05 14:58:24 fianl xrdp[20591]: [INFO ] address [0.0.0.0] port [3389] mode 1
Nov 05 14:58:24 fianl xrdp[20591]: [INFO ] listening to port 3389 on 0.0.0.0
Nov 05 14:58:24 fianl xrdp[20591]: [INFO ] xrdp_listen_pp done
Nov 05 14:58:24 fianl systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: No such file or d>
Nov 05 14:58:25 fianl systemd[1]: Started xrdp.service - xrdp daemon.
Nov 05 14:58:26 fianl xrdp[20592]: [INFO ] starting xrdp with pid 20592
Nov 05 14:58:26 fianl xrdp[20592]: [INFO ] address [0.0.0.0] port [3389] mode 1
Nov 05 14:58:26 fianl xrdp[20592]: [INFO ] listening to port 3389 on 0.0.0.0
Nov 05 14:58:26 fianl xrdp[20592]: [INFO ] xrdp_listen_pp done
# systemctl status xrdp-sesman.service
● xrdp-sesman.service - xrdp session manager
     Loaded: loaded (/usr/lib/systemd/system/xrdp-sesman.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-11-05 14:58:24 KST; 25s ago
       Docs: man:xrdp-sesman(8)
             man:sesman.ini(5)
    Process: 20579 ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 20580 (xrdp-sesman)
      Tasks: 1 (limit: 4613)
     Memory: 888.0K (peak: 1.5M)
        CPU: 12ms
     CGroup: /system.slice/xrdp-sesman.service
             └─20580 /usr/sbin/xrdp-sesman

Nov 05 14:58:24 fianl systemd[1]: Starting xrdp-sesman.service - xrdp session manager...
Nov 05 14:58:24 fianl xrdp-sesman[20580]: [INFO ] starting xrdp-sesman with pid 20580
Nov 05 14:58:24 fianl systemd[1]: Started xrdp-sesman.service - xrdp session manager.
root@fianl:~/xrdp#

접속할 사용자 추가 및 패스워드 설

useradd -m -s /bin/bash user1
...
useradd -m -s /bin/bash user4

passwd user1
...
passwd user4

방화벽 포트 추가 및 방화벽 활성화

sudo ufw allow 3389/tcp

ufw disable

systemctl stop ufw.service

systemctl disable ufw.service

systemctl status ufw.service

ufw status
Sattus: inactive

데몬 방화벽 확인

재부팅

reboot

윈도우에서 XRDP 실행

반응형