journalctl 사용법

how to use journalctl 

view basic log

$ journalctl
 7월 29 16:25:57 VirtualBox systemd-journald[214]: Runtime journal (/run/log/journal/) is 8.0M, max 80.9M, 72.9M free.
 7월 29 16:25:57 VirtualBox kernel: Initializing cgroup subsys cpuset
 7월 29 16:25:57 VirtualBox kernel: Initializing cgroup subsys cpu
 7월 29 16:25:57 VirtualBox kernel: Initializing cgroup subsys cpuacct
 7월 29 16:25:57 VirtualBox kernel: Linux version 4.4.0-116-generic (buildd@lgw01-amd64-023) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #140-Ubuntu SMP Mon Feb 12 21:22:43 UTC 2018 (Ubuntu 4.4.0-116.140-generic 4.4.98)
 7월 29 16:25:57 VirtualBox kernel: KERNEL supported cpus:
 7월 29 16:25:57 VirtualBox kernel:   Intel GenuineIntel

view current boot log

$ journalctl -b

view specific time log

$ journalctl --since "2019-01-10" --until "2019-01-11 03:00"

view log by service

$ journalctl -u [service name]

tail log

$ journalctl -u [service name] -f
Posted by 사용자 guru_k

댓글을 달아 주세요

how to use systemctl command.

check systemd list

 systemctl list-unit-files

 

start systemd

systemctl start [service name]

 

stop systemd

systemctl stop [service name]

 

restart systemd

systemctl restart [service name]

 

enable systemd

systemctl enable [service name]

 

disable systemd

systemctl disable [service name]

 

reload systemd

systemctl reload [service name]

 

Posted by 사용자 guru_k

댓글을 달아 주세요

ubuntu ssh install (우분투 ssh 설치)


install ssh

1
$ apt-get install openssh-server
cs


start ssh

1
$ service ssh restart
cs


confirm Installation

1
2
3
$ dpkg --get-selections | grep openssh
openssh-client                    install
openssh-server                    install
cs

1
2
3
4
$ service ssh status
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since 일 2018-12-09 00:35:18 KST; 1 day 17h ago
cs


test connection

1
$ ssh <user ID>@<IP or HostName>
cs


Posted by 사용자 guru_k

댓글을 달아 주세요

ubuntu version check (우분투 버전 확인)


check ubuntu version

1
2
$ cat /etc/issue
Ubuntu 16.04.4 LTS \n \l
cs


1
2
3
4
5
6
$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:    xenial
cs


Posted by 사용자 guru_k

댓글을 달아 주세요

ubuntu telnet server install (우분투 텔넷 서버 설치)


install telnet server (텔넷 서버 설치)


1
$ sudo apt-get install xinetd telnetd

cs



Configure telnet server (텔넷 서버 설정)

add below script on /etc/xinetd.d/telnet 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ vi /etc/xinetd.d/telnet
 
-----------------------
 
# default: off
service telnet
{
 disable = no
 flags = REUSE
 socket_type = stream
 wait = no
 user = root
 server = /usr/sbin/in.telnetd
 log_on_failure += USERID
}

cs



Start telnet server (텔넷 서버 실행)

1
$ sudo /etc/init.d/xinetd restart
cs

Check telnet server (텔넷 서버 테스트)

1
$ telnet < IP or HostName >
cs

or

1
2
3
$ telnet
telnet> open
(to) < IP or HostName
cs

if this error occurs, you should check ACL.

1
2
3
$ telnet 192.88.19.11 23
Trying 192.88.19.11...
telnet: connect to address 192.88.19.11: Connection refused
cs


scan port


1
$ nmap -A <from IP>/32 -p 23
cs


23 port is closed 


1
2
3
4
5
6
7
$ nmap -192.88.19.23/32 -23
 
Starting Nmap 7.01 ( https://nmap.org ) at 2018-12-10 13:08 KST
Nmap scan report for aaa.com (192.88.19.23)
Host is up (0.0014s latency).
PORT   STATE  SERVICE VERSION
23/tcp closed telnet
cs



open 23 ports . be careful of openning ACL

1
$ sudo iptables -A IN_public_allow -p tcp -m tcp --dport 23 -m conntrack --ctstate NEW -j ACCEP
cs


connect telnet


1
2
3
4
5
$ telnet 192.88.19.11 23
Trying 192.88.19.11...
Connected to aaa.com.
Escape character is '^]'.
Password:
cs

done.


Posted by 사용자 guru_k

댓글을 달아 주세요

 - 리눅스 시스템 시간 보기

[root@root /]# date 


 - 리눅스 시스템 시간 보기 (시분초)

 [root@root /]# clock 

Posted by 사용자 guru_k
TAG It, Linux

댓글을 달아 주세요

1. 서울 시간대를 localtime에 연결

[root@root /]# ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime


2. 시간 체크

[root@root /]# rdate -p time.bora.net


3. 동기화

[root@root /]# rdate -s time.bora.net


4. 변경 확인

[root@root /]# date

 2015. 01. 20. (화) 20:09:51 KST

Posted by 사용자 guru_k

댓글을 달아 주세요