CLIEN

본문 바로가기 메뉴 바로가기 보기설정 테마설정
톺아보기 공감글
커뮤니티 커뮤니티전체 C 모두의광장 F 모두의공원 I 사진게시판 Q 아무거나질문 D 정보와자료 N 새로운소식 T 유용한사이트 P 자료실 E 강좌/사용기 L 팁과강좌 U 사용기 · 체험단사용기 W 사고팔고 J 알뜰구매 S 회원중고장터 B 직접홍보 · 보험상담실 H 클리앙홈
소모임 소모임전체 ·굴러간당 ·아이포니앙 ·주식한당 ·MaClien ·방탄소년당 ·일본산당 ·소시당 ·개발한당 ·자전거당 ·이륜차당 ·AI당 ·안드로메당 ·소셜게임한당 ·골프당 ·바다건너당 ·걸그룹당 ·곰돌이당 ·나스당 ·콘솔한당 ·가상화폐당 ·키보드당 ·클다방 ·패스오브엑자일당 ·리눅서당 ·퐁당퐁당 ·물고기당 ·전기자전거당 ·노젓는당 ·디아블로당 ·찰칵찍당 ·라즈베리파이당 ·3D메이킹 ·X세대당 ·ADHD당 ·AI그림당 ·날아간당 ·사과시계당 ·육아당 ·배드민턴당 ·야구당 ·농구당 ·블랙베리당 ·비어있당 ·FM당구당 ·블록체인당 ·보드게임당 ·활자중독당 ·볼링친당 ·캠핑간당 ·냐옹이당 ·문명하셨당 ·클래시앙 ·요리한당 ·쿠키런당 ·대구당 ·DANGER당 ·뚝딱뚝당 ·개판이당 ·동숲한당 ·날아올랑 ·e북본당 ·갖고다닌당 ·이브한당 ·패셔니앙 ·도시어부당 ·FM한당 ·맛있겠당 ·포뮬러당 ·젬워한당 ·안경쓴당 ·차턴당 ·총쏜당 ·땀흘린당 ·하스스톤한당 ·히어로즈한당 ·인스타한당 ·IoT당 ·KARA당 ·꼬들한당 ·덕질한당 ·어학당 ·가죽당 ·레고당 ·LOLien ·Mabinogien ·임시소모임 ·미드당 ·밀리터리당 ·땅판당 ·헌팅한당 ·오른당 ·영화본당 ·MTG한당 ·소리당 ·노키앙 ·적는당 ·방송한당 ·PC튜닝한당 ·그림그린당 ·소풍간당 ·심는당 ·품앱이당 ·리듬탄당 ·달린당 ·Sea마당 ·SimSim하당 ·심야식당 ·윈태블릿당 ·미끄러진당 ·축구당 ·나혼자산당 ·스타한당 ·스팀한당 ·파도탄당 ·테니스친당 ·테스트당 ·빨콩이당 ·공대시계당 ·여행을떠난당 ·터치패드당 ·트윗당 ·창업한당 ·VR당 ·시계찬당 ·WebOs당 ·위스키당 ·와인마신당 ·WOW당 ·윈폰이당
임시소모임
고객지원
  • 게시물 삭제 요청
  • 불법촬영물등 신고
  • 쪽지 신고
  • 닉네임 신고
  • 제보 및 기타 제안
© CLIEN.NET
공지[점검] 잠시후 서비스 점검을 위해 약 30분간 접속이 차단됩니다. (금일 18:15 ~ 18:45)

리눅서당

서버/넷트웍
xrdp 접속하면 DE 세션이 새로 생성되면서 접속됩니다 5

김원철
1,674
2024-01-12 15:17:36 221.♡.145.243

Arch 계열 EndeavourOS + Xfce 씁니다.

제가 예전에 xrdp 관련해서 요런 도움을 받았던 일이 있는데요:


https://www.clien.net/service/board/cm_linux/17801247CLIEN


그때는 일단 되는 거에 만족했는데, 한 가지 마음에 안 드는 게 있습니다.

