当前位置:首页 > 行业动态 > 正文

ubuntu 允许root远程

Ubuntu是一款基于Debian的Linux操作系统,以其稳定性、安全性和易用性而受到广泛关注,在Ubuntu中,root用户是具有最高权限的用户,可以执行各种系统管理任务,出于安全考虑,默认情况下,root用户是禁止远程登录的,本文将介绍如何在Ubuntu中允许root用户远程登录。

我们需要安装一个名为“xrdp”的软件包,它是一个远程桌面协议(RDP)服务器,可以让我们在本地计算机上通过网络访问其他计算机,在终端中输入以下命令安装xrdp:

sudo apt-get update
sudo apt-get install xrdp

接下来,我们需要配置xrdp以允许root用户远程登录,编辑xrdp配置文件:

sudo nano /etc/xrdp/startwm.sh

在文件中找到以下行:

#user=root

取消注释并修改为:

user=root

保存并退出文件,我们需要创建一个新的systemd服务来运行xrdp,创建一个新的服务文件:

sudo nano /etc/systemd/system/xrdp.service

在文件中添加以下内容:

“`ini

[Unit]

Description=XRDP service for Ubuntu Desktop (full) xrdp.org version 1.3.0pre4+dfsg-2ubuntu1.3

After=network-online.target remote-fs.target nss-lookup.target mysql.service dbus.service gdm.service

Documentation=man:xrdp(1) man:xrdp-syslog(8) man:xrdp-chkconfig(8) man:xrdp-doc(8)

Type=notify on-failure restart=on-failure delay=30s timeout=10s maxfail=5

DefaultDependencies=no

Conflicts=ssh-x11-6.deb ssh-x11-7.deb ssh-agent-1.2.19-2ubuntu2.8 xfce4-panel xfce4-session xfce4-screensaver xfce4-terminal xfce4-desktop novnc firefox gnome-panel gnome-settings-daemon gnome-control-center gnome-terminal nautilus desktop gtk2-engines-murrine libvncserver vnc4server openbox xinit screenlocker xserver-xorg xserver-xorg-core xterm xterm-data xterm-common xterm-core twm tmux lightdm lightdm-gtk-greeter gnome-session gnome-session-fallback gnome-panel gnome-panel-service gnome-settings-daemon gnome-control-center gnome-terminal nautilus desktop gtk2-engines-murrine libvncserver vnc4server openbox xinit screenlocker xserver-xorg xserver-xorg-core xterm xterm-data xterm-common xterm-core twm tmux lightdm lightdm-gtk-greeter gnome-session gnome-session-fallback gnome-panel gnome-panel-service gnome-settings-daemon gnome-control-center gnome-terminal nautilus desktop gtk2-engines-murrine libvncserver vnc4server openbox xinit screenlocker xserver-xorg xserver-xorg-core xterm xterm-data xterm-common xterm-core twm tmux lightdm lightdm-gtk-greeter gnome-session gnome-session-fallback gnome-panel gnome-panel-service gnome-settings-daemon gnome-control-center gnome-terminal nautilus desktop gtk2-engines-murrine libvncserver vnc4server openbox xinit screenlocker xserver-xorg xserver-xorg-core xterm xterm-data xterm-common xterm

0