{"id":578,"date":"2017-11-27T17:35:26","date_gmt":"2017-11-27T16:35:26","guid":{"rendered":"http:\/\/snakenet.eu\/blog\/?p=578"},"modified":"2022-03-13T11:50:45","modified_gmt":"2022-03-13T10:50:45","slug":"serveur-xrdp-sur-un-vps-ovh-debian-9","status":"publish","type":"post","link":"https:\/\/snakenet.eu\/blog\/serveur-xrdp-sur-un-vps-ovh-debian-9\/578\/","title":{"rendered":"Serveur xRDP sur un VPS (ovh) Debian 9"},"content":{"rendered":"<p><strong>create administrative account<\/strong><\/p>\n<p>useradd MyUsername -s \/bin\/bash -G sudo -m<br \/>\necho MyUsername:MyVerySecurePassword | chpasswd<\/p>\n<p><strong>Prevent root from login using SSH<\/strong><\/p>\n<p>sed -i &lsquo;s\/PermitRootLogin yes\/PermitRootLogin no\/g&rsquo; \/etc\/ssh\/sshd_config<br \/>\nservice ssh restart<\/p>\n<p><strong>Install programs<\/strong><\/p>\n<p>apt-get update<br \/>\napt-get install -y xrdp mate-core mate-desktop-environment mate-notification-daemon tigervnc-standalone-server<\/p>\n<p>\/etc\/init.d\/xrdp stop<br \/>\n\/etc\/init.d\/xrdp start<\/p>\n<p><strong>Tune XRDP tu use XVNC in priority<\/strong><\/p>\n<p>vi \/etc\/xrdp\/xrdp.ini and permut Xorg and Xvnc block&rsquo;s in the config file.<\/p>\n<p>[Xvnc]<br \/>\nname=Xvnc<br \/>\nlib=libvnc.so<br \/>\nusername=ask<br \/>\npassword=ask<br \/>\nip=127.0.0.1<br \/>\nport=-1<br \/>\n#xserverbpp=24<br \/>\n#delay_ms=2000<\/p>\n<p>[Xorg]<br \/>\nname=Xorg<br \/>\nlib=libxup.so<br \/>\nusername=ask<br \/>\npassword=ask<br \/>\nip=127.0.0.1<br \/>\nport=-1<br \/>\ncode=20<\/p>\n<p><strong>S\u00e9curiser le tout<\/strong><\/p>\n<p>apt-get install fail2ban<\/p>\n<p><strong>Install Firefox and test performance&#8230;<\/strong><\/p>\n<p>apt-get install firefox-esr firefox-esr-l10n-fr<\/p>\n<p><strong>Faire de la place sur le disque<\/strong><\/p>\n<p>On a un petit VPS, autant \u00e9conomiser la place&#8230;<\/p>\n<p>apt-get clean<\/p>\n<p><strong>Tuning<\/strong><\/p>\n<p>xrdp.ini :<\/p>\n<p>ls_background_image \u00e0 doit indiquer un fichier present dans \/usr\/share\/xrdp\/<br \/>\nls_top_window_bg_color=1a4384<br \/>\nls_height=350<br \/>\nls_bg_color=e4e3e8<br \/>\nls_btn_ok_y_pos=300<br \/>\nls_btn_cancel_y_pos=300<\/p>\n<p>\/etc\/init.d\/xrdp stop &amp;&amp; \/etc\/init.d\/xrdp start<\/p>\n<p><strong>openVPN<\/strong><\/p>\n<p>sudo apt-get install curl<br \/>\ncurl -O https:\/\/raw.githubusercontent.com\/Angristan\/openvpn-install\/master\/openvpn-install.sh<br \/>\nchmod +x openvpn-install.sh<br \/>\n.\/openvpn-install.sh<\/p>\n<p><strong>S\u00e9curiser<\/strong><\/p>\n<p>cat &gt; \/etc\/fail2ban\/filter.d\/openvpn.local &lt;&lt;EOF<br \/>\n# Fail2Ban filter for selected OpenVPN rejections<br \/>\n#<br \/>\n#<\/p>\n<p>[Definition]<\/p>\n<p># Example messages (other matched messages not seen in the testing server&rsquo;s logs):<br \/>\n# Fri Sep 23 11:55:36 2016 TLS Error: incoming packet authentication failed from [AF_INET]59.90.146.160:51223<br \/>\n# Thu Aug 25 09:36:02 2016 117.207.115.143:58922 TLS Error: TLS handshake failed<\/p>\n<p>failregex = ^ TLS Error: incoming packet authentication failed from \\[AF_INET\\]&lt;HOST&gt;:\\d+$<br \/>\n^ &lt;HOST&gt;:\\d+ Connection reset, restarting<br \/>\n^ &lt;HOST&gt;:\\d+ TLS Auth Error<br \/>\n^ &lt;HOST&gt;:\\d+ TLS Error: TLS handshake failed$<br \/>\n^ &lt;HOST&gt;:\\d+ VERIFY ERROR<\/p>\n<p>ignoreregex =<br \/>\nEOF<\/p>\n<p>cat &gt; \/etc\/fail2ban\/jail.d\/openvpn &lt;&lt;EOF<br \/>\n# Fail2Ban configuration fragment for OpenVPN<\/p>\n<p>[openvpn]<br \/>\nenabled = true<br \/>\nport = 1194<br \/>\nprotocol = udp<br \/>\nfilter = openvpn<br \/>\nlogpath = \/var\/log\/openvpn.log<br \/>\nmaxretry = 3<br \/>\nEOF<\/p>\n<p>To effect the configuration change:<br \/>\nservice fail2ban restart<\/p>\n<p><strong>Wireshark<\/strong><\/p>\n<p>apt-get -y install wireshark<br \/>\ngpasswd -a <span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">MyUsername<\/span> wireshark<\/p>\n","protected":false},"excerpt":{"rendered":"<p>create administrative account useradd MyUsername -s \/bin\/bash -G sudo -m echo MyUsername:MyVerySecurePassword | chpasswd Prevent root from login using SSH sed -i &lsquo;s\/PermitRootLogin yes\/PermitRootLogin no\/g&rsquo; \/etc\/ssh\/sshd_config service ssh restart Install programs apt-get update apt-get install -y xrdp mate-core mate-desktop-environment mate-notification-daemon tigervnc-standalone-server \/etc\/init.d\/xrdp stop \/etc\/init.d\/xrdp start Tune XRDP tu use XVNC in priority vi \/etc\/xrdp\/xrdp.ini and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-578","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts\/578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/comments?post=578"}],"version-history":[{"count":24,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts\/578\/revisions"}],"predecessor-version":[{"id":699,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts\/578\/revisions\/699"}],"wp:attachment":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/media?parent=578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/categories?post=578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/tags?post=578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}