728x90
반응형

과감하게 집에있는 오래된 윈도우 데스크탑을 밀어버리고 우분투로 설치 했습니다. 

윈도우만 사용하다가 리눅스로 사용하려니 필요한 유틸이 많습니다. 

 

이번 글에서는 우분투에서 gif 로 움짤을 만드는 프로그램에 대한  설치 및 활용 방법에 대해 알아보겠습니다. 

 

우분투 애니매이션(gif,움잘) Peek 설치 

peek 를 설치 하겠습니다. 

우분투 에서는 ctl+alt +t 키가 콘솔 단축 키입니다. 

## peek 레파지토리 추가 
sudo add-apt-repository ppa:peek-developers/stable
sudo apt update
#peek 설치 
sudo apt install peek -y

 

Peek 실행 

window 키 를 눌러서 peek 입력후  검색 실행 합니다. 

 

 

우분투 peek
peek 실행 화면

peek 을 이용한 녹화 

Jmeter 테스트 진행 사항을 녹화해보았습니다. 

Record as GIF버튼을 누르면  녹화가 실행 됩니다. 

녹화파일은 videos 폴더에서 확인 하세요 

장문에 글로 설명하는 것보다 녹화해서 내용을 이해시키는게 보다 효과적인 방법일수도 있겠습니다. 

 

peek 을 이용한 gif 애니 메이션 녹화

728x90
반응형
728x90
반응형

리눅스 실행중인  프로세스가 없는데도 메모리 점유 하는 상황이 발생하는 경우에 대한 해결방법을 공유 합니다. 

 

시스템 메모리 사용량 확인 

특성 프로세스가 메모리를 점유하지 않음 에도 사용 가능한 free 메모리가 넉넉지 않다. 

  • free -h  : h 옵션은 human read 를 나타낸다.

  • top 명령으로 메모리 사용량 확인 

해결 방법

/proc/sys/vm/drop_caches 수행을 통해  메모리 반환이 가능 하다. 

리눅스 Kernels 2.6.16 이상에서 사용 가능 하며 

명령을 수행 하기 전에 sync 명령을 수행 하면 캐시 메모리에 올라간 데이터를 disk 로 내리는 작업을 진행 한다. 

pagecache 비우기

echo 1 > /proc/sys/vm/drop_caches

dentries and inodes 비우기

echo 2 > /proc/sys/vm/drop_caches

pagecache, dentries and inodes 한번에 비우기

echo 3 > /proc/sys/vm/drop_caches

 

테스트 결과 

[root@centos7:/root]$ sync
[root@centos7:/root]$ free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        982M        2.8G        314M         11G         13G
Swap:          7.8G         15M        7.8G
[root@centos7:/root]$ echo 1 > /proc/sys/vm/drop_caches
[root@centos7:/root]$ free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        981M         14G        314M        447M         13G
Swap:          7.8G         15M        7.8G
[root@centos7:/root]$ echo 2 > /proc/sys/vm/drop_caches 
[root@centos7:/root]$ echo 3 > /proc/sys/vm/drop_caches 
[root@centos7:/root]$ free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        978M         14G        314M        445M         13G
Swap:          7.8G         15M        7.8G
728x90
반응형
728x90
반응형

VSFTPD 이란?

vsftpd는 Linux를 포함한 Unix 계열 시스템 용 FTP 서버이며

very secure FTP daemon 의 약어 입니다. 

자세한 기능은 아래 페이지를 참고 하세요 

https://security.appspot.com/vsftpd.html

 

vsftpd - Secure, fast FTP server for UNIX-like systems

Probably the most secure and fastest FTP server for UNIX-like systems. About vsftpd vsftpd is a GPL licensed FTP server for UNIX systems, including Linux. It is secure and extremely fast. It is stable. Don't take my word for it, though. Below, we will see

security.appspot.com

 

1.VSFTPD 설치 팩키지 확인 및 설치 

rpm -qa | grep vsftpd
yum -y install vsftpd

2.vsftpd 상태확인

  • service vsftpd status
$ service vsftpd status
Redirecting to /bin/systemctl status vsftpd.service
* vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

 

3.vsftpd Command

 

