Ubuntu Server 설치 후 필요한 기본 설정
sudo apt update && sudo apt upgrade -ysudo vi /etc/network/interfacesdns-nameservers 8.8.8.8 8.8.4.4 1.1.1.1sudo vi /ect/resolv.confnameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1/ect/resolv.conf 파일 수정이 안될 경우 2)sudo rm /etc/resolv.conf ;# to remove the symlink
sudo vi /etc/resolv.conf ;# to create a regular filesudo dpkg-reconfigure tzdata sudo timedatectl set-local-rtc yes
sudo apt install net-tools openssh-server -y
sudo apt install ufw -ysudo ufw enablesudo ufw statussudo ufw allow sshsudo ufw allow from any to any port 3389sudo ufw reloadsudo apt install rsync -ysudo systemctl start rsyncsudo vi /etc/rsync.conf[web] -> 사용할 rsync 서비스 이름
path = /home/web -> 데이터원본 경로
comment = rsync_test -> 코멘트
uid = root -> 권한 사용자
gid = root -> 권한 그룹
use chroot = yes
read only = yes
hosts allow = 192.168.10.10 -> rsync 클라이언트IP, localhost일 경우 입력하지 않아도 된다
max connections = 10
timeout = 30sudo systemctl restart rsynccrontab -e0 3 * * * rsync -avrzp --delete {user}@{url}::{rsync section name} {destination directory}*/5 * * * * /usr/local/bin/curl -s 'https://ddns.dnszi.com/set.html?user={user id}&auth={auth key}&domain={domain}&record='0 5 1 * * tar zcfp /{dest dir}/archive-$(date +\%Y\%m\%d).tar.gz /{source dir}sudo ALL=NOPASSWD: /usr/sbin/service cron start
sudo systmctl daemon-reloadsudo apt install nfs-common cifs-utils -ysudo mkdir -p /mnt/{name to mount}sudo chmod 777 /mnt/{name to mount}mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds {source url} {destination directory}mount -t nfs {source url} {destination directory}sudo vi /etc/samba/.smbcredsusername={user id}
password={passwrod}sudo vi /etc/fstab//{source ip}/{directory} {destination directory} cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0sudo systemctl status xrdpsudo apt install xrdpsudo systemctl enable --now xrdpsudo adduser xrdp ssl-certlsb_release -auname -acat /etc/issuecat /etc/*release/etc/default/motd-news