Cài đặt Remote desktop (xrdp) cho Ubuntu 16,18

Bảo mật SSH

Thay thế file config với nội dung (Ubuntu 16.04)

rm /etc/ssh/sshd_config && nano /etc/ssh/sshd_config
service ssh restart // khởi động lại ssh

Cài đặt gói phần mềm xrdp

apt-get update && apt-get upgrade -y && apt-get -y install xrdp xfce4 xfce4-terminal tango-icon-theme xz-utils

Chuyển sang tài khoản con rồi chạy lệnh sau

echo xfce4-session > ~/.xsession

Sau đó khởi động lại xrdp

sudo service xrdp restart

Mở port, cài phầm mềm

Mở port cho xrdp

sudo ufw allow 3389/tcp
sudo ufw allow 8888/tcp
sudo ufw deny 22/tcp
sudo ufw enable

Cài Hitleap

cd ~/Downloads && wget -O "HitLeap Viewer.tar.xz" -P / root https://hitleap.com/viewer/download?platform=Linux ; tar -xf HitLeap\ Viewer.tar.xz

Xóa file rác mỗi ngày, cho vào crontab

@daily find /tmp -type f -atime +1 -exec rm {} \;

Tham khảo: https://gist.github.com/hehuan2112/54cca01be23973a9f8b369e8d0df216e