systemctl restart vsftpd
systemctl enable vsftpd

 

 

 

 

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[Ubuntu]우분투 gif 움짤 프로그램 설치  (0) 2022.04.16
[Linux] 리눅스 캐쉬 메모리 비우기  (0) 2022.04.12
[SendMail] Centos7 SendMail 설치  (0) 2022.04.07
[Centos] Telnet 설치  (0) 2022.04.05
[Ubuntu] 우분투 ROOT 접속  (0) 2022.03.31
728x90
반응형

SendMail 이란? 

Sendmail은 인터넷을 통해 이메일을 전송하는데 사용되는 SMTP(Simple Mail Transfer Protocol) 프로토콜을  통해 메일 서비스를 수행하며 범용 목적 인터네트워크 이메일 라우팅 기능이다.

 

SendMail 설치 

Centos 에서 sendmail 을 설치하고 메일서버를  이용해 메일을 보내는 테스트 하는 방법에 대해 알아 보겠습니다. 

1.sendmail 관련 패키지 설치

  • sendamil 설치된 팩키지 확인 
rpm -qa | grep sendmail
  • sendmail 설치
yum install sendmail sendmail-cf sendmail-devel

2.sendmail 설정

  • /etc/mail/sendmail.mc 수정
    1. 52 ,53 라인 dnl 주석 처리 
    2. 118 라인 dnl 삽입
  • 변경전
 52 dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
 53 dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
118 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl  
  • 변경후

 52  TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
 53  define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
118 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl 

  • sendmail.cf 파일 생성 
m4 sendmail.mc > sendmail.cf

메일의 정상 수신을 위해서는 호스트 명이 존재 해야 합니다. 

vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#추가
192.168.xx.xx centos7 my.centos7.com​
  • local-host-names 추가 
vi /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
my.centos7.com

3. sendmail 서비스 시작

service sendmail start

#sendmail 이 리눅스 부팅시 실행되도록 설정.
chkconfig --level 2345 sendmail on

 

4. RELAY (IP 허용) :/etc/mail/access

  • 접속 허용 IP 대역 추가 (Connect:192.168                 RELAY)
  • access ip 적용 : makemap hash access < access
vi /etc/mail/access
# By default we allow relaying from localhost...
Connect:localhost.localdomain           RELAY
Connect:localhost                       RELAY
Connect:127.0.0.1                       RELAY
Connect:192.168                 RELAY

cd /etc/mail
makemap hash access < access

5. sendmail 테스트

5-4 번이 헷갈릴수도 있습니다.

꼭 DATA 입력후 엔터를 누른신 후 본문을 작성해 주세요 .

본문 작성이 끝나면 마침표로 "." 작성 완료를 해주세요 

 

5-1.telnet 접속 
telnet centos7 25

5-2.발신 메일 주소 입력
MAIL FROM:example@test.com

5-3.수신 메일 주소 입력
RCPT TO:test_user@tmax.co.kr

5-4. "DATA" 입력 후 본문 입력 "." 마침표로 메세지 발송
DATA

SUBJECT:Test Mail

5-5. 접속 종료 

quit

telnet centos7 25
Trying 192.168.17.56...
Connected to centos7.
Escape character is '^]'.
220 my.centos7.com ESMTP Sendmail 8.14.7/8.14.7; Mon, 4 Apr 2022 18:09:28 +0900
MAIL FROM:example@test.com
250 2.1.0 example@test.com... Sender ok
RCPT TO:usermail@daum.net
250 2.1.5 usermail@daum.net... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
SUBJECT:Test Mail
.
250 2.0.0 23499Sdm021395 Message accepted for delivery
quit
221 2.0.0 my.centos7.com closing connection
Connection closed by foreign host.

 

6. 전달 받은 메일함 확인 

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[Linux] 리눅스 캐쉬 메모리 비우기  (0) 2022.04.12
[Centos] VSFTPD 설치  (0) 2022.04.08
[Centos] Telnet 설치  (0) 2022.04.05
[Ubuntu] 우분투 ROOT 접속  (0) 2022.03.31
[Ubuntu] Static IP 설정  (0) 2022.03.26
728x90
반응형

Telnet 이란?

텔넷(TELNET)은 인터넷이나 로컬 영역 네트워크 연결에 쓰이는 네트워크 프로토콜이다

