win10 远程ubuntu

目录

安装教程

How to install xrdp on Ubuntu

How to configure xrdp on Ubuntu

How to connect to Ubuntu from Windows 11

不能多用户登录


安装教程

本文转自:

How to Connect to Ubuntu Linux from Windows 11 - Website for Students

To get started with installing and configuring xrdp on Ubuntu, follow the steps below:

How to install xrdp on Ubuntu

xrdp works on desktop systems. You won’t be able to connect to systems without a desktop environment. On Ubuntu servers, you must install a desktop environment before using xrdp.

xrdp is available in Ubuntu default repositories. No need to add additional repositories to install. Simply run the commands below from the terminal to install it.

sudo apt update
sudo apt install xrdp

After installing, run the commands below to verify that it is installed and running.

sudo systemctl status xrdp

You should see similar result as shown below:

 xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-06-13 09:43:03 CDT; 1min 53s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
   Main PID: 37933 (xrdp)
      Tasks: 1 (limit: 4653)
     Memory: 1.1M
     CGroup: /system.slice/xrdp.service
             └─37933 /usr/sbin/xrdp

Jun 13 09:43:02 ubuntu2004 xrdp[37932]: (37932)(139757869672256)[INFO ] address [0.0.0.0] port>
Jun 13 09:43:02 ubuntu2004 xrdp[37932]: (37932)(139757869672256)[INFO ] listening to port 3389>

How to configure xrdp on Ubuntu

Now that you have xrdp installed on Ubuntu, configure it to make it so that connections can be made without facing numeral issues.

First, add xrdp user account to the ssl-cert certificate key file groups. By default xrdp uses the /etc/ssl/private/ssl-cert-snakeoil.key file which is readable only by users that are members of the “ssl-cert” group.

The ssl-cert key file plays an important role in connecting via remote desktop on Ubuntu.

sudo adduser xrdp ssl-cert 

Ouput:

Adding user xrdp' to groupssl-cert' …
Adding user xrdp to group ssl-cert
Done.

Next, add these lines into xrdp startup script to make help resolve some situations where users’ screens have black backgrounds.

Open the startup script file.

sudo gedit /etc/xrdp/startwm.sh 

Than add these lines to the end file and save.

Unset DBUS_SESSION_ADDRESS
Unset XDG_RUNTIME_DIR

Save the file and exit.

Restart xrdp service.

sudo systemctl restart xrdp 

Make sure firewall isn’t enabled and blocking port 3389.

sudo ufw allow from 10.0.2.0/24 to any port 3389
sudo ufw reload  

Replace the highlighted subnet with your own.

Log out of Ubuntu. Make sure you’re not already logged in to Ubuntu while attempting to connect via Remote Desktop Connation. You can’t be logged in to Ubuntu while you connect via RDP.

windows xrdp windows 11 log out

How to connect to Ubuntu from Windows 11

Now try connecting to Ubuntu via Remote Desktop Protocol (RDP).

windows 11 remote desktop connection to ubuntu

When prompted to accept the certificate, click Yes.

windows 11 remote desktop connection to ubuntu accept cert

Type in your username and password for the Ubuntu system.

xrdp ubuntu windows connection

That’s it!

windows 11 remote desktop connection ubuntu desktop

Conclusion:

This post showed you how to install and configure xrdp to provide remote desktop connection to Ubuntu. If you find any error above, please use the comment form below to report.

不能多用户登录

打开 /etc/pam.d/login

注释掉

#session  required   /lib/security/pam_limits.so
#session  required   pam_limits.so

1. 服务器桌面共享允许他人访问

在这里插入图片描述

2. 安装xrdp、vnc、xfce

sudo apt-get install xrdp
sudo apt-get install vnc4server
sudo apt-get install xubuntu-desktop
echo "xfce4-session" >~/.xsession

3. 修改 (决定能不能多人访问的一步)

sudo gedit /etc/xrdp/startwm.sh

在. /etc/X11/Xsession 上一行插入
xfce4-session

在这里插入图片描述

4.重启服务

sudo service xrdp restart

以下转自:https://blog.csdn.net/weixin_40469747/article/details/109090665 

还没试:

找了网上的所有方法都没有解决,重新安装xrdp好了一会儿还会出现display 0情况,偶然一次配置了ssh,然后就好了
   方法:
   1、安装ssh软件:
   sudo apt-get install openssh-server
   可能会出现安装包找不到的问题,只需要更新国内源就可以了
   2、启动ssh服务
   service sshd start
   3、查看服务的启动状态
    netstat -ntlp
    看到端口号为22的状态为监听
    tcp 0 0 0.0.0.0:22   LISTEN
这一篇也试试:

多用户远程访问Ubuntu18.04配置记录-拜师资源博客

ubuntu远程桌面断开后重回上次会话_anendless的专栏-CSDN博客

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值