Remote Service 4(⑥remoSvc4(vnc viewer)⑥방화벽 설정(CLI)) 3.ftp Service(①FtpSvc1(vsftpd))
* 강사님 정리 노트 :
* 실습 파일:
* FTP(File Transfer Protocol)
- 대표적으로 파일 서비스 중에 하나이다(공유폴더도 파일 서비스 중에 하나임)
- 시스템에 등록된 사용자들을 위한 FTP Server가 있고 익명(Anonymous) 사용자들을 위한 공개(개방)형 FTP
Server가 있음
- TCP 기반으로서 TCP 통신만 사용함
- 20번 포트(Data port), 21번 포트(Command port)가 2개 있음
- FTP 모드에 따라 꼭 20번 포트만 사용하는 것은 아니다
- FTP 모드에는 Active mode와 Passive mode가 있는데 결정하는 쪽은 접속하려는 클라이언트가 결정함
vsftpd 패키지 설치 유무를 확인!
vsftpd로 시작하는 패키지를 설치
vsftpd의 서비스명은 vsftpd.service
일반적인 ftp service는 사용자 인증을 포함한 서버와 주고받는 통신이
모두 암호화 되어있지 않아서 보안상 좋지 않음
vsftpd(Very Secure FTP Daemon)
standalone(독립실행형), 보안 FTP Service
=> 다른 프로그램에 영향 받지 않고, 별도로 실행 가능
vsftpd 패키지 설치 후 /etc/vsftpd 디렉터리가 자동생성 되며 하위에 여러 관련 파일들이 저장되어 있음
cf) sftp(Secure FTP) ssh 기반 ssh 동작되야(구동되야) 명령어 치고 들어갈 수 있음 standalone이 아니다? cf) daemon Type standalone : 독립 실행형. xinetd 와 관련 없이 스스로 동작됨 애초에 리눅스 설치시 패키지로 깔려있어야.., 리눅스 실행시 이 서비스들도 대기 중임 standalone 타입은 서비스명 뒤에 'd' 가 붙음 ex> sshd, vsftpd(centOS 6.x 이전 지금은 standalone 아님) xinetd : 수퍼 데몬 (x : 확장) 하위 데몬 관리 얘를 동작 시켜야 하위 데몬이 실행되고 그 전에는 대기도 안탐 => 얘를 중지하면 하위 데몬도 중지됨 /etc/vsftpd 디렉터리 하위에 파일들 ftpusers → vsftpd에서 기본적으로 접근 불가능한 시스템 및 사용자 계정이 저장되어 있는 파일 PAM(Pluggable Authentification Modules) 인증에 관련이 있음 (또 얘는 shadow 파일과 관련 되 있음) user_list → vsftpd.conf 설정파일에서 userlist_enable 항목이 있는데 그와 관련된 파일 별도로 접근 불가능한 시스템 및 사용자 계정이 저장되어 있음 => ftpusers, user_list에 둘다 root 가 기록되어 있어서 root가 이중으로 접근 불가! telnet에 root가 접근 안되듯이.., vsftpd.conf → vsftpd의 환경설정파일 /etc/vsftpd/vsftpd.conf (설정 파일) 12줄 : 익명사용자 활성화 여부 (공개형 FTP Server라면 허용해도 되지만 시스템에 등록된 사용자들을 위한 FTP Server라면 거부해야함) 16줄 : 로컬 사용자 활성화 여부 (시스템에 등록된 사용자들이기 때문에 거부할 필요가 없음(≠ NO) /etc/passwd 에 등록되 있는 사용자들을 말함) 19줄 : 쓰기 활성화 여부 (FTP Server에서 쓰기 관련 작업) 23줄 : 로컬 사용자가 디렉터리 생성시 기본 퍼미션을 지정하는 지시자 29줄 : 익명 사용자 업로드 활성화 여부 (# 주석을 풀어야..,) (공개형 FTP FTP Server라면 허용해도 되지만 시스템에 등록된 사용자들을 위한 FTP Server라면 거부해야함) 33줄 : 익명 사용자 디렉터리 쓰기 활성화 여부 (공개형 FTP FTP Server라면 허용해도 되지만 시스템에 등록된 사용자들을 위한 FTP Server라면 거부해야함)
// vsftpd 설치 확인 및 설치 [root@junga ~]# rpm -qa | grep vsftpd Dependencies Resolved ================================================================================ Transaction Summary Total download size: 192 k Installed: Complete! // vsftpd 관련 파일 [root@junga ~]# ls -l /etc/vsftpd // 알 FTP실습 알 FTP 실행 > FTP 안됨!!! [local 사용자 접속] [해결책] 1> 방화벽 2> 설치한 ftp 서비스 재 시작 // vsftpd.service 재시작 및 방화벽 설치 [root@junga ~]# systemctl is-active vsftpd.service [익명 접속]
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
[root@junga ~]#
[root@junga ~]# yum install vsftpd*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.daumkakao.com
* extras: data.nicehosting.co.kr
* updates: mirror.navercorp.com
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-22.el7 will be installed
---> Package vsftpd-sysvinit.x86_64 0:3.0.2-22.el7 will be installed
--> Finished Dependency Resolution
Package Arch Version Repository Size
================================================================================
Installing:
vsftpd x86_64 3.0.2-22.el7 base 169 k
vsftpd-sysvinit x86_64 3.0.2-22.el7 base 23 k
================================================================================
Install 2 Packages
Installed size: 351 k
Is this ok [y/d/N]: y
Downloading packages:
(1/2): vsftpd-3.0.2-22.el7.x86_64.rpm | 169 kB 00:01
(2/2): vsftpd-sysvinit-3.0.2-22.el7.x86_64.rpm | 23 kB 00:01
--------------------------------------------------------------------------------
Total 89 kB/s | 192 kB 00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : vsftpd-3.0.2-22.el7.x86_64 1/2
Installing : vsftpd-sysvinit-3.0.2-22.el7.x86_64 2/2
Verifying : vsftpd-sysvinit-3.0.2-22.el7.x86_64 1/2
Verifying : vsftpd-3.0.2-22.el7.x86_64 2/2
vsftpd.x86_64 0:3.0.2-22.el7 vsftpd-sysvinit.x86_64 0:3.0.2-22.el7
합계 20
-rw------- 1 root root 125 8월 3 15:10 ftpusers
-rw------- 1 root root 361 8월 3 15:10 user_list
-rw------- 1 root root 5030 8월 3 15:10 vsftpd.conf
-rwxr--r-- 1 root root 338 8월 3 15:10 vsftpd_conf_migrate.sh
[root@junga ~]#
[root@junga ~]# cat /etc/vsftpd/vsftpd_conf_migrate.sh // shell script?
#!/bin/bash
#move old config files and symlink them
#shipped with vsftpd-2.0.1-6
PREFIX="vsftpd"
for file in $( ls /etc/${PREFIX}.* ); do
if [ ! -L $file ]; then
new=`echo $file | sed s/${PREFIX}\./${PREFIX}\\\\//g | sed s/\.rpmsave//g`
mv -f ${file} ${new}
ln -s ${new} ${file}
echo $file moved to $new
fi
done
[root@junga ~]#
[root@junga ~]#
[root@junga ~]# cp /etc/vsftpd/vsftpd.conf /backup // backup에 copy
[root@junga ~]#
[root@junga ~]# ls -l /backup
합계 36
-rwxr-xr-x 1 root root 8702 1월 12 13:06 00_header
-rw-r--r-- 1 root root 5078 1월 12 13:06 grub.cfg
-rw------- 1 root root 3907 1월 17 14:02 sshd_config
-r--r----- 1 root root 3938 1월 17 13:10 sudoers
-rw------- 1 root root 5030 1월 19 14:47 vsftpd.conf
[root@junga ~]#
unknown
[root@junga ~]#
[root@junga ~]# systemctl restart vsftpd.service
[root@junga ~]#
[root@junga ~]# systemctl is-active vsftpd.service
active
[root@junga ~]#
[root@junga ~]# firewall-cmd --list-service
ssh dhcpv6-client vnc-server
[root@junga ~]#
[root@junga ~]# firewall-cmd --get-services
RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-collector ctdb dhcp dhcpv6 dhcpv6-client dns docker-registry dropbox-lansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp ganglia-client ganglia-master high-availability http https imap imaps ipp ipp-client ipsec iscsi-target kadmin kerberos kibana klogin kpasswd kshell ldap ldaps libvirt libvirt-tls managesieve mdns mosh mountd ms-wbt mssql mysql nfs nrpe ntp openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster quassel radius rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp-submission smtps snmp snmptrap spideroak-lansync squid ssh synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmission-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server
[root@junga ~]#
[root@junga ~]# firewall-cmd --add-service=ftp
success
[root@junga ~]#
[root@junga ~]# firewall-cmd --list-service
ssh dhcpv6-client vnc-server ftp
[root@junga ~]#
[root@junga ~]# ifconfig | head -2
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.46.90 netmask 255.255.255.0 broadcast 192.168.46.255
[root@junga ~]#
[root@junga ~]# tail -2 /etc/passwd
tcpdump:x:72:72::/:/sbin/nologin
itbank:x:1000:1000:dust:/home/itbank:/bin/bash
[root@junga ~]#
[root@junga ~]# passwd itbank
itbank 사용자의 비밀 번호 변경 중
새 암호:
잘못된 암호: 암호는 8 개의 문자 보다 짧습니다
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
* 방화벽 설정
2) CLI 환경
firewall-cmd (명령어)
방화벽에는 zone(영역)이라는 것이 존재.
개방된 네트워크와 연결되어있으면 public(공개) zone에 있는 규칙이 적용되고
개인 네트워크에 있따면 다른 zone에 있는 규칙을 적용할 수 있음
Server를 사용하면 public zone을 규칙을 필요로 함(기본값)
사용형식
firewall-cmd --get-zones
→ 사전 정의된 zone 목록을 출력
firewall-cmd --list-all-zones
→ 전체 zone 목록을 상세하게 출력
firewall-cmd --get-default-zone
→ 기본 zone을 출력
firewall-cmd --get-active-zone
→ 활성화된 zone을 출력
firewall-cmd --get-service(s)
→ 서비스 목록을 출력
firewall-cmd (--zone=public) -- add-service=서비스
// ↑default 가 public
→ 서비스 등록(런타임)
firewall-cmd --zone=public(생략) --list-service
→ 서비스 확인(런타임)
firewall-cmd --zone=public(생략) --remove-service=서비스
→ 서비스 제거(런타임)
firewall-cmd --zone=public(생략) --permanent(영구적) --add-service=서비스
→ 서비스 등록(영구적) ☜ 재부팅을 해야!!!
firewall-cmd --reload
→ 영구적으로 등록 또는 제거시 반드시 방화벽을 다시 불러와야함
firewall-cmd --zone=public(생략) --permanent(영구적) --list-service
→ 서비스 확인(영구적)
firewall-cmd --zone=public(생략) --permanent(영구적) --remove-service=서비스
→ 서비스 제거(영구적)
cf) 구분: 서비스 확인(영구적) 등록시, reload vs. 확인
런 런
영 x
----------
영 런 x
런 o reload
영 영
firewall-cmd --zone=public(생략) --add-port=포트/프로토콜 (tcp, udp)
→ 포트 등록(런타임)
firewall-cmd --zone=public(생략) --list-port
→ 포트 등록 또는 제거시 확인(런타임)
firewall-cmd --zone=public(생략) --remove-port=포트/프로토콜
→ 포트 등록 또는 제거시 확인(런타임)
firewall-cmd --zone=public(생략) --permanent --add-port=포트/프로토콜 → 포트 등록(영구적)
firewall-cmd --zone=public(생략) --permanent --list-port
→ 포트 등록 또는 제거시 확인(영구적)
firewall-cmd --zone=public(생략) --permanent --remove-port=포트/프로토콜 → 포트 제거(영구적) firewall -cmd --state → 방화벽 상태 확인
centos 6.x 버전과 비교해서 port 번호 등록 필요 없음!! port : web : 5800 | local : 5900 + session 번호 | ?? : 6000 ★ vncserver 이후 세션 번호가 4번이상 되는 경우 port 등록해야 하는데, 5900+4 해야...?
// firewall : zone
[root@junga ~]# firewall-cmd --get-zones
block dmz drop external home internal public trusted work
[root@junga ~]#
[root@junga ~]# firewall-cmd --list-all-zones
block
target: %%REJECT%%
icmp-block-inversion: no
interfaces:
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
dmz
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
drop
target: DROP
icmp-block-inversion: no
interfaces:
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
external
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh
ports:
protocols:
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:
home
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh mdns samba-client dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
internal
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh mdns samba-client dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
public (active)
target: default
icmp-block-inversion: no
interfaces: ens32
sources:
services: ssh dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
trusted
target: ACCEPT
icmp-block-inversion: no
interfaces:
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
work
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@junga ~]# firewall-cmd --get-default-zone
public
[root@junga ~]# firewall-cmd --get-active-zon
public
interfaces: ens32
[root@junga ~]#
// firewall : service
[root@junga ~]#
[root@junga ~]# firewall-cmd --get-services
RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-collector ctdb dhcp dhcpv6 dhcpv6-client dns docker-registry dropbox-lansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp ganglia-client ganglia-master high-availability http https imap imaps ipp ipp-client ipsec iscsi-target kadmin kerberos kibana klogin kpasswd kshell ldap ldaps libvirt libvirt-tls managesieve mdns mosh mountd ms-wbt mssql mysql nfs nrpe ntp openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster quassel radius rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp-submission smtps snmp snmptrap spideroak-lansync squid ssh synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmission-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server
// windows vncviewer 실행 위한 방화벽 등록
[root@junga ~]# firewall-cmd --list-service // 런타임 확인
ssh dhcpv6-client
[root@junga ~]#
[root@junga ~]# firewall-cmd --permanent --list-service // 영구적 확인
ssh dhcpv6-client
[root@junga ~]#
[root@junga ~]# firewall-cmd --get-services // 내가 사용하고 있는 서비스 찾기
RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-collector ctdb dhcp dhcpv6 dhcpv6-client dns docker-registry dropbox-lansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp ganglia-client ganglia-master high-availability http https imap imaps ipp ipp-client ipsec iscsi-target kadmin kerberos kibana klogin kpasswd kshell ldap ldaps libvirt libvirt-tls managesieve mdns mosh mountd ms-wbt mssql mysql nfs nrpe ntp openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster quassel radius rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp-submission smtps snmp snmptrap spideroak-lansync squid ssh synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmission-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server
[root@junga ~]#
[root@junga ~]# firewall-cmd --list-service // 런타임 확인
ssh dhcpv6-client
[root@junga ~]#
[root@junga ~]# firewall-cmd --permanent --list-service // 영구적 확인
ssh dhcpv6-client
[root@junga ~]#
[root@junga ~]# firewall-cmd --add-service=vnc-server // vnc-server 런타임 등록
success
[root@junga ~]#
[root@junga ~]# firewall-cmd --list-service // 런타임 확인
ssh dhcpv6-client vnc-server
[root@junga ~]#
[root@junga ~]# firewall-cmd --permanent --list-service // 영구적 확인
ssh dhcpv6-client
// => 윈도우즈 vncviewer 실행
// 로그파일 조회시 접속한 ip 모두 조회 가능
ls -l /root/.vnc // 로그 파일 리스트 조회
// vncviewer 종료시
[root@junga ~]# killall -9 Xvnc
// vncviewer 재 실행
이전 세션 번호에 관련된 파일이 남아있어서 새로운 세션 번호 부여 받음
[root@junga ~]# vncserver
Warning: junga.kgitbank:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server junga.kgitbank:1
Warning: junga.kgitbank:2 is taken because of /tmp/.X2-lock
Remove this file if there is no X server junga.kgitbank:2
Warning: junga.kgitbank:3 is taken because of /tmp/.X3-lock
Remove this file if there is no X server junga.kgitbank:3
New 'junga.kgitbank:4 (root)' desktop is junga.kgitbank:4
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/junga.kgitbank:4.log
[root@junga ~]# vncviewer
192.168.46.90:4
// => 윈도우즈 vncviewer 접속 안됨
// 세션 4번에 대한 포트 등록
// => 5900 + 4
[root@junga ~]# firewall-cmd --add-port=5904/tcp
success
[root@junga ~]#
[root@junga ~]# firewall-cmd --list-port
5904/tcp
// 윈도우 vncviewer 재접속
192.168.46.90:4
성공~!!!
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
* vnc(Virtual Network Computing)
vnc(Virtual Network Computing)
- 오픈 소스인 vnc는 Windows Server에서 Terminal Service와 비슷한 기능을 가지고 있음
cf) windows에선 terminal service라고 부름
- 플랫폼(운영체제)을 가리지 않음
- 설치가 간편함
- CLI 환경이 아니라 GUI 환경을 제공함
-RFB(Remote Frame Buffer protocol)
프레임 버퍼 레벨에서 동작함
OS와 상관없이 모든 OS에서 프레임 단위로 통신
원격으로 다른 컴퓨터를 제어하고 키보드와 마우스를 입력하면 그대로 전달이 됨
작업 전에
tigervnc 패키지 유무를 확인!
tigervnc로 시작하는 패키지를 설치해야 함
패키지 설치 후
vncserver@.service(데몬)을 재시작해야하지만 설정을 하지 않았기 때문에 실패
(참고로 CentOS 7 이전에는
/etc/sysconfig/vncservers 파일에서 작업.
CentOS 7 에서는 /usr/lib/systemd/system/vncserver@.service를 복사해서 사용함)
vncserver(명령어)
vncserver 명령 시 로그인 한 사용자 계정의 홈 디렉터리 하위에 .vnc 디렉터리가 자동생성
그리고 .vnc 디렉터리 하위에 여러 파일들이 저장되어 있음
.vnc 디렉터리 하위에 파일들
config
→ 해상도, 공유, 데스크탑 등 관련 설정 파일
passwd
→ vnc 접속 시 이용하여 해당 사용자 계정으로 접속할 때 비밀번호가 저장되어 있는 파일
(참고로 vnc 접속할 때 비밀번호를 잃어버렸을 경우 vncpasswd(명령어)를 이용하여 해결할 수 있음)
xstartup
→ vncserver의 스크립트 파일
hostname: 세션번호.log
→ vnc 접속 시 관련 기록이 저장되어지는 파일
hostname: 세션번호.pid
→ vnc 접속 시 사용할 프로세스 아이디가 저장되어 있는 파일
# cat /root/.vnc/xstartup
(참고로
CentOS 5.x 에서는 4줄과 5줄에 맨 앞에 '#'(주석)을 제거한 다음에 사용해야 함
CentOS 6.x 에서는 7줄과 21줄에 맨 앞에 '#'이 없으므로 설정할 필요가 없음
CentOS 7.x 에서는 3줄과 5줄에 맨 앞에 '#'이 없으므로 설정할 필요가 없음
vncserver 접속 방법
1) vncviewer(명령어) 입력 후 enter
VNC Viewer 창이 뜸
옵션, 로드, 저장, 접속 등이 있으므로 설정할 수 있음
VNC server : 에 Server-IP:세션번호 을 적음 → Connect
VNC authentication이 뜨고 Password: 비밀번호를 입력 → OK
192.168.46.90:1
2) vncviewer Service-IP:세션번호
vncserver 접속 해제
1) 현재 열려있는 세션 종료
사용형식
vncserver -kill :세션번호
// 2018.01.19
현재 동작중인 서비스 종료
killall
- 프로세스의 이름으로 프로세스를 종료
사용형식
killall [option] 서비스 (daemon)
외부에서 vncviewer 접속
// 2018.01.19 실습
[root@junga ~]# vncviewer
TigerVNC Viewer 64-bit v1.8.0
Built on: 2017-12-01 23:20
Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Fri Jan 19 12:51:37 2018
DecodeManager: Detected 1 CPU core(s)
DecodeManager: Decoding data on main thread
CConn: unable connect to socket: 연결이 거부됨 (111)
[root@junga ~]# vncserver
Warning: junga.kgitbank:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server junga.kgitbank:1
New 'junga.kgitbank:2 (root)' desktop is junga.kgitbank:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/junga.kgitbank:2.log
[root@junga ~]# vncviewer
TigerVNC Viewer 64-bit v1.8.0
Built on: 2017-12-01 23:20
Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Fri Jan 19 12:53:37 2018
DecodeManager: Detected 1 CPU core(s)
DecodeManager: Decoding data on main thread
CConn: connected to host 192.168.46.90 port 5902
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
CConnection: Choosing security type VeNCrypt(19)
CVeNCrypt: Choosing security type TLSVnc (258)
Fri Jan 19 12:53:47 2018
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using Tight encoding
CConn: Enabling continuous updates
Fri Jan 19 12:56:06 2018
CConn: End of stream
[root@junga ~]#
[root@junga ~]# killall -9 Xvnc // 서비스를 끊 경우
[root@junga ~]# vncserver
Warning: junga.kgitbank:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server junga.kgitbank:1
Warning: junga.kgitbank:2 is taken because of /tmp/.X2-lock
Remove this file if there is no X server junga.kgitbank:2 // 기존 세션번호의 데이타가 남아있어서
New 'junga.kgitbank:3 (root)' desktop is junga.kgitbank:3 // 다음 세션번호가 부여됨
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/junga.kgitbank:3.log
[root@junga ~]# vncviewer
TigerVNC Viewer 64-bit v1.8.0
Built on: 2017-12-01 23:20
Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Fri Jan 19 13:50:52 2018
DecodeManager: Detected 1 CPU core(s)
DecodeManager: Decoding data on main thread
CConn: connected to host 192.168.46.90 port 5903
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
CConnection: Choosing security type VeNCrypt(19)
CVeNCrypt: Choosing security type TLSVnc (258)
Fri Jan 19 13:50:55 2018
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using Tight encoding
CConn: Enabling continuous updates
============================ [Review] ============================
[서버] 에서만
// vnc package 설치
[root@junga ~]# rpm -qa | grep tigervnc*
tigervnc-server-minimal-1.8.0-1.el7.x86_64
tigervnc-license-1.8.0-1.el7.noarch
[root@junga ~]#
[root@junga ~]# rpm -qa | grep openssh*
openssh-clients-7.4p1-12.el7_4.x86_64
openssl-libs-1.0.2k-8.el7.x86_64
openssh-server-7.4p1-12.el7_4.x86_64
xmlsec1-openssl-1.2.20-7.el7_4.x86_64
openssl-1.0.2k-8.el7.x86_64
openssh-7.4p1-12.el7_4.x86_64
[root@junga ~]#
[root@junga ~]# yum -y install tigervnc*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.daumkakao.com
* extras: data.nicehosting.co.kr
* updates: mirror.navercorp.com
Resolving Dependencies
--> Running transaction check
---> Package tigervnc.x86_64 0:1.8.0-2.el7_4 will be installed
--> Processing Dependency: libfltk_images.so.1.3()(64bit) for package: tigervnc-1.8.0-2.el7_4.x86_64
--> Processing Dependency: libfltk.so.1.3()(64bit) for package: tigervnc-1.8.0-2.el7_4.x86_64
---> Package tigervnc-icons.noarch 0:1.8.0-2.el7_4 will be installed
---> Package tigervnc-license.noarch 0:1.8.0-1.el7 will be updated
---> Package tigervnc-license.noarch 0:1.8.0-2.el7_4 will be an update
---> Package tigervnc-server.x86_64 0:1.8.0-2.el7_4 will be installed
---> Package tigervnc-server-applet.noarch 0:1.8.0-2.el7_4 will be installed
---> Package tigervnc-server-minimal.x86_64 0:1.8.0-1.el7 will be updated
---> Package tigervnc-server-minimal.x86_64 0:1.8.0-2.el7_4 will be an update
---> Package tigervnc-server-module.x86_64 0:1.8.0-2.el7_4 will be installed
--> Running transaction check
---> Package fltk.x86_64 0:1.3.4-1.el7 will be installed
--> Processing Dependency: libGLU.so.1()(64bit) for package: fltk-1.3.4-1.el7.x86_64
--> Running transaction check
---> Package mesa-libGLU.x86_64 0:9.0.0-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================
Package Arch Version Repository Size
============================================================================================
Installing:
tigervnc x86_64 1.8.0-2.el7_4 updates 239 k
tigervnc-icons noarch 1.8.0-2.el7_4 updates 37 k
tigervnc-server x86_64 1.8.0-2.el7_4 updates 213 k
tigervnc-server-applet noarch 1.8.0-2.el7_4 updates 566 k
tigervnc-server-module x86_64 1.8.0-2.el7_4 updates 216 k
Updating:
tigervnc-license noarch 1.8.0-2.el7_4 updates 28 k
tigervnc-server-minimal x86_64 1.8.0-2.el7_4 updates 1.0 M
Installing for dependencies:
fltk x86_64 1.3.4-1.el7 base 560 k
mesa-libGLU x86_64 9.0.0-4.el7 base 196 k
Transaction Summary
============================================================================================
Install 5 Packages (+2 Dependent packages)
Upgrade 2 Packages
Total size: 3.1 M
Total download size: 2.0 M
Downloading packages:
(1/7): tigervnc-icons-1.8.0-2.el7_4.noarch.rpm | 37 kB 00:00:00
(2/7): tigervnc-1.8.0-2.el7_4.x86_64.rpm | 239 kB 00:00:00
(3/7): mesa-libGLU-9.0.0-4.el7.x86_64.rpm | 196 kB 00:00:00
(4/7): fltk-1.3.4-1.el7.x86_64.rpm | 560 kB 00:00:01
(5/7): tigervnc-server-1.8.0-2.el7_4.x86_64.rpm | 213 kB 00:00:00
(6/7): tigervnc-server-module-1.8.0-2.el7_4.x86_64.rpm | 216 kB 00:00:00
(7/7): tigervnc-server-applet-1.8.0-2.el7_4.noarch.rpm | 566 kB 00:00:00
--------------------------------------------------------------------------------------------
Total 1.4 MB/s | 2.0 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Updating : tigervnc-license-1.8.0-2.el7_4.noarch 1/11
Updating : tigervnc-server-minimal-1.8.0-2.el7_4.x86_64 2/11
Installing : tigervnc-server-1.8.0-2.el7_4.x86_64 3/11
Installing : mesa-libGLU-9.0.0-4.el7.x86_64 4/11
Installing : fltk-1.3.4-1.el7.x86_64 5/11
Installing : tigervnc-icons-1.8.0-2.el7_4.noarch 6/11
Installing : tigervnc-1.8.0-2.el7_4.x86_64 7/11
Installing : tigervnc-server-applet-1.8.0-2.el7_4.noarch 8/11
Installing : tigervnc-server-module-1.8.0-2.el7_4.x86_64 9/11
Cleanup : tigervnc-server-minimal-1.8.0-1.el7.x86_64 10/11
Cleanup : tigervnc-license-1.8.0-1.el7.noarch 11/11
Verifying : tigervnc-server-1.8.0-2.el7_4.x86_64 1/11
Verifying : tigervnc-icons-1.8.0-2.el7_4.noarch 2/11
Verifying : tigervnc-server-module-1.8.0-2.el7_4.x86_64 3/11
Verifying : tigervnc-1.8.0-2.el7_4.x86_64 4/11
Verifying : tigervnc-server-minimal-1.8.0-2.el7_4.x86_64 5/11
Verifying : fltk-1.3.4-1.el7.x86_64 6/11
Verifying : tigervnc-license-1.8.0-2.el7_4.noarch 7/11
Verifying : tigervnc-server-applet-1.8.0-2.el7_4.noarch 8/11
Verifying : mesa-libGLU-9.0.0-4.el7.x86_64 9/11
Verifying : tigervnc-server-minimal-1.8.0-1.el7.x86_64 10/11
Verifying : tigervnc-license-1.8.0-1.el7.noarch 11/11
Installed:
tigervnc.x86_64 0:1.8.0-2.el7_4
tigervnc-icons.noarch 0:1.8.0-2.el7_4
tigervnc-server.x86_64 0:1.8.0-2.el7_4
tigervnc-server-applet.noarch 0:1.8.0-2.el7_4
tigervnc-server-module.x86_64 0:1.8.0-2.el7_4
Dependency Installed:
fltk.x86_64 0:1.3.4-1.el7 mesa-libGLU.x86_64 0:9.0.0-4.el7
Updated:
tigervnc-license.noarch 0:1.8.0-2.el7_4 tigervnc-server-minimal.x86_64 0:1.8.0-2.el7_4
Complete!
[root@junga ~]#
[root@junga ~]# rpm -qa | grep tigervnc | nl
1 tigervnc-server-1.8.0-2.el7_4.x86_64
2 tigervnc-server-applet-1.8.0-2.el7_4.noarch
3 tigervnc-license-1.8.0-2.el7_4.noarch
4 tigervnc-server-module-1.8.0-2.el7_4.x86_64
5 tigervnc-server-minimal-1.8.0-2.el7_4.x86_64
6 tigervnc-icons-1.8.0-2.el7_4.noarch
7 tigervnc-1.8.0-2.el7_4.x86_64
[root@junga ~]#
[root@junga ~]# ls -l /usr/lib/systemd/system/vncserver@.service
-rw-r--r-- 1 root root 1679 12월 2 08:22 /usr/lib/systemd/system/vncserver@.service
[root@junga ~]#
[root@junga ~]# ls -l /etc/sysconfig/vncservers
-rw-r--r-- 1 root root 72 12월 2 08:22 /etc/sysconfig/vncservers
[root@junga ~]#
[root@junga ~]# cat /etc/sysconfig/vncservers
# THIS FILE HAS BEEN REPLACED BY /lib/systemd/system/vncserver@.service
// vncserver
[root@junga ~]# vncserver
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
New 'junga.kgitbank:1 (root)' desktop is junga.kgitbank:1
Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/junga.kgitbank:1.log
[root@junga ~]# ls -l /root/.vnc
합계 20
-rw-r--r-- 1 root root 332 1월 18 14:48 config
-rw-r--r-- 1 root root 750 1월 18 14:51 junga.kgitbank:1.log
-rw-r--r-- 1 root root 5 1월 18 14:48 junga.kgitbank:1.pid
-rw------- 1 root root 8 1월 18 14:48 passwd
-rwxr-xr-x 1 root root 92 1월 18 14:48 xstartup
[root@junga ~]#
[root@junga ~]# cat /root/.vnc/junga.kgitbank\:1.pid
4834
[root@junga ~]# cat /root/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /etc/X11/xinit/xinitrc
// vncviewer 실행
[root@junga ~]# vncviewer
TigerVNC Viewer 64-bit v1.8.0
Built on: 2017-12-01 23:20
Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Thu Jan 18 15:05:58 2018
DecodeManager: Detected 1 CPU core(s)
DecodeManager: Decoding data on main thread
CConn: connected to host 192.168.46.90 port 5901
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
CConnection: Choosing security type VeNCrypt(19)
CVeNCrypt: Choosing security type TLSVnc (258)
Thu Jan 18 15:06:02 2018
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using Tight encoding
CConn: Enabling continuous updates
// 192.168.46.90:1
Thu Jan 18 15:12:25 2018
CConn: read: 연결이 상대편에 의해 끊어짐 (104)
[root@junga ~]#
// vncserver 종료
[root@junga ~]# vncserver -kill :1
Killing Xvnc process ID 4834
Xvnc seems to be deadlocked. Kill the process manually and then re-run
/usr/bin/vncserver -kill :1
to clean up the socket files.
[root@junga ~]#
// vncviewer 재 접속
[root@junga ~]# vncviewer 192.168.46.90:1
TigerVNC Viewer 64-bit v1.8.0
Built on: 2017-12-01 23:20
Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Thu Jan 18 15:14:35 2018
DecodeManager: Detected 1 CPU core(s)
DecodeManager: Decoding data on main thread
CConn: connected to host 192.168.46.90 port 5901
Thu Jan 18 15:14:36 2018
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
CConnection: Choosing security type VeNCrypt(19)
CVeNCrypt: Choosing security type TLSVnc (258)
Thu Jan 18 15:14:42 2018
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using Tight encoding
CConn: Enabling continuous updates