텔넷은 아래와 같은 특징을 가지고 있습니다. 

  • TCP/IP 기반의 프로토콜
  • 원격 터미널 접속서비스
  • TCP 23번 포트 를 기본적으로 사용 한다. 

1.Telnet 설치 팩키지 확인 및 설치 

rpm -qa | grep telnet
yum install -y telnet*
  • 설치 과정 확인
$ rpm -qa | grep telnet
$ rpm -qa | grep telnet*
$ yum list telnet*
  6ned plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * epel: ftp.riken.jp
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
Available Packages
telnet.x86_64                                             1:0.17-66.el7                                      updates
telnet-server.x86_64                                      1:0.17-66.el7                                      updates
$ yum install -y telnet*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * epel: ftp.riken.jp
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-66.el7 will be installed
---> Package telnet-server.x86_64 1:0.17-66.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================
 Package                       Arch                   Version                         Repository               Size
====================================================================================================================
Installing:
 telnet                        x86_64                 1:0.17-66.el7                   updates                  64 k
 telnet-server                 x86_64                 1:0.17-66.el7                   updates                  41 k

Transaction Summary
====================================================================================================================
Install  2 Packages

Total download size: 106 k
Installed size: 168 k
Downloading packages:
(1/2): telnet-server-0.17-66.el7.x86_64.rpm                                                  |  41 kB  00:00:00     
(2/2): telnet-0.17-66.el7.x86_64.rpm                                                         |  64 kB  00:00:00     
--------------------------------------------------------------------------------------------------------------------
Total                                                                               726 kB/s | 106 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:telnet-0.17-66.el7.x86_64                                                                      1/2 
  Installing : 1:telnet-server-0.17-66.el7.x86_64                                                               2/2 
  Verifying  : 1:telnet-server-0.17-66.el7.x86_64                                                               1/2 
  Verifying  : 1:telnet-0.17-66.el7.x86_64                                                                      2/2 

Installed:
  telnet.x86_64 1:0.17-66.el7                           telnet-server.x86_64 1:0.17-66.el7                          

Complete!
$ telnet centos7
Trying 192.168.17.56...
telnet: connect to address 192.168.17.56: Connection refused

 

2.Telnet 접속 확인  

설치 텔넷 접속시 Connection refused 에러가 발생 합니다. 

텔넷 서비스가 중지되어 있어 접속 에러가 발생합니다. 

텔넷 서비스 활성화후 재 접속을 합니다. 

 

$ telnet centos7              
Trying 192.168.17.56...
telnet: connect to address 192.168.17.56: Connection refused

$ systemctl start telnet.socket 

 

$ telnet 192.168.17.56
Trying 192.168.17.56...
Connected to 192.168.17.56.
Escape character is '^]'.

Kernel 3.10.0-1160.el7.x86_64 on an x86_64
centos7 login: docker_test
Password: 
Last login: Thu Mar 31 15:54:04 on pts/9

 

3.Telnet Command

 아래 명령은 telnet 사용 기본 명령어 입니다. 

 

#telnet 서비스 시작
systemctl start telnet.socket

#시스템 시작 시 자동으로 telnet 서버가 시작될 수 있게 활성화 시킨다.
systemctl enable telnet.socket


#telnet 서비스 정지
systemctl stop telnet.socket
systemctl disable telnet.socket

#tlent 서비스 상태 확인 
systemctl status telnet.socket

 

 

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[Centos] VSFTPD 설치  (0) 2022.04.08
[SendMail] Centos7 SendMail 설치  (0) 2022.04.07
[Ubuntu] 우분투 ROOT 접속  (0) 2022.03.31
[Ubuntu] Static IP 설정  (0) 2022.03.26
[CentOS]Host Name 변경  (0) 2022.03.26
728x90
반응형

Ubuntu ROOT  접속 방법 

우분투는 설치 시 ssh 나 GUI에서 root 로그인 접속이 제한되어 있습니다. 

ssh로 리모트 ubuntu 서버에 접속하는 방법과 

GUI 로그인 리스트에서 root 계정 활성화 하는 방법에 대해 알아보겠습니다. 

 

ROOT 접속 계정 비빌 번호 설정 

sudo passwd root 명령으로 root 비밀번호를 생성합니다. 

 