xrdp 접속하면 Xfce 세션이 새로 생성되어서 로그인됩니다.

챗GPT 선생과 상담하면서 별별 짓을 다 해봤는데 죄다 실패하네요.


한 가지 의심스러운 건, xrdp 프로세스가 root에 의해 구동되는데 챗GPT가 알려주는 별별 짓을 다해도 로그인 아이디로 구동되지 않네요.

뭐가 문제일까요?


/etc/xrdp/startwm.sh :


pre_start()

{

  if [ -r /etc/profile ]; then

    . /etc/profile

  fi

  if [ -r ~/.bash_profile ]; then

    . ~/.bash_profile

  else

    if [ -r ~/.bash_login ]; then

      . ~/.bash_login

    else

      if [ -r ~/.profile ]; then

        . ~/.profile

      fi

    fi

  fi

  return 0

}


post_start()

{

  if [ -r ~/.bash_logout ]; then

    . ~/.bash_logout

  fi

  return 0

}


#start the window manager

wm_start()

{

  if [ -r /etc/locale.conf ]; then

    . /etc/locale.conf

    export LANG LANGUAGE

  fi


  # arch user

  if [ -r ~/.xinitrc ]; then

    pre_start

    . ~/.xinitrc

    post_start

    exit 0

  fi


  Explicitly start Xfce

  exec startxfce4


  # arch

  if [ -r /etc/X11/xinit/xinitrc ]; then

    pre_start

    . /etc/X11/xinit/xinitrc

    post_start

    exit 0

  fi


  pre_start

  xterm

  post_start

}


wm_start


exit 1


/etc/X11/Xwrapper.config :

allowed_users = anybody


ls -l ~/.Xauthority results:

-rw------- 1 woncheol woncheol 147  1월 12일  14:07 /home/woncheol/.Xauthority


'ps aux | grep xrdp' results:

root         555  0.0  0.0  15696  2032 ?        S    14:24   0:00 /usr/bin/xrdp-sesman

root         570  0.0  0.0  23400  2652 ?        S    14:24   0:00 /usr/bin/xrdp


sudo tail -f /var/log/xrdp.log

[20240112-15:13:12] [INFO ] address [0.0.0.0] port [3389] mode 1

[20240112-15:13:13] [INFO ] listening to port 3389 on 0.0.0.0

[20240112-15:13:13] [INFO ] xrdp_listen_pp done

[20240112-15:13:15] [INFO ] starting xrdp with pid 1410

[20240112-15:13:15] [INFO ] address [0.0.0.0] port [3389] mode 1

[20240112-15:13:15] [INFO ] listening to port 3389 on 0.0.0.0

[20240112-15:13:15] [INFO ] xrdp_listen_pp done


sudo tail -f /var/log/xrdp-sesman.log

[20240112-15:13:12] [INFO ] starting xrdp-sesman with pid 1407



김원철 님의 게시글 댓글
  • 주소복사
  • Facebook
  • X(Twitter)
댓글 • [5] 을 클릭하면 간단한 회원메모를 할 수 있습니다.
3G이용자
IP 211.♡.249.184
01-14 2024-01-14 19:52:05 / 수정일: 2024-01-14 19:52:54
·
/etc/X11/Xwrapper.config
파일에 아래 문구가 들어가야 할 듯 하고요.
needs_root_rights=no

세션 시작하는 명령은 보통은
/etc/xrdp/startwm.sh
파일에서 실행하지 않고, 대신
~/.xinitrc
파일을 사용자 홈에 만들어서 여기서 실행하는게 정석인 것 같습니다.
/etc/xrdp/startwm.sh 파일에는 ~/.xinitrc를 호출하도록 하는 내용이 들어가야겠죠.
(검색하면 예제가 많이 나올 듯 합니다)
세션실행 권한 자체가 root 가 아닌 사용자 아이디 권한으로 실행되도록 확실히 하니까요.
김원철
IP 221.♡.145.243
01-15 2024-01-15 09:46:46
·
@3G이용자님

