Ubuntu 22.04 Server / 고정 IP 설정하는 방법

설정 파일 수정하기

  • 네트워크 설정 파일은 /etc/netplan 디렉토리 안에 있는 yaml 파일이다.
  • DHCP로 설치했다면, 설정 파일 내용은 다음과 비슷하게 되어 있다.
# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2
  • 다음과 같이 수정하고 저장한다. IP 등은 네트워크 환경에 맞게 적절히 수정한다.
  • via에 있는 IP는 게이트웨이이다.
# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      addresses: [192.168.0.227/24]
      routes:
        - to: default
          via: 192.168.0.1
      nameservers:
        addresses: [8.8.8.8,8.8.4.4]
  version: 2
  • 다음과 같이 명령하면 설정 변경 사항이 적용된다.
netplan apply

GUI에서 설정하기

  • 오른쪽 위의 네트워크 아이콘을 클릭하고, Wired Connected를 클릭하여 하위 메뉴를 확장하고, Wired Settings를 클릭한다.

  • Network에서 설정 아이콘을 클릭한다.

  • 적절히 설정하고 Apply를 클릭한다.

  • 토글 버튼을 클릭하여 네트워크를 재시작한다.

만약 Wired Unmanaged라고 되어 있다면 네트워크 설정을 할 수 없다.

/etc/netplan 디렉토리 안에 있는 yaml 파일에 renderer: NetworkManager를 추가하면 해결된다.

# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2
  renderer: NetworkManager
같은 카테고리의 다른 글

Ubuntu 24.04 Server / 고정 IP 설정하는 방법

네트워크 설정 파일은 /etc/netplan 디렉토리 안에 있는 yaml 파일입니다. 파일 이름은 시스템마다 다를 수 있습니다. # ll /etc/netplan total 12 drwxr-xr-x 2 root root 4096 Apr 27 23:00 ./ drwxr-xr-x 108 root root 4096 Apr 27 23:06 ../ -rw------- 1 root root 389 Apr 27 23:00 50-cloud-init.yaml DHCP라면 설정 파일이 다음과 ...

Ubuntu 18.04 / 메모

SSH 설정 설정 파일 /etc/ssh/sshd_config 포트 변경하기 다음 코드를 #Port 22 다음처럼 바꾼다. Port 1234 포트 번호는 자신이 원하는 것으로... root 계정 로그인 가능하게 만들기 다음 코드를 #PermitRootLogin prohibit-password 다음처럼 만든다. PermitRootLogin yes 설정 변경 적용하기 service ssh restart

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu Server는 CLI(Command Line Interface) 환경으로 설치된다. 그런데 어떤 작업은 GUI(Graphical Uer Interface) 환경에서 하는 것이 편하다. 만약 GUI 환경이 필요하다면 설치하여 사용할 수 있다. GUI 패키지에는 kubuntu-desktop lubuntu-desktop ubuntu-desktop ubuntu-desktop-minimal xubuntu-desktop 등이 있다. 주로 ubuntu-desktop 또는 ubuntu-desktop-minimal을 사용하는 듯 하다. 예를 들어 ubuntu-desktop-minimal을 설치한다면, 다음과 같이 명령하면 된다. # apt install ubuntu-desktop-minimal Minimal임에도 불구하고 꽤 많은 저장소 공간이 필요하다. After ...

Ubuntu Server 22.04 / vsftpd로 FTP 서버 구축하기

vsftpd vsftpd(Very Secure FTP Daemon)는 유닉스와 리눅스에서 사용할 수 있는 가벼운 FTP 서버입니다. 주요 특징은 다음과 같습니다. Virtual IP configurations Virtual users Standalone or inetd operation Powerful per-user configurability Bandwidth throttling Per-source-IP configurability Per-source-IP limits IPv6 Encryption support through SSL integration 설치 vsftpd는 우분투 패키지에 포함되어 있으므로 다음과 같이 명령하여 설치할 수 있습니다. # apt install vsftpd 방화벽을 사용 중이라면 다음과 같이 명령하여 포트를 ...

Ubuntu 22.04 Server / Apache, PHP, MariaDB 설치하는 방법