ubuntu@ubuntu:~$ pwd
/home/ubuntu
ubuntu@ubuntu:~$ whoami
ubuntu
ubuntu@ubuntu:~$ sudo passwd root
[sudo] password for ubuntu: 
New password: 
Retype new password: 
passwd: password updated successfully
ubuntu@ubuntu:~$ su - root
Password: 
root@ubuntu:~# whoami
root
root@ubuntu:~# 

 

SSH Root 접속 허용 설정 (/etc/ssh/sshd_config)

#PermitRootLogin prohibit-password => PermitRootLogin yes 설정 

root@ubuntu:~# vi /etc/ssh/sshd_config
#       $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Include /etc/ssh/sshd_config.d/*.conf

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

SSH 서비스 재 시작 후 접속

sudo service ssh restart

 

일반계정 ssh ROOT 접속 

일반계정에서 접속이 가능 한지 확인해보겠습니다. 

ubuntu 계정에서 root 로 정상적으로 접속이 되고 있습니다. 

 

ubuntu@ubuntu:~$ ssh root@192.168.58.130
The authenticity of host '192.168.58.130 (192.168.58.130)' can't be established.
ECDSA key fingerprint is SHA256:HXSV8v929Lw15GM4sjnyr8Od6Y/84S1jrajWaC7PFtk.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.58.130' (ECDSA) to the list of known hosts.
root@192.168.58.130's password: 
tiberoPermission denied, please try again.
root@192.168.58.130's password: 
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.13.0-37-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

17 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

Your Hardware Enablement Stack (HWE) is supported until April 2025.
*** System restart required ***
Last login: Sat Mar 26 07:13:22 2022 from 192.168.58.130
root@ubuntu:~# whoami
root

GUI 리스트에서 root 접속 활성화 하기 

 

아래 3개의 파일을 수정 하면 gui 리스트에 root 계정 접속도 가능합니다.