감사합니다. 이렇게 고쳤는데, 결과는 별 차이가 없네요;

/etc/xrdp/startwm.sh :
exec startxfce4 삭제

/etc/X11/Xwrapper.config :
needs_root_rights=no 추가

~/.xinitrc :

#!/bin/bash
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

SESSION=${1:-xfce4-session}

# merge in defaults and keymaps

if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi

get_session(){
local dbus_args=(--sh-syntax)
case "$1" in
awesome) dbus_args+=(awesome) ;;
bspwm) dbus_args+=(bspwm-session) ;;
budgie) dbus_args+=(budgie-desktop) ;;
cinnamon) dbus_args+=(cinnamon-session) ;;
deepin) dbus_args+=(startdde) ;;
enlightenment) dbus_args+=(enlightenment_start) ;;
fluxbox) dbus_args+=(startfluxbox) ;;
gnome) dbus_args+=(gnome-session) ;;
i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
jwm) dbus_args+=(jwm) ;;
kde) dbus_args+=(startplasma-x11) ;;
lxde) dbus_args+=(startlxde) ;;
lxqt) dbus_args+=(lxqt-session) ;;
mate) dbus_args+=(mate-session) ;;
xfce) dbus_args+=(xfce4-session) ;;
openbox) dbus_args+=(openbox-session) ;;
*) dbus_args+=("$1") ;;
esac

echo "dbus-launch ${dbus_args[*]}"
}

exec $(get_session "$SESSION")
3G이용자
IP 119.♡.24.253
01-15 2024-01-15 14:59:02
·
여전히 그대로라면, 그 다음에는 아마
/etc/xrdp/sesman.ini
파일에서 어느 것으로 지정되어 있는지 확인해 보고
/etc/X11/xrdp/xorg_nvidia.conf
/etc/X11/xrdp/xorg.conf
중에서 지정된 파일의 내용을 살펴보고 확인해 봐야 할 것 같은데요.
사실 이 파일들은 자동생성되어 있을 것이므로 사용자가 건드릴 필요가 없는 부분일텐데...
원격접속 관련된 디바이스들이 정의되어 있고,
특히 사용되는 스크린도 정의되어 있기 때문에
스크린 부분을 확인해 보셔야 할 것 같아요.

제 경우에는 모니터가 달려있지 않은 헤드레스 컴퓨터에 접근하기 때문에
Virtual Display로 설정이 되어 있고, 스크린 넘버는 0로 지정되어 있어서
스크린이 고정되어 있어서
로그인할 때 마다 새로운 스크린에 새로운 세션이 뜨지는 않는 것으로 이해하고 있습니다.
로그인 할 때 마다 새로운 가상스크린으로 새롭게 세션이 시작된다면,
이 부분의 내용이 먹히고 있지 않다는 의미일 것 같기 때문에
어디서 그렇게 작동하는지를 추적하면 알아낼 수 있지 않을까 싶습니다.
김원철
IP 221.♡.145.243
01-15 2024-01-15 15:48:02
·
@3G이용자님

/etc/xrdp/sesman.ini

[Globals]
ListenAddress=127.0.0.1
ListenPort=3350
EnableSSL=1
EnableUserWindowManager=true
UserWindowManager=startwm.sh
DefaultWindowManager=startwm.sh
ReconnectScript=reconnectwm.sh

[Security]
AllowRootLogin=true
MaxLoginRetry=4
TerminalServerUsers=tsusers
TerminalServerAdmins=tsadmins
AlwaysGroupCheck=false
RestrictOutboundClipboard=none
RestrictInboundClipboard=none

[Sessions]
X11DisplayOffset=10
MaxSessions=50
KillDisconnected=false
DisconnectedTimeLimit=0
IdleTimeLimit=0
Policy=Default

[Logging]
LogFile=xrdp-sesman.log
LogLevel=INFO
EnableSyslog=true

[LoggingPerLogger]

