Tips/Ubuntu のバックアップソース(No.1)

#contents

----

*初期設定 [#a22060ed]
** 前提条件 [#a3fa0bc2]
Ubuntu 18.04.3 LTS (Bionic Beaver)

** ssh導入 [#u47977b5]

 sudo apt-get install ssh
 systemctl start sshd

** vnc導入 [#e5cf6d0f]
 sudo apt install xserver-xorg-core tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer -y
 sudo apt install ubuntu-gnome-desktop -y
 sudo systemctl start gdm

** xrdp [#xd13940b]
 sudo apt install -y xrdp
 sudo sed -e 's/^new_cursors=true/new_cursors=false/g' \
          -i /etc/xrdp/xrdp.ini
 sudo systemctl restart xrdp

 D=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
 cat <<EOF > ~/.xsessionrc
 export GNOME_SHELL_SESSION_MODE=ubuntu
 export XDG_CURRENT_DESKTOP=ubuntu:GNOME
 export XDG_DATA_DIRS=${D}
 export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
 EOF

 cat <<EOF | \
   sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla
 [Netowrkmanager]
 Identity=unix-user:*
 Action=org.freedesktop.color-manager.create-device
 ResultAny=no
 ResultInactive=no
 ResultActive=yes
 EOF

 sudo systemctl restart polkit