주석 처리 (#) 를 해주세요.

 

1./etc/gdm3/custom.conf 수정

 

 

2./etc/pam.d/gdm-password 

 

3./etc/pam.d/gdm-autologin 

 

vi /etc/gdm3/custom.conf 

# Enabling automatic login
AutomaticLoginEnable = true
AutomaticLogin = root

[security]
AllowRoot=true

vi /etc/pam.d/gdm-password 
#auth   required        pam_succeed_if.so user != root quiet_success

vi /etc/pam.d/gdm-autologin 
#auth   required        pam_succeed_if.so user != root quiet_success

서버 재기동 후 접속 

root@ubuntu:~# shutdown -r now 

Notlited 클릭수 username root /비번 입력 후 접속을 진행합니다. 

이제 root 도 접속이 가능합니다. 

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[SendMail] Centos7 SendMail 설치  (0) 2022.04.07
[Centos] Telnet 설치  (0) 2022.04.05
[Ubuntu] Static IP 설정  (0) 2022.03.26
[CentOS]Host Name 변경  (0) 2022.03.26
[Ubuntu] Vmware Ubuntu20.04 LTS 설치  (0) 2022.03.26
728x90
반응형

Vmware 상에 설치된 우분투 아이피 설정 방법에 대해 알아보겠습니다. 

 

Vmware Newtwork 설정 매뉴에서 NAT 설정을 별도로 해주고 설정한 네트웍 정보를 

vmware 에서 설치된 우분투 네트워크  아이피를 설정해야 

호스트 컴퓨터에서 Vmware 에 설정된 Static IP 로 접속이 가능 합니다. 

 

VMware NAT 설정 

 

Edit -> Virtual Network Editor 매뉴를 선택후 NAT Settings 버튼을 눌러줍니다. 

 

Virtual Network Editor

NAT NetWork IP 정보 셋팅 

3 번 셋팅을 통해  호스트 컴퓨터(노트북) 와 우분투와 접속이 가능해집니다. 

Map Incoming Port 셋팅(포트 포워딩 ) 을 진행 해보겠습니다. 

아래 정보는 ssh 포트 포워딩을  하기위해 설정 하겠습니다. 

호스트 컴퓨터 1022 포트로  연결 시도시 우분투 ssh 22번 포트로  접속을 시도합니다. 

 

 

Ubuntu(우분투) Static IP 설정

이번에는 우분투 네트워크 아이피 설정을 셋하겠습니다. 

vmware 에서 설정한 ip 정보로 설정을 진행 주면 됩니다. 

 

IPV4 항목 항목을 아래와 같은 정보로 설정합니다. 앞서  vmware nat 정보 설정 값과 동일 합니다. 

우분투 IP 설정

설정이 완료 되면 터미널을 열어서  설정한 IP 정보로 잘 셋팅되어 있는지 확인하고 \

포털 사이트 접속이 잘되는지도 확인 합니다. 

 

 

 

호스트 PC (노트북) 포트 포워딩을 통한 우분투 접속 

 

아래 그림은 호스트 컴퓨터 1022 포트로 접속시 vmware 설정한 ip 정보로 포트 포워딩 하는 이해를 돕기 위한 설명입니다. 

 

콘솔 접속 -> 호스트 pc (1022) 포트 포워딩  ->vm ware ip port (22) 접속 

 

접속 성공 확인

 

 

접속 연결 실패시 확인 사항 

VMnet8 사용 상태 확인 

네트워크 연결 -> 고급 네트워크 설정 -> vmware network adapter vmnet8 사용 상태 확인 

윈도우 11 네트워크 연결 상태 확인

우분투 ssh 설치 상태 확인 

설치 및 방화벽 상태를 확인 합니다. 

ssh 설치 및 접속 방법은 https://growupcoding.tistory.com/24 자료를 확인하세요 

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[Centos] Telnet 설치  (0) 2022.04.05
[Ubuntu] 우분투 ROOT 접속  (0) 2022.03.31
[CentOS]Host Name 변경  (0) 2022.03.26
[Ubuntu] Vmware Ubuntu20.04 LTS 설치  (0) 2022.03.26
[Shell]trap 을 활용한 리눅스(Signal) 시그널 처리  (0) 2022.03.25
728x90
반응형

호스트명 변경 방법

리눅스 에서 호스트명을 변경하고 확인하는 방법에 대해 알아 보겟습니다. 

1.hosts 파일 호스트 네임 등록

$ vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


192.168.xx.xx centos7 my.centos7.com

등록된 호스트 명으로 network ping 테스트


[root@minsvr:/root]$ ping centos7
PING centos7 (192.168.17.xx) 56(84) bytes of data.
64 bytes from centos7 (192.168.xx.xx): icmp_seq=1 ttl=64 time=0.055 ms
64 bytes from centos7 (192.168.xx.xx): icmp_seq=2 ttl=64 time=0.051 ms
64 bytes from centos7 (192.168.xx.xx): icmp_seq=3 ttl=64 time=0.056 ms

--- centos7 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.051/0.054/0.056/0.002 ms

 

2. 서버 호스트명 직접 변경

//호스트 네임 직접변경
echo centos7 > /proc/sys/kernel/hostname

[root@centos7:/root]$ cat /proc/sys/kernel/hostname 
centos7

 

3. hostnamectl 을 이용한 호스트명 변경

[root@centos7:/root]$ hostnamectl set-hostname centos7_myserver
[root@centos7_myserver:/root]$ hostname 
centos7_myserver

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[Ubuntu] 우분투 ROOT 접속  (0) 2022.03.31
[Ubuntu] Static IP 설정  (0) 2022.03.26
[Ubuntu] Vmware Ubuntu20.04 LTS 설치  (0) 2022.03.26
[Shell]trap 을 활용한 리눅스(Signal) 시그널 처리  (0) 2022.03.25
Ubuntu SSH 접속 방법  (0) 2022.03.20
728x90
반응형

vmware 최신 버전 에서 우분투 설치하는 법에 대해 알아 보겠습니다. 

vmware 16.2.3 버전에서 설치를 진행 해보도록 하겠습니다. 

 

Ubuntu 이미지 다운로드 

설치를 진행하기위해 우분투 를 다운로드 받습니다. 

설치를 진행하게될 버전은 20.04.4 LTS(Long Term Service) 버전입니다. 

https://ubuntu.com/download/desktop

 

Download Ubuntu Desktop | Download | Ubuntu

Ubuntu is an open source software operating system that runs from the desktop, to the cloud, to all your internet connected things.

ubuntu.com

 

Vmware Virtual Machine 생성 

우분투 설치를 위해 Vmware 에 가상 머신을 생성 합니다. 

 

 

우분투를 설치 사양을 설정 해 줍니다. 

 

네트워크 Type 을 지정해줍니다. 

 

Disk 생성 방식을 지정해 줍니다. 

 

Disk size 를 설정해 줍니다.  제 노트북은 여유공간이 80G 정도 남아 있어서 40G 정도로 설정 하겠습니다. 

 

Vmware 설정이 모두 완료 되었습니다. 

우분투 설치

설정이 모두 완료 되고 Finish 버튼을 누르면 Ubuntu 가 설치가 진행 됩니다. 

 

설치가 완료되었습니다. 

이제 우분투를 사용 하세요

 

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[Ubuntu] Static IP 설정  (0) 2022.03.26
[CentOS]Host Name 변경  (0) 2022.03.26
[Shell]trap 을 활용한 리눅스(Signal) 시그널 처리  (0) 2022.03.25
Ubuntu SSH 접속 방법  (0) 2022.03.20
Ubuntu 명령어  (0) 2022.03.19
728x90
반응형

시그널(Signal) 이란? 

Signal 이란 프로세나 시스템에 이벤트를 전달하는 신호를 나타냅니다. 

일반적으로 흔시 하용하는 Ctrl +C 같은 경우도 Signal의 한 종류이다.

 

시그널(Signal) 종류

리눅스 콘솔 창 에서 kill -l 명령을 사용하면 시그널 리스트를 확인 할 수 있다. 

 

$ kill -l
 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP
 6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1
11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM
16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU     25) SIGXFSZ
26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGIO       30) SIGPWR
31) SIGSYS      34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3
38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7
58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
63) SIGRTMAX-1  64) SIGRTMAX

