惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
博客园 - 叶小钗
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
TaoSecurity Blog
TaoSecurity Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
爱范儿
爱范儿
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
量子位
N
News and Events Feed by Topic
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Commits to openclaw:main
Recent Commits to openclaw:main
SecWiki News
SecWiki News
MyScale Blog
MyScale Blog
AI
AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 【当耐特】
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
有赞技术团队
有赞技术团队
W
WeLiveSecurity
Project Zero
Project Zero
T
Tor Project blog
Help Net Security
Help Net Security
L
LINUX DO - 最新话题
IT之家
IT之家
The Hacker News
The Hacker News
腾讯CDC
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
C
Cisco Blogs
博客园 - 聂微东
Webroot Blog
Webroot Blog
Forbes - Security
Forbes - Security
M
MIT News - Artificial intelligence
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans

IT Notes - jail

IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes IT Notes
IT Notes
Stefano Marinelli · 2023-12-13 · via IT Notes - jail

How to Create a FreeBSD Jail Hosting XRDP and XFCE for Remote Desktop Access

Introduction

This tutorial guides you through the process of setting up a FreeBSD jail that hosts XRDP and XFCE. This setup enables secure remote desktop access.

Prerequisites

  • FreeBSD system
  • Basic knowledge of FreeBSD jails using BastilleBSD
  • SSH access to the FreeBSD server

Step 1: Create a New Jail with Bastille

First, we create a new jail using BastilleBSD. The following command initializes a jail named xfce with FreeBSD 14.1-RELEASE on IP 10.0.0.200:

bastille create xfce 14.1-RELEASE 10.0.0.200 bastille0

After creating the jail, modify its configuration (in a default environment, it would be /usr/local/bastille/jails/xfce/jail.conf) to enable certain features. Default configuration of xrdp needs an IPv6 address:

sysvshm = new;
allow.mount.procfs = 1;
ip6.addr = "fd12:3456:789a:1::1";

Step 2: Restart the Jail

Restart the jail to apply the new settings:

bastille restart xfce

Step 3: Install XRDP and XFCE

Access the jail's console, and install XRDP and XFCE:

bastille console xfce
pkg install xorg xrdp xfce

Step 4: Configure XRDP

Enable XRDP services by adding the following lines to your jail's /etc/rc.conf:

xrdp_enable="YES"
xrdp_sesman_enable="YES" # Enable if running xrdp-sesman on the same machine

Step 5: Modify the startwm script

Edit the /usr/local/etc/xrdp/startwm.sh file:

Uncomment exec startxfce4 to ensure XFCE is started with XRDP.

Step 6: Add a User

Create a user in the jail for remote access:

adduser

Follow the prompts to set up the user.

Step 7: Secure the Connection

Never expose the RDP port directly. Instead, use an SSH tunnel:

  1. Restart the jail. Establish an SSH tunnel from your local machine to the host machine of the jail, forwarding the traffic to the jail's IP address (10.0.0.200) on port 3389, which is the default port for xrdp.
  2. Connect to the jail using an RDP client through the tunnel.

You now have a secure, remote desktop environment using XFCE within a FreeBSD jail, accessible through an SSH tunnel. This setup is ideal for managing isolated environments or for secure, remote workspace solutions.