Ubuntu / 시간대(time zone) 설정하는 방법

현재 서버의 시간대 확인

현재 서버에 설정된 시간대는 date 명령어로 확인할 수 있다.

root@jb-dev-01:~# date
Mon Dec  3 17:03:06 UTC 2018

시간대 설정 방법 1 - dpkg-reconfigure tzdata

시간대를 설정하고 싶다면 다음과 같이 명령한다.

dpkg-reconfigure tzdata

한국이라면 Asia를 선택하고 Seoul을 선택합니다.

시간대 설정 방법 2 - tzselect

tzselect 명령으로 설정할 수 있다. 번호를 입력하여 시간대를 정한다.

root@ubuntu-1804-server:~# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".
 1) Africa
 2) Americas
 3) Antarctica
 4) Asia
 5) Atlantic Ocean
 6) Australia
 7) Europe
 8) Indian Ocean
 9) Pacific Ocean
10) coord - I want to use geographical coordinates.
11) TZ - I want to specify the time zone using the Posix TZ format.
#?

다음과 같은 질문이 나오면 1을 입력한다.

Is the above information OK?
1) Yes
2) No
#?

하지만, 적용시키기 위해서는 .profile을 수정해야 한다.

You can make this change permanent for yourself by appending the line
        TZ='Africa/Algiers'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

따라서, 방법 1이 더 편하다.

시간대 설정 방법 3 - GUI

  • GUI 환경이라면 설정(Settings)으로 들어간다.

  • 왼쪽에서 Date & Time을 선택하고, 오른쪽에서 Time Zone을 클릭한다.

  • 원하는 시간대를 선택하면...

  • 바로 적용된다.

같은 카테고리의 다른 글
Ubuntu / Webmin / 설치하는 방법

Ubuntu / Webmin / 설치하는 방법

Webmin은 웹브라우저를 통해 시스템 관리를 하는 툴이다. Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a ...

Ubuntu 16.04 / phpMyAdmin / 특정 IP에서만 접속 가능하게 만드는 방법

Ubuntu 16.04 / phpMyAdmin / 특정 IP에서만 접속 가능하게 만드는 방법

우분투 16.04에서 phpMyAdmin을 패키지로 설치했을 때, 기본 설정은 모든 IP에서 접속 가능입니다. 만약 특정 IP에서만 접속 가능하게 하려면 /etc/apache2/conf-available/phpmyadmin.conf에 다음 코드를 추가합니다. <Directory /usr/share/phpmyadmin> Order deny,allow Deny from all Allow from xxx.xxx.xxx.xxx </Directory> xxx.xxx.xxx.xxx는 접속하려는 IP로 바꿉니다. 여러 IP를 설정하고 싶을 때는 띄어쓰기로 구분합니다. <Directory /usr/share/phpmyadmin> Order deny,allow Deny from all ...

Ubuntu 18.04 / 빠르게 다운로드하는 방법

Ubuntu 18.04 / 빠르게 다운로드하는 방법

우분투 다운로드 우분투 다운로드는 보통 우분투 홈페이지에서 합니다. 상단의 Downloads 메뉴를 클릭하고 안내를 따라가면 됩니다. 그런데, 우분투 홈페이지를 통해 다운로드를 받으면 전송 속도가 느릴 수 있습니다. 만약 너무 느리다면 가까운 미러 사이트에 직접 접속하여 다운로드해보세요. 빠르게 다운로드를 할 수 있습니다. 카카오 서버 한국이라면 카카오 서버가 빠릅니다. 우분투 페이지로 간 다음 원하는 버전을 선택합니다. 데스크톱 이미지와 ...

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

Ubuntu Server / 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 방화벽을 사용 중이라면 다음과 같이 명령하여 포트를 열어줍니다. ufw ...

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

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 등은 네트워크 환경에 ...

Ubuntu 16.04 / 메모

Ubuntu 16.04 / 메모

PHP intl 설치 apt install php-intl service apache2 reoad APCu 설치 apt install php-apcu service apache2 reload

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

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 만약 위와 같이 해도 ...

Ubuntu Server / PHP 최신 버전으로 업그레이드하는 방법

Ubuntu Server / PHP 최신 버전으로 업그레이드하는 방법

Ubuntu 패키지로 설치한 PHP 버전보다 PHP 최신 버전이 더 높을 수 있습니다. 예를 들어 패키지로 설치한 PHP의 버전은 7.0, 최신 버전은 7.2일 수 있다는 것이죠. 만약 최신 버전의 PHP를 사용해야 한다면 다음의 방법으로 설치할 수 있습니다. PHP를 처음 설치하는 경우 저장소를 추가합니다. add-apt-repository ppa:ondrej/php 패키지 정보를 업데이트합니다. apt-get update PHP를 설치합니다. apt-get install php PHP가 설치되어 있는 경우 저장소를 ...

Ubuntu 18.04 / 메모

Ubuntu 18.04 / 메모

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

Ubuntu Server / Samba / 설치하고 공유 폴더 만드는 방법

Ubuntu Server / Samba / 설치하고 공유 폴더 만드는 방법

Samba를 이용하여 Ubuntu Server에 공유 폴더를 만들고, Windows 클라이언트에서 접속하는 방법을 알아본다. Samba 설치 Samba를 설치한다. 설치하면 바로 시작하고, 재부팅을 해도 자동으로 시작한다. apt install samba 공유할 폴더를 만들고 권한을 777로 설정한다. mkdir /sharedfolder chmod 777 /sharedfolder 설정 파일은 /etc/samba/smb.conf이다. 텍스트 에디터로 열고 제일 밑에 다음 코드를 추가한다. 폴더 이름은 sharedfolder이지만, 네트워크에서는 Shared Folder로 보인다. comment = ...