Ubuntu 22.04 Server / Apache, PHP, MariaDB 설치하는 방법

Ubuntu Server에 웹서버 Apache, 웹프로그래밍 언어 PHP, 데이터베이스 MariaDB를 설치하는 방법입니다. 웹서버 운영을 위한 최소한의 설치로, 실제로 서비스할 때는 더 많은 패키지가 필요할 수 있습니다. 설치 Apache, PHP, MariaDB를 설치합니다. php-mysql은 PHP와 MariaDB 연동을 위한 패키지입니다. # apt install apache2 mariadb-server php php-mysql MariaDB 설정 다음과 같이 명령하여 몇 가지 설정을 합니다. # mysql_secure_installation MariaDB의 root 계정 ...

Ubuntu Server / Let’s Encrypt 무료 SSL 인증서 발급 받기

Ubuntu Server에서 Apache Web Server를 사용하는 경우 Let’s Encrypt 인증서 발급 받는 방법이다. Apache용 Certbot 설치 Ubuntu Server 20.04, Ubuntu Server 22.04 snap install core snap refresh core snap install --classic certbot ln -s /snap/bin/certbot /usr/bin/certbot Ubuntu Server 18.04 apt install software-properties-common add-apt-repository universe add-apt-repository ppa:certbot/certbot apt update apt upgrade apt install certbot python3-certbot-apache Ubuntu Server 16.04 add-apt-repository ppa:certbot/certbot apt update apt upgrade apt install python-certbot-apache 인증서 발급 abc.com 인증서 ...

Ubuntu 16.04 / Apache / javascript 폴더 접근이 안되는 문제 해결하는 방법

javascript 폴더 접근 불가 우분투(Ubuntu)에서 아파치(Apache)로 웹서버를 운영할 때 이상한 문제가 하나 발생합니다. 사이트 경로에 javascript가 있으면 forbidden 에러가 나는 것입니다. Forbidden You don't have permission to access /javascript/ on this server. 이 문제가 발생하는 이유는 자바스크립트 설정 때문입니다. /etc/apache2/conf-available/javascript-common.conf에 다음과 같은 코드가 있습니다. Alias /javascript /usr/share/javascript/ javascript로 접속하면 /usr/share/javascript/로 연결시키라는 뜻입니다. 사이트 접속자는 /usr/share/javascript/에 접속 권한이 없으므로 forbidden 에러가 ...

Ubuntu 22.04 Server / 원격 데스크톱으로 연결하는 방법

Ubuntu 22.04 Server / 원격 데스크톱으로 연결하는 방법

GUI 설치 우분투에 GUI를 설치한다. # apt install ubuntu-desktop-minimal xrdp 설치 xrdp를 설치한다. # apt install xrdp 방화벽 설정 원격 데스크톱은 3389 포트를 사용하므로, 방화벽을 사용하고 있다면 포트를 열어 준다. ufw allow 3389/tcp 원격 데스크톱 연결 원격 데스크톱으로 접속한다. 아래와 같은 창이 뜨는데, 를 클릭한다. 계정 정보를 입력하고 를 클릭하면... 원격지에서 GUI로 우분투를 즐길 수 있다.

Ubuntu 20.04 / 글꼴 설치하는 방법

Ubuntu 20.04 / 글꼴 설치하는 방법

Ubuntu 20.04 Desktop 설치하려는 글꼴을 더블 클릭하거나, 글꼴 선택 후 엔터키를 누르거나, 마우스 우클릭 후 를 클릭합니다. 상단에 있는 를 클릭합니다. 설치가 완료되면 으로 바뀝니다. 글꼴이 잘 설치되었는지 확인합니다.

Ubuntu 24.04 Server / SSH / 포트 변경하는 방법

보안 등의 이유로 SSH 포트를 변경해야 한다면, 다음과 같이 한다. /etc/ssh/sshd_config에서 다음의 코드를... #Port 22 다음으로 변경한다. Port 1980 방화벽이 활성화되어 있다면 1980 포트를 열어준다. ufw allow 1980/tcp SSH 서비스를 다시 시작한다. systemctl restart ssh SSH 서비스를 다시 시작해도 적용되지 않으면, 컴퓨터를 다시 시작한다.