$  help kill
kill: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
    Send a signal to a job.
    
    Send the processes identified by PID or JOBSPEC the signal named by
    SIGSPEC or SIGNUM.  If neither SIGSPEC nor SIGNUM is present, then
    SIGTERM is assumed.
    
    Options:
      -s sig    SIG is a signal name
      -n sig    SIG is a signal number
      -l        list the signal names; if arguments follow `-l' they are
        assumed to be signal numbers for which names should be listed
    
    Kill is a shell builtin for two reasons: it allows job IDs to be used
    instead of process IDs, and allows processes to be killed if the limit
    on processes that you can create is reached.
    
    Exit Status:
    Returns success unless an invalid option is given or an error occurs.

 

시그널(Signal) 종류 및 설명 

리눅스 시그널 종류

 

trap을 이용한 Signal 처리 예제

 무한으로 수행되는 쉘 코드로 trap 을 이용한 시그널 처리 동작에 대해 알아보겠습니다. 

소개하는 코드는 1 초마다 현재 수행되고 있는 loop.sh 프로세스를 확인하고 

CTRL +C 시그널을 포착해서 프로그램을 종료하는 예제입니다. 

 

loop.sh 수행 순서

while loop 수행 : loop count : [1]

사용자 CTRL+C (​SIGINT:2  시그널 발생​) => _int() 함수 호출 => kill -15 (SIGTERM ) 시그널 발생 
=>_term() 함수 호출 => kill -9로 loop.sh 프로세스 종료

 

loop.sh

#!/bin/bash

loop_cnt=0
echo "=================================="
echo "======= LOOP SHELL PROCESS ======="
echo "=================================="

ps -ef|grep loop.sh
process=`ps -ef|grep loop.sh |awk '{print $2}'`
echo "PROCESS_ID:[ $process ]"

########### SIGTERM handler ############
function _term() {
 echo "SIGTERM Event call"
 kill -9 $process
}

########### SIGINT handler ############
function _int() {
 echo "SIGINT Event call"
 kill -15 $process

}


trap _term SIGTERM

trap _int SIGINT

while true
do
loop_cnt=`expr $loop_cnt + 1`

echo "loop count : [$loop_cnt]"

sleep 1

done

 

수행 결과

728x90
반응형

'06.OS > Linux' 카테고리의 다른 글

[CentOS]Host Name 변경  (0) 2022.03.26
[Ubuntu] Vmware Ubuntu20.04 LTS 설치  (0) 2022.03.26
Ubuntu SSH 접속 방법  (0) 2022.03.20
Ubuntu 명령어  (0) 2022.03.19
우분투 Chrom(크롬)설치  (0) 2022.03.09

+ Recent posts