This is an old revision of the document!


Setting Up Ubuntu Server (우분투 서버 설정하기)

Ubuntu Server 설치 후 필요한 기본 설정
  • 패키지 설치 시 반드시 먼저 실행
    sudo apt update && sudo apt upgrade -y
    • 업데이트 실패 시 dns 확인 및 설정 1)
      • sudo vi /etc/network/interfaces
        • 내용 추가
          dns-nameservers 8.8.8.8 8.8.4.4 1.1.1.1
      • sudo vi /ect/resolv.conf
        • 내용 추가
          nameserver 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 file

sudo dpkg-reconfigure tzdata

sudo apt install net-tools openssh-server -y

  1. ufw 패키지 설치 (설치 전 패키지 업데이트)
    sudo apt install ufw -y
  2. ufw 사용 설정
    sudo ufw enable
  3. ufw 상태 확인
    sudo ufw status
  4. ssh 허용 설정
    sudo ufw allow ssh
    • 예제) 3389 포트 허용 설정
      sudo ufw allow from any to any port 3389
  5. ufw 설정 적용
    sudo ufw reload
  1. cron 설정 실행
    crontab -e
  2. 내용 편집
    • 예제1) rsync 매일 오전 3시에 실행
      0 3 * * * rsync -avrzp --delete {user}@{url}::{rsync section name} {destination directory}
    • 예제2) ddns 업데이트 실행
      */5 * * * * /usr/local/bin/curl -s 'https://ddns.dnszi.com/set.html?user={user id}&auth={auth key}&domain={domain}&record='
  3. sudo 없이 cron 실행 설정
    sudo ALL=NOPASSWD: /usr/sbin/service cron start
    sudo systmctl daemon-reload
  1. 네트워크 드라이브 연결에 필요한 패키지 설치 (설치 전 패키지 업데이트)
    sudo apt install nfs-common cifs-utils -y
  2. 마운트할 디렉토리 생성
    sudo mkdir -p /mnt/{name to mount}
  3. 디렉토리 권한 설정
    sudo chmod 777 /mnt/{name to mount}
  4. 드라이브 마운트
    • samba
      mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds {source url} {destination directory}
    • nfs
      mount -t nfs {source url} {destination directory}
  5. 부팅시 자동 마운트 설정
    1. 인증 정보 파일 생성
      sudo vi /etc/samba/.smbcreds
      • 내용 편집
        username={user id}
        password={passwrod}
    2. file system table 편집
      sudo vi /etc/fstab
      • //{source ip}/{directory} {destination directory} cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0
  1. xrdp 상태 확인
    sudo systemctl status xrdp
  2. xrdp 패키지 설치 (설치 전 패키지 업데이트)
    sudo apt install xrdp
  3. xrdp 데몬 실행
    sudo systemctl enable --now xrdp
  4. xrdp 사용자 추가
    sudo adduser xrdp ssl-cert

  • public/computer/setting_up_ubuntu_server.1747399562.txt.gz
  • Last modified: 2025/05/16 21:46
  • by alex