Terminal Boss
Total Page:16
File Type:pdf, Size:1020Kb
:FM<IJKFIP xrdp BfejkXek`e8e[ifjfm#=fkfc`X Jlggfik`e^N`e[fnjk\id`eXcZc`\ekj]ifdC`elon`k_oi[g K<ID@E8C9FJJ Xrdp helps your Windows terminal clients connect to Linux. BY KEN HESS indows-to-Linux remote desk- Once connected and authenticated to the new Linux user or Windows Admin- top connectivity is often band- the Linux RDP server, the remote user is istrator, you’ll need the following: Nwidth intensive, insecure, and presented a Linux graphical desktop. difficult to configure. What if a remote The best part is you don’t have to run an Windows users could establish a con- X server on your Windows computer or server, nection to a Linux system as easily as export your Linux display to the Win- connecting to a Windows system – and dows computer. Also, you’ll need to navigate the Linux using the same application used to con- Setting up the RDP server on Linux is filesystem, use some basic DOS-like nect to Windows? easy and only takes a few minutes. For commands, and understand basic net- Xrdp is an open source implementa- work connectivity. It also helps if you tion of RDP (Remote Desktop Protocol), Table 1: Linux Runlevels the protocol used with Windows Termi- 0 Halt nal Services for native Windows desktop 1 Single-user mode connectivity. The xrdp package provides 2 Multiuser, without NFS RDP functionality, along with an X 3 Full multiuser mode server capable of accepting connections 4 Unused from rdesktop [1] and Windows Termi- 5 X11 (GUI) nal Server clients. =`^li\(1I\dfk\;\jbkfg:fee\Zk`fen`e[fn% 36 ISSUE 97 DECEMBER 2008 036-039_rdp.indd 36 16.10.2008 16:51:55 Uhr xrdp :FM<IJKFIP xrdp and approached the situation as if I To connect to your Linux computer’s were a Windows administrator, assum- RDP service from a Windows computer, ing things would work out of the box select Start | Programs | Accessories | without a lot of tweaking, it didn’t take Communications | Remote Desktop long for this Windows approach to frus- Connection. (On some Windows com- trate me, so I began poking around in puters, this is under Start | Programs | the /usr/local/xrdp directory a bit and Accessories | Remote Desktop Connec- speaking via email with one of the xrdp tion). Enter the name or IP address of developers. your Linux computer and click Connect, Eventually, I discovered the answers as shown in Figure 1. myself. Once the system is installed, you The RDP client opens a new dialog, as need to issue the following commands shown in Figure 2, prompting you for a =`^li\)1<ek\ipfliC`elojpjk\dLj\i as root: User name and Password. This username eXd\Xe[GXjjnfi[% and password corresponds to your user # cd /usr/local/xrdp account on the Linux server system. know a little about RDP and optimizing # cp xrdp_control.sh 5 Enter your valid Linux username and client settings. /etc/init.d/xrdp_control password, and click OK. Even if you join # chkconfig - -add xrdp_control your Linux computers to an Active Di- @ejkXccXk`feXe[J\klg # chkconfig xrdp_control on rectory domain, you’ll need to add each First, download the xrdp source package # service xrdp_control start user to the Linux systems you want to [2], then unzip and untar the package: access via RDP. The xrdp_control.sh script controls xrdp To add users, first create a group for all $ tar zxvf xrdp-0.4.1.tar.gz start, stop, and restart functionality. RDP users: When I copied the script to the /etc/ All source files are now in the xrdp-0.4.1 init.d directory, I changed its name be- # groupadd rdpusers directory. Then you need to change into cause there, the .sh is superfluous and # useradd -g rdpusers ajones that directory and compile: typically not used. # passwd ajones The chkconfig command provides a cd xrdp-0.4.1 way of maintaining, updating, and que- If the user already exists on the system, $ make rying information for system services by the usermod command adds ajones to alleviating the need to manually manip- the rdpusers group: Use sudo or su to become root and run: ulate these services. To create a new startup service, copy # usermod -G rdpusers ajones # make install its control script to /etc/init.d, as shown above, then use chkconfig to add the Although not specifically required for ac- The executable files, scripts, and librar- service. The line chkconfig xrdp_control cess, a special user group simplifies ad- ies install to /usr/local/xrdp, and the on defines the runlevels for the service ministration for that group. Enter your configuration files install to /etc/xrdp. (Table 1). For instance, # chkconfig username and password, then click OK. The documentation is a bit unclear as - -level 35 xrdp_control on sets xrdp_con- The screen shown in Figure 3 appears, to what to do next. Although I decided trol to run in runlevels 3 and 5. The final which is the Session Manager Connec- against changing any parameters in the command starts the services sesman and tion Log showing the negotiation be- sesman.ini and xrdp.ini files under /etc/ xrdp. tween client and server. Note the Session =`^li\*1K_\oi[gJ\jj`feDXeX^\i:fee\Zk`feCf^% =`^li\+18[\jbkfgZfee\Zk`fefg\e]fiYlj`e\jj% DECEMBER 2008 ISSUE 97 37 036-039_rdp.indd 37 16.10.2008 16:51:57 Uhr :FM<IJKFIP xrdp =`^li\,1ME:Ëj<e[J\jj`fe[`Xcf^% =`^li\-1K_\oi[gcf^`ejZi\\e% Manager first connects to the RDP port, tempts a connection to the RDP server, Address specified in the /etc/xrdp/xrdp. then to the VNC port to present the the server and client negotiate an en- ini file. desktop to you. Figure 4 shows my cryption level; keys and server capabili- The user’s login credentials, screen Cent OS 5 desktop. ties are exchanged. resolution, and color depth pass to ses- When disconnecting from a Linux The client chooses the session color man for authentication. RDP session, you’ll see the screen depth and screen resolution. If sesman finds a running session with shown in Figure 5. Notice that the only If the user enters a username and the specified resolution and color depth, two actions available are End Current password in the client software, authen- it returns that display to the user; other- Session and Cancel, which is a standard tication begins; otherwise, the user se- wise, it starts a new xvnc instance with feature of VNC remote connections. lects the module from a drop-down list the user’s desktop specifications. and enters a username and password at ?fn@kNfibj the xrdp login screen, as shown in Fig- JlddXip The Linux server runs xrdp and sesman, ure 6. Xrdp is easy to install, configure, cus- listening for RDP connections. Once a The libvnc module loads, and a TCP tomize, and use. To work with this capa- Windows Terminal Server client at- connection is made to 127.0.0.1 or the IP ble product, you don’t need years of Linux experience. With nothing to install Xrdp FAQ on the Windows side, you can’t go Some useful facts about xrdp: find the binary at http:// server1. xrdp. org/ wrong with xrdp. Does RDP provide a remote control ses- temp. Although I haven’t performed any sion? What are the prerequisites for installing extensive network speed or bandwidth No, it is a remote terminal session, just xrdp? analysis with this product, because it’s like a Windows Terminal Server client ses- You need make, gcc, PAM headers, and RDP, you can be sure that performance sion. OpenSSL headers. begins to suffer as the number of simul- Why don’t I have to run an X server on Are my Windows-to-Linux RDP sessions taneous users approaches the two dozen Windows and export my display? encrypted? mark. However, I really like xrdp, and it Because the Linux server supplies a desk- Yes, that is the RDP standard. Available is now part of my standard cross-plat- top session through the VNC protocol, you encryption includes 40-bit one-way, 40-bit form arsenal. p won’t need to run an X server. two-way, and 128-bit two-way for low, me- Do I need a VNC server to use xrdp? dium, and high encryption, respectively. INFO I notice you use the KDE desktop. Is that If you aren’t going to use X11rdp, you will [1] Rdesktop: http:// www. rdesktop. org need a VNC server; however, you can only my only option? [2] Xrdp: http:// xrdp. sourceforge. net connect using one of those two protocols. No, you may run any window manager On the Windows computer, you do not you like, but it must exist on the Linux sys- need a VNC client or VNC server. tem and set up in the /usr/local/xrdp/ Ken is a freelance technical writer and If I want to use X11rdp, should I compile it startwm.sh file. Move the window man- journalist. He covers a variety of open or use the binary version from xrdp.org? ager you want to the top of the file, and source topics, including Linux, data- issue a force-reload to xrdp as root with: You can do either. If you are lucky, the bi- bases, and virtualization. Reach him nary will work for you because recompil- # service xrdp_control 5 via his website at www. kenhess. com. ing X is time consuming and painful, and force-reload. Thanks to Jay Sorg of xrdp and Matt it can cause your X server to be de-opti- Don’t run the startwm.sh file from the Chapman of the rdesktop project for mized, or worse, not to work at all.