[Xorg]
param=Xorg
param=-config
param=xrdp/xorg.conf
param=-noreset
param=-nolisten
param=tcp
param=-logfile
param=.xorgxrdp.%s.log

[Xvnc]
param=Xvnc
param=-bs
param=-nolisten
param=tcp
param=-localhost
param=-dpi
param=96

[Chansrv]
FuseMountName=thinclient_drives
FileUmask=077

[ChansrvLogging]
LogLevel=INFO
EnableSyslog=true

[ChansrvLoggingPerLogger]
[SessionVariables]
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
김원철
IP 221.♡.145.243
01-15 2024-01-15 15:48:25
·
/etc/X11/xrdp/xorg_nvidia.conf
없음

/etc/X11/xrdp/xorg.conf

Section "ServerLayout"
Identifier "X11 Server"
Screen "Screen (xrdpdev)"
InputDevice "xrdpMouse" "CorePointer"
InputDevice "xrdpKeyboard" "CoreKeyboard"
EndSection

Section "ServerFlags"
# This line prevents "ServerLayout" sections in xorg.conf.d files
# overriding the "X11 Server" layout (xrdp #1784)
Option "DefaultServerLayout" "X11 Server"
Option "DontVTSwitch" "on"
Option "AutoAddDevices" "off"
EndSection

Section "Module"
Load "dbe"
Load "ddc"
Load "extmod"
Load "glx"
Load "int10"
Load "record"
Load "vbe"
Load "xorgxrdp"
Load "fb"
EndSection

Section "InputDevice"
Identifier "xrdpKeyboard"
Driver "xrdpkeyb"
EndSection

Section "InputDevice"
Identifier "xrdpMouse"
Driver "xrdpmouse"
EndSection

Section "Monitor"
Identifier "Monitor"
Option "DPMS"
HorizSync 30-80
VertRefresh 60-75
ModeLine "1920x1080" 138.500 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +HSync +VSync
Modeline "1368x768" 72.25 1368 1416 1448 1528 768 771 781 790 +hsync -vsync
Modeline "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -hsync +vsync
EndSection

Section "Device"
Identifier "Video Card (xrdpdev)"
Driver "xrdpdev"
Option "DRMDevice" "/dev/dri/renderD128"
Option "DRI3" "1"
EndSection

Section "Screen"
Identifier "Screen (xrdpdev)"
Device "Video Card (xrdpdev)"
Monitor "Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "640x480" "800x600" "1024x768" "1280x720" "1280x1024" "1600x900" "1920x1080"
EndSubSection
EndSection
새로운 댓글이 없습니다.
이미지 최대 업로드 용량 15 MB
업로드 가능 확장자 jpg,gif,png,jpeg,webp
지나치게 큰 이미지의 크기는 조정될 수 있습니다.
목록으로
글쓰기
목록으로 댓글보기 이전글 다음글
아이디  ·  비밀번호 찾기 회원가입
이용규칙 운영알림판 운영소통 재검토요청 도움말 버그신고
개인정보처리방침 이용약관 책임의 한계와 법적고지 청소년 보호정책
©   •  CLIEN.NET
보안 강화를 위한 이메일 인증
안전한 서비스 이용을 위해 이메일 인증을 완료해 주세요. 현재 회원님은 이메일 인증이 완료되지 않은 상태입니다.
최근 급증하는 해킹 및 도용 시도로부터 계정을 보호하기 위해 인증 절차가 강화되었습니다.

  • 이메일 미인증 시 글쓰기, 댓글 작성 등 게시판 활동이 제한됩니다.
  • 이후 새로운 기기에서 로그인할 때마다 반드시 이메일 인증을 거쳐야 합니다.
  • 2단계 인증 사용 회원도 최초 1회는 반드시 인증하여야 합니다.
  • 개인정보에서도 이메일 인증을 할 수 있습니다.
지금 이메일 인증하기
등록된 이메일 주소를 확인하고 인증번호를 입력하여
인증을 완료해 주세요.