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

  • 네트워크 설정 파일은 /etc/network/interfaces이다.
  • 우분투를 DHCP로 설치했다면 설정 파일의 내용은 다음과 비슷하게 되어 있다.
# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp
  • 이를 다음처럼 변경하고 저장한다. xxx.xxx.xxx.xxx는 네트워크 환경에 맞게 수정한다.
# The primary network interface
auto enp0s3
iface enp0s3 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
dns-nameservers xxx.xxx.xxx.xxx
  • 다음과 같이 명령하여 네트워크를 재시작한다.
systemctl restart networking.service
  • 만약 위와 같이 해도 IP가 바뀌지 않는다면 재부팅한다.
같은 카테고리의 다른 글
Ubuntu Server / 22.04 / 네트워크 세팅에 이더넷(Wired) 보이지 않을 때 해결 방법

Ubuntu Server / 22.04 / 네트워크 세팅에 이더넷(Wired) 보이지 않을 때 해결 방법

우분투 설정의 네트워크에 Wired가 보이지 않는다. 그것이 보여야 GUI로 IP 설정이 가능한데 말이다. 이를 보이게 하는 방법이 여러 가지가 있는 거 같은데, 내가 성공한 방법은... /etc/netplan/00-installer-config.yaml의 내용은 다음처럼 생겼을 것이다. # This is the network config written by 'subiquity' network: ethernets: eth0: dhcp4: true ...

Ubuntu 18.04 Server / Apache / 사용자 인증 만드는 방법

Ubuntu 18.04 Server / Apache / 사용자 인증 만드는 방법

웹사이트의 콘텐츠를 특정 사용자만 볼 수 있게 하는 방법은 여러 가지가 있습니다. 만약 웹서버에 대한 충분한 권한이 있다면, Apache를 이용하여 구현할 수 있습니다. 비밀번호 파일 만들기 비밀번호 파일은 htpasswd 명령어로 만듭니다. /home/auth/ 디렉토리에 passwords라는 이름의 파일을 만들고, 사용자 user1의 비밀번호를 정하고 싶다면 다음과 같이 명령합니다. # htpasswd -c /home/auth/passwords user1 .htaccess 파일 만들기 웹사이트의 루트 ...

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

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

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 / 메모

MariaDB / 포트 변경 MariaDB의 기본 접속 포트는 3306입니다. 이를 다른 포트로 변경하고 싶다면 /etc/mysql/mariadb.conf.d/50-server.cnf를 수정합니다. port = 3306 을 찾아서 원하는 포트로 변경한 후 저장합니다. 그리고 MariaDB를 재시작합니다. service mysql restart MariaDB / Can't connect to MySQL server on ... (10061) 다음과 같은 에러를 만났다면... Can't connect to MySQL server on ... (10061) /etc/mysql/mariadb.conf.d/50-server.cnf에 있는 bind-address = 127.0.0.1 를 ...

Ubuntu 14.04 / LESS 설치하는 방법

우분투 14.04에 LESS를 설치하는 방법을 메모합니다. Node.js 설치 apt-get install nodejs NPM 설치 apt-get install npm LESS 설치 npm install -g less less-plugin-clean-css /usr/local/bin/lessc 파일 첫 줄에 다음과 같은 코드가 있습니다. #!/usr/bin/env node 다음처럼 바꿉니다. #!/usr/bin/env nodejs

Ubuntu 18.04 Server / Nginx, PHP, MariaDB 설치하고 설정하기

Ubuntu 18.04 Server / Nginx, PHP, MariaDB 설치하고 설정하기

Nginx 설치 Nginx를 설치합니다. # apt install nginx 만약 방화벽을 사용하고 있다면 포트를 열어줍니다. # ufw allow 'Nginx Full' 서버 주소로 접속했을 때 다음과 같이 나오면 제대로 된 것입니다. 시작, 정지 등 Nginx를 시작합니다. # systemctl start nginx Nginx를 멈춥니다. # systemctl stop nginx Nginx를 재시작합니다. # systemctl restart nginx Nginx를 다시 로드합니다. # systemctl reload nginx Nginx를 설치하면 부팅 시 자동으로 시작하게 설정됩니다. 만약 자동 ...

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라면 설정 파일이 다음과 비슷하게 되어 있다. # This file is ...

Ubuntu 22.04 Server / ZIP 압축 파일 푸는 방법

ZIP 파일을 압축 해제하기 위해서는 unzip 패키지가 필요하다. # apt install unzip xxx.zip 파일을 압축 해제하려면 다음과 같이 명령한다. # unzip xxx.zip 다음과 같이 명령하여 도움말을 볼 수 있다. # unzip -h 결과는 다음과 같다. UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP. Usage: unzip Default ...

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 인증서 ...