블로그 이미지
22Hz 22Hz

카테고리

분류 전체보기 (109)
모의해킹 침해대응 전문가 과정 (99)
리눅스 설정 (10)
Total
Today
Yesterday

달력

« » 2025.5
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

공지사항

태그목록

최근에 올라온 글

==============================================메모==============================================

Apt (패키지 관리자, Advanced Packaging Tool)

데비안, 우분투 등에서의 소프트웨어를 설치/제거/관리하는 도구
코어 라이브러리와 함께 동작
이진파일 또는 소스코드 컴파일을 통하여 소프트웨어 패키지의 확인, 구성, 설치를 자동화

http://zetawiki.com/wiki/%EC%9A%B0%EB%B6%84%ED%88%AC_APT,_apt-get
http://uncyclopedia.kr/wiki/Apt_%28%ED%8C%A8%ED%82%A4%EC%A7%80_%EA%B4%80%EB%A6%AC%EC%9E%90%29

==============================================강의==============================================

[참고] 웹프록시(Web Proxy)에 대해서
웹 프록시의 일반적인 용도
● 성능 (웹 접속 속도를 높이기 위해서)
● 보안

웹 프록시의 보안적인 용도
● 소스의 IP를 속이기 위해서 (안전하게 테스트하기 위해서)
● 웹 분석/변조

프록시 서버(영어: proxy server 프락시 서버[*])는 클라이언트가 자신을 통해서 다른 네트워크 서비스에 간접적으로 접속할 수 있게 해 주는 컴퓨터나 응용 프로그램을 가리킨다. 서버와 클라이언트 사이에서 중계기로서 대리로 통신을 수행하는 기능을 가리켜 '프록시', 그 중계 기능을 하는 것을 프록시 서버라고 부른다.

프록시 서버는 프록시 서버에 요청된 내용들을 캐시를 이용하여 저장해 둔다. 이렇게 캐시를 해 두고 난 후에, 캐시 안에 있는 정보를 요구하는 요청에 대해서는 원격 서버에 접속하여 데이터를 가져올 필요가 없게 됨으로써 전송 시간을 절약할 수 있게 됨과 동시에 불필요하게 외부와의 연결을 하지 않아도 된다는 장점을 갖게 된다. 또한 외부와의 트래픽을 줄이게 됨으로써 네트워크 병목 현상을 방지하는 효과도 얻을 수 있게 된다.

프록시 서버의 사용 목적은 잠재적으로 다양하다:

> 익명으로 컴퓨터를 유지 (주로 보안을 위하여)[1]
> 캐시를 사용하여 리소스로의 접근을 빠르게 하기 위해. 웹 프록시는 웹 서버로부터 웹 페이지를 캐시로 저장하는 데 흔히 쓰인다.[2]
> 네트워크 서비스나 콘텐츠로의 접근 정책을 적용하기 위해. (이를테면 원치 않는 사이트를 차단)
> 사용률을 기록하고 검사하기 위해 (이를테면 회사는 인터넷 이용을 파악)
> > 보안 및 통제를 뚫고 나가기 위해
> 바이러스 전파, 악성 루머 전파, 다른 정보들을 빼낼 목적으로
> 역으로 IP추적을 당하지 않을 목적으로
> 전달에 앞서 악성 코드를 목적으로 전달된 콘텐츠를 검사하기 위해
> 밖으로 나가는 콘텐츠를 검사하기 위해 (데이터 유출 보호)
> 지역 제한을 우회하기 위해

https://ko.wikipedia.org/wiki/%ED%94%84%EB%A1%9D%EC%8B%9C_%EC%84%9C%EB%B2%84

Proxy Server. IP를 빌려줘서 사용자가 빌린 IP를 인터넷에서 사용할 수 있게 해 주는 서버. 보통 프록시라고 줄여서 부른다.

많은 사람들이 자신의 아이피를 세탁하거나 차단을 우회하기 위해 사용하는 정도로 알고 있지만, 프록시 서버가 설치된 처음 목적은 웹 서핑을 위시한 인터넷 속도의 향상이었다. 1990년대 후반까지만 해도 이런 목적으로 사용되었다.

https://namu.wiki/w/%ED%94%84%EB%A1%9D%EC%8B%9C%20%EC%84%9C%EB%B2%84

간단하게 다른 네트워크 서비스에 간접적으로 접속 할 수 있게 해주는 컴퓨터를 말한다.
원래의 목적은 캐시를 사용하여 리소스로의 접근을 빠르게 하기 위한 것이 목적이다.
로그인 같은 부분은 메인서버에서 직접할지 몰라도 바뀌지 않는 데이터들은 프록시 서버에 저장되어 있어 메인서버까지 가지 않아 속도가 빨라진다.
전달에 앞서 악성코드를 목적으로 전달된 콘텐츠를 검사하기 위해서도 쓰인다.

http://blog.naver.com/axlovelee/130168829375

■ 침입차단시스템 – 방화벽(Firewall)

■ 침입탐지시스템(IDS, Intrusion Detection System)
   ● 호스트 기반의 침입 탐지 시스템(HIDS, Host-Based Intrusion Detection System)
   ● 네트워크 기반의 칩입 탐지 시스템(NIDS, Network-Based Intrusion Detection System)

■ 침입방지시스템(IPS, Intrusion Preventing System)
Internet ----- Router ----- Firewall ----- IPS ----- HUB -----+----- WEB Server
        |    +----- MAIL Server
        |    +----- DNS Server
       IPS    +----- FTP Server
        |
        |
    +----------Hub----------+
    |                       |
   Hub         Hub
     각종 업무 서버 PC PC PC PC PC PC

■ 가상사설 네트워크(VPN, Virtual Path Network)
   VPN 사용예
   ● 해외여행을 가서도 국내 온라인 게임을 할 수 있다.
   ● 회사내의 서버를 집에서도 보안된 상태로 접근 할 수 있다.

■ IP 관리시스템
   네트워크의 보안을 위한 것으로 임의의 사용자가 접속할 수 없게한다.

■ 보안 운영체제(Secure OS)
   운영체제에 내재된 결함으로 인해 발생할 수 있는 각종 해킹으로부터 보호하기 위해, 보안 기능이 통합된 보안 커널을 추가로 이식한 운영체제

<사용자> <클라이언트 프로그램> <악성코드>
    |              |                |
    0              0                X
    |              |                |
    V              V                V
---------------------------------------------------------
사용자 인증 및 권한 관리, 서비스별 통계
(FTP, TELNET, rlogin, SSH, 기타)
---------------------------------------------------------
    |              |                |
    0              0                X
    |              |                |
    V              V                V
---------------------------------------------------------
부적절한 코드 실행 방지(버퍼오버플러우, 포맷스트링, 기타)
---------------------------------------------------------
    |              |                |
    0              0                X
    |              |                |
    V              V                V
---------------------------------------------------------
역할기반(RBAC)의 강제적 접근 제어
---------------------------------------------------------
   |
   V
---------------------------------------------------------
운영체제의 커널(OS Kernel)
---------------------------------------------------------
  |        |       |       |
  V        V       V       V
파일    실행      특수권한 네트워크
시스템  프로그램  프로그램

■ 문서보안 솔루션 DRM(Digital Right Management)
   문서 보안에 초점을 맞춘 기술로, 문서 열람/편집/인쇄까지의 접근 권한을 설정하여 통제한다.

■ 허니팟(Honepot), 허니넷(Honenet)
   실제로 자료를 가진 호스트인것 처럼 침입자를 속이는 최신 침입탐지기법으로 허니팟 시스템을 이용하면, 공격하거나 침입하는 해커를 유인한다.

Internet ----- Screening Router ------ Firewall ----- 인트라넷망
                      |
  Firewall
      |
  허니넷(DMZ)
             허니팟호스트(가상서버)

네트워크(Network) 이론
- OSI 7 Layer & TCP/IP 5 Layer

■ OSI 7 Layer(OSI 7 Model), OSI(Open Systems Interconnection) Model
   ● 국제 표준화 기구(ISO)에서 개발한 모델로, 컴퓨터 네트워크 프로토콜 디자인과 통신을 계층으로 나누어 설명하고 있다.
   ● 계층(Layer)의 종류
      - 물리적 계층(Physical Layer)
      - 데이터링크 계층(Datalink Layer)
      - 네트워크 계층(Network Layer)
      - 전송 계층(Transport Layer)
      - 세션 계층(Session Layer)
      - 프레젠테이션 계층(Presentation Layer)
      - 응용 계층(Application Layer)
   ● 각 계층에서 독립적인 프로토콜이 동작한다.
   ● 이 모델은 프로토콜을 기능별로 나눈것이다.
   ● 일반적으로 하위 계층은 하드웨어로 상위 계층은 소프트웨어로 구현된다.

(1) TCP/IP 모델(TCP/IP 5 Layer) 개요

TCP/IP 5 Layer             Protocol
===================+==================================
Application                DNS, DHCP, NTP, IPFilter    -> DNS, DHCP, NTP, Firewall
===================+==================================
Transport                  TCP, UDP                    -> Port Admin
===================+==================================
Internet                   ICMP, IGMP,                 -> IP Admin
                           IPv4, IPv6
                           ARP, RARP
===================+==================================
Network Interface                                      -> Ethernet(CSMA/CD), Packet, MAC Admin
===================+==================================
Hardware                   Transmission Media(IEEE)    -> LAN Cable
===================+==================================

[참고] IAB, RFC, IETF
● IAB(Internet Architecture Board)
   1983년,  인터넷 기술 개발을 하면 테스트하여 표준화 할 수 있는가를 판단하는 기관
● RFCs(Request for Comments)
   문서를 만드는 기관
● IETF(Internet Engineering Task Force)
   IPv4, IPv6 개발(http://www.ietf.org)

[참고] RFC(Request for Comments) 문서 검색 방법
http://www.ietf.org/rfc.html
http://www.ietf.org/rfc/rfcNNNN.txt   (NNNN is RFC number)

 |--------------------|
 | Application        |          Mesg.   Mesg.              Domain Addr.
 |--------------------|
 | Transport          |        H+Mesg.   Segment/Datagram   Port Addr.  2Bytes
 |--------------------|
 | Internet           |      H+Segment   IP Datagram        IP Addr.    4Bytes
 |--------------------|
 | Network Interface  |    H+Datagram+T  Packet/Frame       MAC Addr.   6Bytes
 |--------------------|
 | Hardware           |                  Signal/bits
 |--------------------|
[그림] 각 계층의 생성 데이터이름과 헤더의 중요한 정보

     [HOSTA]                                                       [HOSTB]
# telnet HostB 23 --------------------------------------------> in.telnetd(23)
IP       : IP1                     IP   : IP2                  IP        : IP3
MAC      : MAC1                    MAC  : MAC2                 MAC       : MAC3

|--------------------|                                |--------------------|
| Application        |                                        | Application        |
|--------------------|              [ROUTER]                  |--------------------|
| Transport          |                                        | Transport          |
|--------------------|    |--------------------|          |--------------------|
| Internet           |    | Internet           |               | Internet           |
|--------------------|     |--------------------|               |--------------------|
| Network Interface  |     | Network Interface  |               | Network Interface  |
|--------------------|     |--------------------|               |--------------------|
| Hardware           |     | Hardware           |               | Hardware           |
|--------------------|     |--------------------|               |--------------------|
           |                        |         |                         |
           +------------------------+         +-------------------------+
[그림] 호스트 대 호스트 통신(Peer to peer communication)

> MAC주소의 동일여부는 같은 네트워크에서만 의미가 있다


(3-1) 네트워크 인터페이스 계층(Network Interface Layer)

▪ 물리적인 네트워크를 통한 데이터 통신 제어
▪ 에러 검출 기능(Detecting errors)
▪ 패킷의 프레임화(Faming packets)

■ Important Information : MAC
■ Layer Function
   - Flow Control(흐름제어)   => Header(MAC)
   - Error Control(에러제어)  => Tailer(CRC)

[참고] Network Interface Layer Protocol
● H/W 분류: Ethernet, Token Ling, ATM, FDDI, ...
● S/W 분류: SLIP, PPP
 
[참고] IEEE Identifiers
▪ IEEE 802.3 - Ethernet standards
▪ IEEE 802.4 - Token bus standards
▪ IEEE 802.5 - Token ring standards


(3-2) 인터넷 계층(Internet Layer)

▪ 패킷 분할 및 재 조립(Fragmenting and reassembly of data)
▪ 데이터 라우팅(Routing data)

■ Important Information : IP
■ Layer Function
   - Routing                      => Header(IP)
   - Fragmentation & Reassembly   => 송신(Fragmentation), 수신(Reassembly)

(3-3) 전송 계층(Transport Layer)

▪ 응답 신호(Acknowledgement responses)
▪ 순서(Sequencing)
▪ 흐름 제어(Flow Control)

■ Important Information : port
■ Layer Function
   - Flow Control        => (TCP) Sliding Window(송신) / Congestion Window(수신) = 버퍼
   - Error Control       => (TCP) ACK


4 네트워크 인터페이스 계층(Network Interface Layer)

■ LAN 오브젝트(LAN Object)
         ■ 토폴로지(Topologies)
         ■ LAN 전송 매체(Transmission Media)
         ■ 이더넷(Ethernet)
         ■ CSMA/CD 방식
         ■ Frame/Packet
         ■ MAC 주소 관리 (Addr. Management)

(1). 네트워크 토폴로지

이더넷상에서 네트워크의 구성 방식에 따라 여러가지 다음과 같은 토폴로지로 구분한다.

■ 네트워크 토폴로지의 종류(Network Topologies)
         ■ Bus Topologies          Dummy Hub 사용하는 경우
         ■ Star Topologies         Switching Hub 사용하는 경우
         ■ Ring Topologies         Token Ring Hub 사용하는 경우
         ■ VLAN Topologies         Virutal LAN 사용하는 경우

[참고] 케이블 제작 방법(http://blog.daum.net/kmjhj/9601104?nil_profile=tot)
       - (ㄱ) Cross Cable, (ㄴ) Direct Cable, (ㄷ) Console Cable

랜 전송 매체
■ 일반적으로 나누는 방식
■ IEEE에 정의된 표준으로 나누는 방식

(2-1). 일반적으로 나누는 방식
 Wire(Cable) ----+---- Coxial Cable
                 |
                 +---- Twisted Pair Cable ----+---- UTP Cable
                 |                            |
                 +---- Fiber Optical Cable    +---- STP Cable
 Wireless
[그림] LAN 전송 매체

■ Twisted Pair Cable
         ■ UTP(Unshield Twisted Pair Cable)
         ■ STP(Shield Twisted Pair Cable)

■ UTP Cable
         ■ Category 1  Tele-Communication
         ■ Category 2  4M   Analog + Digital
         ■ Category 3  10M  Digital Communication
         ■ Category 4  16M  Digital Communication(Token Rig)
         ■ Category 5  100M Digital Communication

■ Cross & Direct Cable(EX: 100Mbps)

==============================================실습==============================================

GNS3(+WinPcap +Wireshark) 설치

NAT 동작 확인

kali 리눅스 설치 + 초기설정

환경구축 완료!!

모의해킹 침해대응 개요

C:\Users\soldeskN\Desktop\JS\Security과정공유디렉토리(part1)\04_과정진행\02_2.1_모의해킹_침해대응_개요\01_네트워크이론\02_네트워크이론.hwp

 

Posted by 22Hz
, |

============================================메모============================================

복사(더블클릭 or 드래그)
붙여넣기(Shift + Insert)
gedit 이용

168.126.63.1

============================================강의============================================

사설 IP(Private Address)/공인 IP(Public Address)
사설 IP + NAT(Network Address Translation)

NAT(Network Address Translation)
네트워크 주소를 변환
N:1 (Masquerade) -> 사설IP를 공인IP로 변경
M:N
PAT
NAT 는 Network Address Translation 의 약자로 외부망과 내부망을 연결하는 다리역할을 한다. NAT는 2개의 chain을 포함하는데 PREROUTING 과 POSTROUTING 이다. PREROUTING 은 DNAT를 이용하여 처음패킷이 생길때 이용되고 POSTROUTING은 SNAT를 이용하여 패킷이 나갈때 이용된다.
여기서 DNAT 와 SNAT 에 대해서 살펴보면 DNAT 는 Destination NAT 의 약자로 박화벽에서 특정 공인 IP를 내부의 사설 IP로 포워딩하는 경우 이용되며  SNAT는 Source NAT 의 약자로 내부의 사설 IP를 이용하여 외부 인터넷으로 연결된 공인IP로 변환하고자 하는 경우 이용된다.
https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=1742

IP Forwarding
http://tolkien.sarang.net/605
http://blog.naver.com/ljsun4336/220650642723

LAN 상의 시스템이 가상 IP 주소를 가지고 외부 공중 네트워크와 통신할 수 있도록 허용하시려면, LAN 시스템에서 외부로 향하는 요청이 방화벽 외부 장치(이 예시에서는 eth0)의 IP 주소로 나가도록 방화벽에 IP masquerading 기능을 설정하십시오:
[root@firewall ~ ]# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-t nat         : NAT packet matching table
-A POSTROUTING : POSTROUTING chain for NAT
-o eth0        : Firewall's external netowrk device
-j MASQUERADE  : Masquerade
이 규칙은 NAT 패킷 매칭표(matching table) (-t nat)을 사용하며 방화벽 외부 네트워킹 장치 (-o eth0)에서 NAT에 내장된 POSTROUTING chain을 (-A POSTROUTING) 지정합니다. POSTROUTING을 사용할 경우 패킷이 방화벽의 외부 장치를 떠날때 변경됩니다. -j MASQUERADE 옵션은 컴퓨터의 사설 IP 주소를 방화벽/게이트웨이의 외부 IP 주소로 바꾸기 위해 사용되었습니다.
http://web.mit.edu/rhel-doc/4/RH-DOCS/rhel-sg-ko-4/s1-firewall-ipt-fwd.html

[참고] (하나의 패키지 업데이트) # yum -y update <PKG>
       (전체 패키지 업데이트  ) # yum -y update
[참고] (전체 패키지 업데이트 작업 순서) # yum check-update | tee -a yum.log
                                        # cat yum.log | grep kernel
                                        # yum -y update

============================================실습============================================

[root@firewall ~]# export LANG=en_US.UTF-8
[root@firewall ~]# system-config-network-tui
[root@firewall ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down interface eth1:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
Bringing up interface eth1:                                [  OK  ]
[root@firewall ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:82:50:11 
          inet addr:192.168.10.100  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe82:5011/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:131 errors:0 dropped:0 overruns:0 frame:0
          TX packets:89 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:31298 (30.5 KiB)  TX bytes:13428 (13.1 KiB)
          Interrupt:67 Base address:0x2024

eth1      Link encap:Ethernet  HWaddr 00:0C:29:82:50:1B 
          inet addr:192.168.20.100  Bcast:192.168.20.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe82:501b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:87 errors:0 dropped:0 overruns:0 frame:0
          TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16052 (15.6 KiB)  TX bytes:14348 (14.0 KiB)
          Interrupt:67 Base address:0x20a4

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1498 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1498 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2523544 (2.4 MiB)  TX bytes:2523544 (2.4 MiB)

[root@firewall ~]# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
[root@firewall ~]# c

[root@firewall ~]# vi /etc/sysctl.conf
[root@firewall ~]# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
[root@firewall ~]# sysctl -a | grep ip_forward
net.ipv4.ip_forward = 1
[root@firewall ~]# c

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[root@firewall ~]# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
[root@firewall ~]# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination        

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination        
MASQUERADE  all  --  anywhere             anywhere           
MASQUERADE  all  --  anywhere             anywhere           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        
[root@firewall ~]# service iptables save
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
[root@firewall ~]# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.3.5 on Wed May 18 01:37:46 2016
*nat
:PREROUTING ACCEPT [1:229]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Wed May 18 01:37:46 2016
[root@firewall ~]# vi /etc/sysconfig/iptables
[root@firewall ~]# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.3.5 on Wed May 18 01:37:46 2016
*nat
:PREROUTING ACCEPT [1:229]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Wed May 18 01:37:46 2016
[root@firewall ~]# chkconfig iptables on
[root@firewall ~]# chkconfig --list iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@firewall ~]#

 


[root@firewall ~]# uname -a
Linux firewall.example.com 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 athlon i386 GNU/Linux
[root@firewall ~]# cat /etc/redhat-release
CentOS release 5.5 (Final)
[root@firewall ~]# yum -y update

 

종료 > 램(1024->512) > 부팅

[root@firewall ~]# uname -a
Linux firewall.example.com 2.6.18-410.el5 #1 SMP Wed May 11 06:00:50 EDT 2016 i686 athlon i386 GNU/Linux
[root@firewall ~]# cat /etc/redhat-release
CentOS release 5.11 (Final)
[root@firewall ~]# vi /etc/inittab
[root@firewall ~]# who -r
         run-level 5  2016-05-18 02:39                   last=S
[root@firewall ~]# init 3

 

CentOS-5.5-i386-bin-DVD (linux200)

ko_windows_server_2008_r2_with_sp1_x64_dvd_617385
windows_7_enterprise_k_with_sp1_x64

DNS 서버 구성
WEB 서버 구성
FTP 서버 구성
MAIL 서버 구성

Posted by 22Hz
, |

==========================================메모==========================================

http://www.netan.go.kr/index.do
http://www.netan.go.kr/share/sub1.jsp?mid=030101

==========================================강의==========================================

1.1.2   정보보호 목표

접근통제, 위험관리, 취약점 분석등 모든 보안을 위한 행위
  -> 기밀성, 무결성, 가용성을 보호하고자 하는 것

● 기밀성(Confidentiality)비 인가된 개인, 단체, 프로세스등으로부터 중요한 정보를 보호하는 것이다.
● 무결성(Integrity)정보의 저장과 전달시 비 인가된 방식으로 정보와 소프트웨어가 변경 파괴되지 않도록 정확성과 완전성을 보호하는 것이다.
● 가용성(Availability)인가된 사용자가 정보나 서비스를 요구할 때 언제든지 즉시 사용 가능하도록 하는 것이다.

1.1.3   정보보안 전문가의 필요성

정보가 중요하다 돈이다, 보호해줄 사람이 필요하다
보안은 주는 아니지만 어디든 포함되어있고 필수적인 부분이기 때문

1.1.4   정보보안 전문가의 역할

1.1.5   직업군 소개

● 보안컨설턴트(Security Consultant)
   > 컨설턴트 > 전임컨설턴트 > 선임컨설턴트 > 책임컨설턴트 > 수석컨설턴트
● 보안관리자(Security Manager)
   > 주로 갑, CERT
● IT 디렉터/매니저(IT Director/Manager)
● 보안 감사관(Security Auditor)
● 보안 아키텍터(Security Architect)
   > 물리적인
● 보안 분석가(Security Analyst)
● 보안 시스템 엔지니어(Security Systems Engineer)
   > 하드웨어적인 개념 포함, 보안장비 납품 및 사후지원

보안제품 개발자
 -> 소프트웨어 개발자
침해사고 대응 전문가
 -> CERT
디지털 포렌식 전문가
 -> 법적인 증거를 찾는다
악성코드 분석 전문가
 -> 백신 패턴 개발
보안 컨설턴트
 -> 포괄적인 개념
보안 관리자
 -> 갑, CERT와는 구분, 네트워크/보안 장비 관리
최고 보안 관리자
 -> CTO, 보안총책임자

제안 요청서(RFP(Request for Proposal))란?
발주 기업이 구축 업체를 선정하기 위한 전단게로 선별된 업체에 보내지며, 사용자가 자사의 시스템에 대한 요구 사항을 체계적으로 정리한 문서이다.

1.3  경찰청 사이버테러대응센터
http://www.netan.go.kr (경찰청 사이버 안전국(Cyber Bubeau))

● 사이버범죄 관련 법령정보 제공 (관련법률)
● 국내의 보안 사고에 대한 통계 자료 제공 (사이버범죄 통계자료)
● 국제사이버범죄대응심포지움(ISCR) 정보 제공 (국제사이버범죄대응심포지움)

1.4  보안 관련 정부 산하 기관

http://spam.kisa.or.kr/kor/main.jsp
https://www.ecmc.or.kr/home.it
http://privacy.kisa.or.kr/kor/main.jsp
http://www.krcert.or.kr/
http://www.iapc.or.kr/

1.2   보안 위협

1.2.1   보안 위협의 종류

보안 위협의 형태
● 보안 위협의 큰 형태로는 흐름 차단(Interruption), 가로채기(Interception), 변조(Modification), 위조(Fabrication)등이 있다.

● (가용성 위협)흐름 차단 : 데이터의 전달을 가로막아서 수신자 측으로의 정보가 전달되는 것을 방해하는 것이다.
● (비밀성 위협)가로채기  : 송신한 데이터가 수신자까지 가는 도중에 인가받지 않은 제 3자가 시스템 자원에 접근하는 행위이다.
● (무결성 위협)변조      : 인가받지 않은 제 3자가 시스템의 자원에 접근하여 데이터를 다른 내용으로 바꾸어 보내는 것이다.
● (무결성 위협)위조      : 인가받지 않은 제 3자가 시스템에 위조물을 삽입하는 행위이다.

위협의 구체적인 형태
● 위협의 구체적인 형태로는
 위장(Masquerade)
 스니핑(Sniffing)
 컴퓨터 바이러스(Computer Virus)
 컴퓨터 웜(Computer Worm)
 트로이 목마(Trojan Horse)
 백도어(Back Door)
 눈속임(Spoofing)
 분산 서비스 거부 공격(Distributed Denial Of Service Attack)
 버퍼 오버플러우 공경(Buffer Overflow Attack)
 내부자 공격(Insider Attack)
 외부자 공경(Outsider Attack)
  등이다.

대한민국의 정보 보안 사고 목록
https://ko.wikipedia.org/wiki/%EB%8C%80%ED%95%9C%EB%AF%BC%EA%B5%AD%EC%9D%98_%EC%A0%95%EB%B3%B4_%EB%B3%B4%EC%95%88_%EC%82%AC%EA%B3%A0_%EB%AA%A9%EB%A1%9D

==========================================실습==========================================

실습 환경 구축


INDEX
--------------------------------------
1.3   실습환경 구축
      1.3.1   VMware 설치 및 설정
      1.3.2   리눅스 설치 및 설정
      1.3.3   윈도우 설치 및 설정
      1.3.4   GNS3 설정 및 설정
      1.3.5   칼리리눅스 설치 및 설정
      1.3.5   서비스 설정
              1.3.5.1   DNS 서버 구성
              1.3.5.2   WEB 서버 구성
              1.3.5.3   FTP 서버 구성
              1.3.5.4   MAIL 서버 구성
--------------------------------------

1.3   실습환경 구축


          Internet
                     |
                     |
                  GNS3(Router + Firewall)
                     |
                     |
         +-----------+ 192.168.10.0/24
         |           |
      10.50       10.100
   KariLinux      firewall    Linux    Win2008      Win7
      20.50       20.100     20.200     20.201     20.202
         |           |          |          |         |
     ----+-----------+----------+----------+---------+---
               192.168.20.0/24


■ 서버 설치시 정보
Firewall(Linux)
● Hostname   : firewall.example.com
● IP/Netmask : eth0(192.168.10.100) Gateway(192.168.10.2) DNS(168.126.63.1)
                eth1(192.168.20.100)
● DISK CAP.  : 30G
● DISK Partition: /, swap(1G), /home(512M)

Linux
● Hostname   : linux200.example.com
● IP/Netmask : eth0(192.168.20.200)DISK CAP.  : 30G
● DISK Partition: /, swap(1G), /home(512M)

Win2008
● Hostname   : win2008
● IP/Netmask : 로컬(192.168.20.201)DISK CAP.  : 30G
● DISK Partition: C:\

Win7
● Hostname   : win7
● IP/Netmask : 로컬(192.168.20.202)DISK CAP.  : 30G
● DISK Partition: C:\

 

리눅스 서버 설치 및 설치후 작업


INDEX
--------------------------------------------
1.   firewall.example.com 서버 설치
2.   firewall.example.com 서버 설치후 작업
     2.1   VMware Tools 설치
     2.2   /etc/hosts 파일 설정
     2.3   root 사용자 환경 파일 설정
     2.4   NIC 추가 작업 및 IP 설정
     2.5   마스커레이딩 설정
     2.6   서버 업데이트
3.   linux200.example.com 서버 설치
4.   linux200.example.com 서버 설치후 작업
     4.1   VMware Tools 설치
     4.2   /etc/hosts 파일 설정
     4.3   root 사용자 환경 파일 설정
     4.4   서버 업데이트
--------------------------------------------

Security과정공유디렉토리(part1)\04_과정진행\01_1.3_실습환경구축\02_리눅스설치\리눅스서버설치및설정.hwp

1. Firewall(firewall.example.com) 서버 설치

● (가정) 리눅스 서버(Firewall)는 설치 되어 있다고 가정한다.
● Firewall(firewall.example.com) 설치시 네트워크 정보는 IP/Netmask    : (eth0) 192.168.10.100/255.255.255.0Defaultrouter : 192.168.10.2 DNS Server IP : 168.126.63.1

(준비사항)
VMware Program : VMware Workstation 10.0.X
Linux CD : CentOS 5.9/5.10 32bit
 파일 이름: CentOS-5.9-i386-bin-DVD-1of2.iso
    CentOS-5.9-i386-bin-DVD-2of2.iso

(1) VMware Installation
VMware Workstation 10.0.X 버전이 설치 되어 있다고 가정한다.

(2) Linux Server(EX: firewall.example.com) Installation

 [참고] VMware에 대한 설명(가상화 솔루션)

 VMware   Windows  Linux(Redhat)
 -----------------------------------------------------------------
 VMware Workstation Virtual PC Xen
 VMware ESXi   Hyper-V  KVM
 -----------------------------------------------------------------

 VM 이름: firewall_오후반
 VM Location : D:\모의해킹침해대응6기\VMwareImage\firewall


(ㄱ) VM(Virtual Machine) 생성

 RedHat 6/7/8/9 --> RHEL(RedHat Enterprise Linux) 2.X/3.X/4.X/5.X/6.X/7.X
  |  |
  V  V
 Fedora  CentOS 2.X/3.X/4.X/5.X/6.X/7.X
 

(ㄴ) Linux 설치

(firewall.example.com 설치 예제)

 ■ CD Found : [ Skip ]
 ■ CentOS 화면 : Next
 ■ 언어 선택 화면 : Korean
 ■ 키보드 선택 화면 : U.S. 영어
 ■ 파티션 설정 화면 : 사용자 레이아웃 만들기
  /(root) 나머지 용량
  swap 1024
  /home 500
 ■ 부트로더 선택 화면 : Next
 ■ 네트워크 설정 화면 : 편집
  IP/Netmask : 192.168.10.100/255.255.255.0
  Gateway    : 192.168.10.2
  DNS        : 168.126.63.1/164.124.101.2
  Hostname   : firewall.example.com
 ■ 로케일 선택 화면 : Next
 ■ Root 암호 설정 화면 : soldesk1.
 ■ 패키지 선택 화면 : [ V ] Server
                       [ V ] Server - GUI
 ■ 2번 CD 교체 화면
 ■ 재부팅

 ■ 환영합니다. 화면 : Next
 ■ 방화벽 화면 : 비활성화
 ■ SELinux 화면 : 비활성화
 ■ Kdump 화면 : Next
 ■ 날짜 및 시간 : Next
 ■ 사용자 생성 : Next
 ■ 사운드 카드 테스트 화면 : Next
 ■ 추가 CD : FINISH

 재부팅 후에 로그인 창이 뜨면 root/soldesk1. 로그인
 

 


2.1  VMware Tools 설치

① VMware Tools 설치
● VMware > VM > Install VMware Tools

# df -h
# cd /media/VM[TAB]
# pwd
# ls

# mkdir /test
# cp * /test

# cd /test
# ls

# tar xvzf VM[TAB]
......
# ls

# cd vmware-tools[TAB]
# ls

# ./vmware-install.pl -default   (# ./vmware-install.pl -d)
-> 약간의 시간이 걸린다.(약 1 ~ 2분정도)

② 로그아웃 후 새로 로그인
< CTRL + ALT + <- > => 관리자로 새로 로그인


 

'모의해킹 침해대응 전문가 과정' 카테고리의 다른 글

20160518 네트워크이론  (0) 2016.05.19
20160517 실습환경구축  (0) 2016.05.19
20160516 윈도우 서버  (0) 2016.05.19
20160513 윈도우 서버  (0) 2016.05.14
20160512 윈도우 서버  (0) 2016.05.14
Posted by 22Hz
, |

==========================================메모==========================================
==========================================강의==========================================

DDNS

==========================================실습==========================================

(FIRST)

c:\interpub\ftproot\ 에 파일 생성

(CLIENT)

알툴즈 > 알드라이브 설치/실행 > 접속하기 192.168.10.10 : 익명로그인 > 연결

파일 다운로드 테스트

파일 업로드 테스트 : 안됨 (읽기만 허용)

(FIRST)

서버관리자 > 도구 > IIS관리자 > 연결 > FIRST > 사이트 > Default FTP Site > FTP 권한 부여 규칙
 -> 모든 사용자 > 편집 > 읽기/쓰기 > 확인
 -> Default FTP Site > 오른쪽 : 사용권한편집 > 보안 > 편집 > 사용 권한 IUSR : 모든권한 > 확인
 -> 다시 시작

(CLIENT)

파일 업로드 테스트

 

 

 


DNS DNS DNS DNS DNS

(FIRST)

nslookup

DNS서버 주소를 바꿔서(192.168.10.88) DNS 서비스 확인

 


(FIRST)

서버관리자 > 관리 > 역할및기능추가 > 서버역할 : DNS Server > 설치 > 방화벽 해제
* 서버 2012 R2 에서 DNS Server 역할을 설치하기만 하면 자동으로 캐싱 전용 DNS 서버가 되는 것이다

(CLIENT)

DNS 서버 : 192.168.10.10

 

 

(FIRST)

DNS 서버 역할(캐싱전용DNS서버, 표준DNS서버)

(SECOND)

Web 서버(IIS) 설치
방화벽 해제

(THIRD)

알FTP서버 설치 > 아이디 없이 접속 허용 > 서버 시작
방화벽 해제

(FIRST)

서버관리자 > 도구 > DNS > 정방향조회영역 > 새영역 > 영역형식 : 주영역 > 영역이름 : brain.com > 마침

(CLIENT)

http://www.brain.com/
ftp://ftp.brain.com/

 

라운드 로빈

(FIRST)

DNS 정방향 조회 영역 삭제 후 새로 추가

(CLIENT)

http://www.brain.com/

 

 

메일서버구축

(FIRST)

DNS Server > .Net Framework 3.5 Features
서버관리자 > 도구 > DNS > FIRST > 정방향조회영역 > 새영역 > daum.net
 -> 새호스트 > email.daum.net > 192.168.10.10
    -> 새 MX(메일 교환기) > 찾아보기 > email 선택 > 확인
 -> 새호스트 > email.naver.com > 192.168.10.20
    -> 새 MX(메일 교환기) > 찾아보기 > email 선택 > 확인

DNS서버 : 192.168.10.10
방화벽 해제
https://www.hmailserver.com/download > 설치
교재 562p 따라서 진행 ~

(CLIENT)

https://www.mozilla.org/ko/thunderbird/ > 설치

(SECOND)

.Net Framework 3.5 Features 설치
DNS서버 : 192.168.10.10
방화벽 해제
https://www.hmailserver.com/download > 설치
교재 573p 따라서 진행 ~

(THIRD)

http://www.opera.com/ko/computer/mail > 설치

lee@naver.com -> kim@daum.net 메일 송수신 확인. 완료.

 

 


끝.

 

 

Posted by 22Hz
, |

==========================================메모==========================================

http://codeengn.com/
http://codeengn.com/archive/
구글 : site:http://codeengn.com/ intitle:index of

==========================================강의==========================================

MBR(Master Boot Record) 일반적으로 2.2TB 이하에서 사용
GPT(GUID Partition Table) 최대 약 9ZB까지 지원

Byte > KB > MB > GB > TB > PB > EB > ZB > YB
Kilo, Mega, Giga, Tera, Peta, Exa, Zetta, Yotta

Windows 파일 시스템
FAT -> FAT32 -> NTFS -> ReFS
NTFS(New Technology File System)
 -> 한 개 파일 크기는 16TB까지 지원, 파일 압축, 보안, 쿼터, 볼륨 크기 재할당 등의 특징
ReFS(Resilient File System : 복원 기능의 파일 시스템)
 -> NTFS의 장점과 호환성을 최대한 유지
 -> 데이터 오류를 자동으로 확인하고 수정
 -> 데이터가 손상된 경우에도 실시간으로 최대한 데이터를 복구. 즉, 온라인상에서 작업이 진행
 -> 대용량 볼륨 및 파일의 크기를 지원

RAID : Redundant Array of Inexpensive(or Independent) Disks
원래 목적은 저렴한 저용량의 디스크 여러 개를 하나의 비싼 대용량의 디스크로 사용하고자 하는 것

저장소 공간이란 일종의 LVM
 -> 저장 공간을 동적으로 유연하게 확장 가능
 -> 내부적으로 RAID1 이나 RAID5 기술을 사용함으로써 데이터를 보호
 -> 소프트웨어적으로 구현할 수 있기에 경제적으로 상당한 비용을 절감
 -> 핫 스페어(Hot Spare) 개념의 디스크
    > http://blog.naver.com/jtway/220179611085
 -> 장애 조치(failover) 클러스터
 -> 저장소 계층의 분리(Automated Tearing)
    > 자주 사용되는 파일은 SSD로, 자주 사용되지 않는 파일은 HDD로 분리
      > 전반적인 성능향상이 가능 (내부적으로 자동 수행)
 -> 나중 쓰기 캐시
    > 전달된 데이터를 SSD 저장소 풀에 먼저 저장한 후에
      > 나중에 HDD에 저장되는 방식을 사용 > 빠른 데이터 자장과 성능이 보장


네트워크 스토리지

DAS(Direct Attached Storage)
 -> Internal DAS : PC 내부 DISK
 -> External DAS : 외장 DISK
(PC)-[HBA : Host Bus Adapter]-[광케이블]-(스토리지)

NAS(Network Attached Storage)
(PC)[파일시스템]-(서버)-(스토리지) ??

SAN(Storage Area Network)
(PC)-[파일시스템](서버)-(스토리지) ??

==========================================실습==========================================

5.1 하드디스크 추가

시작 > (컴퓨터 관리) > 디스크 관리
                       -> CD/DVD (R:)
                       -> 추가 디스크 (200GB) > 온라인 > 초기화(MBR)
                          -> 100GB(D:), 100GB(E:)

C: 파티션 60GB 에서 40GB 로 축소 > 할당되지않은 20GB 새로운 파티션 (F:) 생성

F: 파티션 볼륨 삭제 > C: 파티션 볼륨 확장 (40GB + 20GB)

RAID 구성 실습을 위해 SCSI 방식으로 2GB 1개, 1GB 8개 추가
 -> 온라인, 디스크 초기화 > 동적 디스크 변환

레이드(스팬, 스트라이프, 미러, RAID-5) 구성
그림1 ~ 그림3

각 레이드 파티션(T:, U:, V:, W:)에 파일 복사 > 셧다운
SCSI 0:3, SCSI 0:5, SCSI 0:8, SCSI 0:10 디스크 제거
그림4 ~ 그림6

내용 확인 후 > 셧다운 > 디스크 4개 추가(SCSI 0:3, SCSI 0:5, SCSI 0:8, SCSI 0:10 확인) 후 > 부팅

시작 > 디스크 관리 > 초기화
       -> 스팬, 스트라이프 : 볼륨 삭제, 동적 디스크 변환, 새 스팬/스트라이프 볼륨
       -> 미러 : 미러 제거 > 미러 추가 (동기화)
       -> RAID-5 : 볼륨 복구 (동기화)

오류로 남아있는 없음 디스크 > 디스크 제거

그림7 ~ 그림11


FIRST > 스냅샷매니저 > 설정 완료 : Go To (복원)

디스크 (5GB, 4GB, 4GB, 6GB) 추가 > 부팅

시작 > 디스크 관리 : 확인

시작 > 프로그램 및 관리 > Windows 기능 켜기/끄기
                          > 서버 역할 : Windows Server Essentials Experience 추가 > 설치

시작 > 제어판 > 저장소 공간 > 저장소 풀 만들기 > 풀 만들기
그림12

저장소 공간 만들기(교재참고)
그림13, 그림14, 그림15

20GB 디스크 추가 > 제어판 > 저장소 공간 > 설정 변경 > 드라이브 추가
그림16

 

FIRST 초기화 > 서버관리자 > 관리 > 역할및기능추가 > 텔넷서버/클라이언트 > 설치

시작 > 컴퓨터관리 > 서비스및응용프로그램 > 서비스 > Telnet > 속성 > 시작유형 : 자동 > 적용 > 시작

방화벽 해제 or telnet 허용

 

WINCLIENT > 제어판 > 프로그램 및 기능 > Windows 기능 켜기/끄기 > Telnet Client > 설치

 


FIRST 초기화 > 서버관리자 > 관리 > 역할및기능추가 > 서버역할 > Web Server(IIS)
 > .NET Framework 3.5 Features > 역할서비스 > Application Development - CGI, FTP Server : 체크

 

그림17


FIRST > cmd > inetmgr

그림18, 그림19, 그림20 ~

 

 

 

 

 

Posted by 22Hz
, |

============================================메모============================================

파이어폭스 짱

============================================강의============================================

사용자는 그룹에 반드시 속해야 하고 그룹은 권한 이라고 보면 된다

보안 관련 설정
 - 데이터 암호화
 - 인증서의 백업과 복원
 - 암호를 잊어버릴 경우를 대비한 디스크 생성
 - 암호와 관련된 여러 가지 제한

대칭키(키가 1개, 암호화키==복호화키), 비대칭키(키가 2개, 암호화키=/=복호화키)

파일과 키를 따로 전송 (한군데에 담아서 주면 위험)

패스워드히스토리 : 이전에 사용했던 암호를 기록으로 남겨서 새로운 암호와 비교 (동일하면 안되니까)

============================================실습============================================

WIN CLIENT OS

실행 > gpedit.msc
       -> 컴퓨터 구성 > Windows 설정 > 보안설정 > 로컬정책 > 보안옵션
                                                             -> 대화형로그온 : 사용

       -> 컴퓨터 구성 > 관리템플릿 > 시스템
                                     -> 시스템 종료 이벤트 추적기 표시 : 사용 안함

실행 > control userpasswords2 > 사용자 이름과 암호를 입력해야 ~ : 언체크

시작 > 프로그램 및 기능 > Windows 기능 켜기/끄기
                          -> 역할 및 기능 추가 마법사 > 다음
                             -> 설치 유형 > 역할 기반 또는 기능 기반 설치 > 다음
                                -> 서버 선택 : 기본값 > 다음
                                   -> 서버 역할 : 기본값 > 다음
                                      -> 사용자 인터페이스 및 인프라 > 데스크톱 경험 : 체크 > 다음
                                         -> 필요한 경우 자동으로 ~ : 체크 > 예 > 설치

자동으로 진행/재부팅

시작 > 컴퓨터 관리 > 시스템 도구 > 로컬 사용자 및 그룹 > 사용자
                                                         -> 새 사용자 : WinAdmin / soldesk1.
                                                            -> 다음 로그온 시 사용자가 ~ : 언체크
                                                            -> 사용자가 암호를 ~ : 체크
                                                            -> 암호 사용 기간 ~ : 체크
                                                               -> 만들기, 닫기

WinAdmin > 소속 그룹 > 추가 > Administrators > 이름 확인, 확인

Administrators > 암호 사용 기간 ~, 계정 사용 안 함 : 체크

재부팅

WinAdmin 으로 계정명 변경해서 로그인 (Administrators 계정을 사용 안하기 때문에)

서버관리자 > 관리 > 서버 관리자 속성 > 로그온 시 서버 관리자를 자동으로 시작 안 함 : 체크

실행 > control userpasswords2

 


(FIRST)

시작 > 실행 > msconfig > 부팅 > 안전부팅 : 체크

안전모드로 부팅 > 시작 > 실행 > msconfig > 부팅 > 안전부팅 : 언체크

시작 > 실행 > shell:startup
            > C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

            > mspaint.exe 바로가기 생성
            > 새로만들기 > 텍스트 문서

그림1

user1 / soldesksecurity1.

<-> Administrators

시작 > 시스템 > 원격 설정 > 이 컴퓨터에 대한 원격 연결 허용 > 네트워크 수준 인증을 ~ : 언체크

시작 > 제어판 > Windows 방화벽 > 고급 설정
                                 -> 고급 보안이 포함된 Windows 방화벽 > 모니터링 > 방화벽

방화벽 해제

 


(CLIENT)

시작 > 원격 데스크톱 > 192.168.10.10 > user2 / soldesk1. 연결 시도시 원격로그인 권한이 없어서 접속X

 


(FIRST)

user2 의 소속그룹에 Remote Desktop Users 추가

 

(CLIENT)

user2 로 다시 원격접속 시도 > 성공

그림2

 

(FIRST)

user1, user2, user3 / soldesk1. / 사용자가 암호를 변경할 수 없음, 암호 사용 기간 제한 없음 : 체크

색인(index)
시작 > 서버 관리자 > 관리 > 역할 및 기능 추가 > Windows Search Service 설치

시작 > 제어판 > 색인 옵션 > 수정 > C드라이브 색인 생성

파일 탐색기 > 보기 > 옵션 (시작 > 제어판 > 폴더 옵션)
                     -> 폴더 옵션 > 보기
                                    -> 보호된 운영 체제 파일 숨기기(권장) : 언체크
                                    -> 숨김 파일 및 폴더 표시 : 체크
                                    -> 알려진 파일 형식의 파일 확장명 숨기기 : 언체크

시작 > 실행 > iexpress

그림3

시작 > 실행 > cmd > cipher /w:c:

그림4 (삭제 파일을 복구 불가하게 만들기)

 

user1 로 로그인 해서

텍스트 파일 생성 > 속성 > 고급 > 데이터 보호를 위해 내용을 암호화 > 파일만 암호화

그림5

* 파일 또는 폴더가 암호화 : 초록색
* 압축되었다면 : 파란색

 

user2 로 로그인 해서 파일 확인

그림6

 

다시 user1 로 로그인

파일 시스템 암호화 > 지금 백업(권장) > soldesk1. > C:\암호화연습\인증서키.pfx

Alt + F4 (로그아웃)

 

user2 로 로그인

인증서키.pfx 실행 > 인증서 가져오기 마법사 >
인증서키.pfx > 오른쪽버튼 > PFX 설치
시작 > 실행 > certmgr.msc > 개인용 > 모든작업 > 가져오기 > 선택
 -> 암호입력 > 마침

암호화 텍스트 파일을 열면 확인할수 있다 (user1에게 키를 받아서 등록했기 때문에)

그림7

 


셧다운, 플로피드라이브 추가 > password.flp 플로피이미지 생성 > 시스템기동

Administrators 로그인

플로피 디스크 드라이브 포맷(빠른포맷)

시작 > 제어판 > 사용자계정 > 암호재설정디스크만들기(userkey.psw)

로그아웃, Administrators 로그인 할때 잘못된 암호를 입력하면 암호재설정 활성화 > 클릭

암호를 재설정할수있게 된다 (암호를 잊었을 경우에, 암호화키를 저장한 디스크를 이용하면)

 


시작 > 제어판 > 관리 도구 > 로컬 보안 정책 > 계정 정책 > 암호 정책
 -> 암호는 복잡성을 만족해야 함 : 사용 안 함
 -> 최소 암호 길이 : 8 문자
 -> 최근 암호 기억 : 2개 암호 기억됨
> 계정 잠금 정책
  -> 계정 잠금 기간 : 30분
  -> 계정 잠금 임계값 : 3 번의 잘못된 로그온 ~
  -> 다음 시간 후 계정 잠금 수를 원래대로 설정 : 30분


시작 > 제어판 > 네트워크 및 공유 센터 > 고급 공유 설정 변경
 -> 개인 > 네트워크 검색 켜기, 파일 및 프린터 공유 켜기
 -> 게스트 또는 공용 > 네트워크 검색 켜기, 파일 및 프린터 공유 켜기
 -> 모든 네트워크 > 네트워크 액세스 권한이 있는 모든 사용자가 ~

 

공유폴더 생성

그림8 ~ 그림13

 

 

 

 

'모의해킹 침해대응 전문가 과정' 카테고리의 다른 글

20160516 윈도우 서버  (0) 2016.05.19
20160513 윈도우 서버  (0) 2016.05.14
20160511 윈도우 서버  (0) 2016.05.12
20160511 리눅스 네트워크  (0) 2016.05.12
20160510 리눅스 네트워크  (0) 2016.05.11
Posted by 22Hz
, |

=============================================메모=============================================

http://www.hanbit.co.kr/media/community/board_list.html
http://www.hanbit.co.kr/media/community/brain_default_board_list.html?bd_id=win2008data

=============================================강의=============================================

ko_windows_server_2012_r2_with_update_x64_dvd_6052743 / 5.09GB (5,475,792,896 바이트)
windows_7_enterprise_k_with_sp1_x64 / 2.90GB (3,122,055,168 바이트)

구축환경 : 서버1(FIRST), 서버2(SECOND), 서버3(THIRD), 클라이언트(WINCLIENT)

Windows Server 2012 R2 Datacenter (FIRST)

Windows Server 2012 R2 Server Standard (SECOND, THIRD)
책에서는 스탠다드를 사용했는데 학원에서는 데이터센터버전 씀..


*NAT 방식
eth0 -> VMnet8 -> Win7 N/A
라우터의 역할을 해준다 양쪽에 IP가 존재. 대역을 설정
eth0의 게이트웨이를 VMnet8에 맞춰야한다
제어판 > 네트워크 및 인터넷 > 네트워크 연결 > VMware Network Adapter VMnet8 (192.168.10.1)
Edit > Virtual Network Editor > NAT Settings 에서 확인 (192.168.10.2)
사설IP/공인IP 상관없이 통신가능(가상OS간 직접통신시 포트포워딩 설정 필요)


*Bridge 방식
eth0 -> VMnet0 = Win7 N/A
가상OS의 네트워크카드가 베이스OS의 네트워크카드 취급
eth0의 게이트웨이를 Win7에 맞춰야한다
172.16.6.31
172.16.6.220
같은 네트워크의 윈도우, 리눅스와 연결에 문제없음. 통신이 잘 됨
공인IP 1개만 할당받는 체계에서는 무리

http://sungwooki.com/40191780222
http://blog.naver.com/webman21/220289945867
http://blog.naver.com/yunuri1012/80196521529
http://itmore.tistory.com/entry/NAT-%EC%99%80-Bridged-Networking-%EA%B0%9C%EB%85%90-%EC%A0%95%EB%A6%AC


스냅샷(snapshot)이란?
http://hybridstoragekorea.blogspot.kr/2013/10/blog-post_4204.html


SECOND/THIRD 설치 후 작업

1. Server Manager를 다시 실행하지 않도록 설정

2. VMware Tools 설치

3. IP 설정
   192.168.10.10(20/30) / 255.255.255.0 / 192.168.10.2

4. 컴퓨터 이름 변경
   FIRST / SECOND / THIRD

5. 디스플레이 끄는 시간 설정

6. 화면 해상도 조정 : 1024 x 768

7. IE 보안 구성 -> 끄기

8. 윈도우즈 업데이트 기능 끄기

9. administrator 암호 사용기간 제한 없음

10. 스냅샷 설정

=============================================실습=============================================

암호 : soldesk1.

Ctrl + Alt + Insert

Edit > Virtual Network Editor > NAT Settings > Use Local DHCP service to distribute IP address to VMs

VM > Install VMware Tools
     -> 서버2012에 VMware Tools 마운트 표준설치 -> 재부팅

제어판 > 하드웨어 > 전원 옵션 > 전원 관리 옵션 설정 편집 > 디스플레이 끄기 : 해당 없음

제어판 > 화면 배색 > 디스플레이 > 화면 해상도 > 해상도 : 1024 x 768

서버관리자 > 로컬서버 > IE보안강화구성 > 사용안함

시작 > 컴퓨터관리 > 시스템도구 > 로컬사용자및그룹 > 사용자 > Administrator > 일반
                                                                             -> 암호 사용 기간 제한 없음

제어판 > 모든 제어판 항목 > Windows 업데이트 > 설정 변경 > 중요 업데이트
                                                           -> 업데이트를 확인하지 않음(권장하지 않음)




'모의해킹 침해대응 전문가 과정' 카테고리의 다른 글

20160513 윈도우 서버  (0) 2016.05.14
20160512 윈도우 서버  (0) 2016.05.14
20160511 리눅스 네트워크  (0) 2016.05.12
20160510 리눅스 네트워크  (0) 2016.05.11
20160509 리눅스 네트워크  (0) 2016.05.10
Posted by 22Hz
, |

=============================================메모=============================================

폰트 : Fixed, LucidaTypewriter Sans, MiscFixed Semicondensed (12포인트)

=============================================강의=============================================

# smbclient
-U|--user=username[%password]
-U 옵션 아이디%비밀번호
https://www.samba.org/samba/docs/man/manpages/smbclient.1.html


(실무 예)

■ /usr/share 디렉토리 공유
   -> 윈도우에서 리눅스 문서를 보기 위해서
   # ls /usr/share
   # ls /usr/share/doc
   # ls /usr/share/doc/yum-3.2.22

■ 개발자가 소스 폴더(EX: /source)를 공유하는 경우
   -> 개발 환경은 LINUX 이지만 LINUX VI 편집기 사용이 불편한 경우
   -> LINUX 서버에 소스 공유를 걸고
   -> 윈도우에서 툴(Edit Plus, Ultra Editor)을 통해 개발한다.

■ "L4/DNS --- WEB1/WEB2/WEB3 --- NFS/SAMBA" 구조

■ File Server(Windows File Server or Linux File Server)
   -> 윈도우 서버의 폴더를 공유하여 파일들을 공유하는 경우
      바이러스(프로그램) 배포의 원인이 될 수 있다.
   -> 리눅스 서버의 폴더를 공유하여 파일들을 공유하는 경우
      바이러스(프로그램)가 정상 동작하지 않는다.

■ Windows(Printer) -------> Linux Server
                             # lp /etc/passwd
                             [참고] http://www.netsarang.co.kr -> xlpd(윈도우에 설치)

■ Disk(Resource) 공간 제공
   Windows Server(100G) + 5TB(공간 필요) <------ Linux(SAMBA)

=============================================실습=============================================

(S)
[root@linux220 ~]# smbclient -L localhost -N
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Sharename       Type      Comment
        ---------       ----      -------
        public          Disk      Samba Test
        IPC$            IPC       IPC Service (Samba Server linux220)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Server               Comment
        ---------            -------
        LINUX220             Samba Server linux220
        LINUX252             Samba Server(linux252) Version 3.0.33-3.41.el5_1
        SOLDESK-PC          

        Workgroup            Master
        ---------            -------
        WORKGROUP            LINUX252
[root@linux220 ~]# cd /etc/samba
[root@linux220 /etc/samba]# vi smb.conf
[root@linux220 /etc/samba]# cat smb.conf | tail -7
[public]
                comment = Samba Test
                path = /samba
                public = yes
                writable = yes
                printable = no

[root@linux220 /etc/samba]#


(C)
[root@linux120 ~]# mkdir -p /p
[root@linux120 ~]# mount.cifs //172.16.6.220/public /p
Password:
[root@linux120 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final
//172.16.6.220/public
              cifs     36G  5.0G   29G  15% /p
[root@linux120 ~]# cd /p
[root@linux120 /p]# ls
Linux_CentOS_NFS_2014_0519.pdf  passwd
[root@linux120 /p]# cd
[root@linux120 ~]# umount /p
[root@linux120 ~]# df -h -t nfs
Filesystem    Type    Size  Used Avail Use% Mounted on
[root@linux120 ~]#


(S)
[root@linux220 /etc/samba]# vi smb.conf
[root@linux220 /etc/samba]# cat smb.conf | tail -14
[test1]
                comment = Linux Samba Test
                path = /test1
                writable = yes
                printable = no
                valid users = test1 admin

[test2]
                comment = Linux Samba Test
                path = /test2
                writable = yes
                printable = no
                valid users = test2 admin

[root@linux220 /etc/samba]# service smb restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]
[root@linux220 /etc/samba]# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[public]"
Processing section "[test1]"
Processing section "[test2]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        server string = Samba Server linux220
        passdb backend = tdbsam
        hosts allow = 127., 172.16., 192.168.10.
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No

[public]
        comment = Samba Test
        path = /samba
        read only = No
        guest ok = Yes

[test1]
        comment = Linux Samba Test
        path = /test1
        valid users = test1, admin
        read only = No

[test2]
        comment = Linux Samba Test
        path = /test2
        valid users = test2, admin
        read only = No
[root@linux220 /etc/samba]# useradd -s /sbin/nologin test1
[root@linux220 /etc/samba]# useradd -s /sbin/nologin test2
[root@linux220 /etc/samba]# useradd -s /sbin/nologin admin
[root@linux220 /etc/samba]# smbpasswd -a test1
New SMB password:
Retype new SMB password:
Added user test1.
[root@linux220 /etc/samba]# smbpasswd -a test2
New SMB password:
Retype new SMB password:
Added user test2.
[root@linux220 /etc/samba]# smbpasswd -a admin
New SMB password:
Retype new SMB password:
Added user admin.
[root@linux220 /etc/samba]# mkdir -p /test1 /test2
[root@linux220 /etc/samba]# chmod 777 /test1
[root@linux220 /etc/samba]# chmod 777 /test2
[root@linux220 /etc/samba]# cp /etc/passwd /test1
[root@linux220 /etc/samba]# cp /etc/hosts /test2
[root@linux220 /etc/samba]#


(C)
[root@linux120 ~]# smbclient //172.16.6.220/test1 -U test1
Password:
Domain=[LINUX220] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]
smb: \> help
?              altname        archive        blocksize      cancel        
case_sensitive cd             chmod          chown          close         
del            dir            du             exit           get           
getfacl        hardlink       help           history        lcd           
link           lock           lowercase      ls             mask          
md             mget           mkdir          more           mput          
newer          open           posix          posix_open     posix_mkdir   
posix_rmdir    posix_unlink   print          prompt         put           
pwd            q              queue          quit           rd            
recurse        reget          rename         reput          rm            
rmdir          showacls       setmode        stat           symlink       
tar            tarmode        translate      unlock         volume        
vuid           wdel           logon          listconnect    showconnect   
!             
smb: \> dir
  .                                   D        0  Wed May 11 16:31:03 2016
  ..                                  D        0  Wed May 11 16:03:55 2016
  file3                               A    95116  Thu Apr 28 22:01:25 2016
  dir1                                D        0  Thu Apr 28 22:01:37 2016
  file2                               A     2076  Thu Apr 28 18:26:04 2016
  .file4                              H      530  Thu Apr 28 22:01:36 2016
  file1                               A     2076  Thu Apr 28 18:26:04 2016
  passwd                                    2483  Wed May 11 16:31:03 2016

                36244 blocks of size 1048576. 29330 blocks available
smb: \> lcd /tmp
smb: \> mget *
Get file file3? y
getting file \file3 of size 95116 as file3 (1574.3 kb/s) (average 1574.4 kb/s)
Get file file2? y
getting file \file2 of size 2076 as file2 (144.8 kb/s) (average 1300.2 kb/s)
Get file .file4? y
getting file \.file4 of size 530 as .file4 (517.5 kb/s) (average 1289.6 kb/s)
Get file file1? y
getting file \file1 of size 2076 as file1 (2027.1 kb/s) (average 1299.5 kb/s)
Get file passwd? y
getting file \passwd of size 2483 as passwd (2424.6 kb/s) (average 1314.3 kb/s)
smb: \> quit
[root@linux120 ~]# ls -l /tmp/passwd
-rw-r--r-- 1 root root 2.5K May 11 16:33 /tmp/passwd
[root@linux120 ~]# ls -l /tmp/
total 232K
-rw-r--r-- 1 root root 2.1K May 11 16:33 file1
-rw-r--r-- 1 root root 2.1K May 11 16:33 file2
-rw-r--r-- 1 root root  93K May 11 16:33 file3
drwx------ 3 root root 4.0K May 11 16:04 gconfd-root
srwxr-xr-x 1 root root    0 Apr 20 17:35 gnome-system-monitor.root.2636151346
drwx------ 2 root root 4.0K May 11 16:04 keyring-8L90d4
srwxr-xr-x 1 root root    0 May 11 16:04 mapping-root
drwx------ 2 root root 4.0K May 11 16:22 orbit-root
-rw-r--r-- 1 root root 2.5K May 11 16:33 passwd
-rw-r--r-- 1 root root    5 May 11 16:22 scim-bridge-0.3.0.lockfile-0@localhost:0.0
srwxr-xr-x 1 root root    0 May 11 16:22 scim-bridge-0.3.0.socket-0@localhost:0.0
srw------- 1 root root    0 May 11 16:04 scim-helper-manager-socket-root
srw------- 1 root root    0 May 11 16:04 scim-panel-socket:0-root
srw------- 1 root root    0 May 11 16:04 scim-socket-frontend-root
drwx------ 2 root root 4.0K May 11 16:04 ssh-VwXUcb4621
drwxrwxrwx 2 root root 4.0K Apr 20 20:14 test
-rw-r--r-- 1 root root  76K May 11 16:03 vgauthsvclog.txt.0
drwx------ 2 root root 4.0K May 11 16:04 virtual-root.En21iA
drwxrwxrwt 2 root root 4.0K May 10 16:04 VMwareDnD
drwx------ 2 root root 4.0K May 11 16:04 vmware-root
[root@linux120 ~]# smbclient //172.16.6.220/test2 -U test2
Password:
Domain=[LINUX220] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]
smb: \> dir
  .                                   D        0  Wed May 11 16:31:07 2016
  ..                                  D        0  Wed May 11 16:03:55 2016
  file3                               A    95116  Thu Apr 28 22:01:25 2016
  hosts                                      276  Wed May 11 16:31:07 2016
  dir1                                D        0  Thu Apr 28 22:01:37 2016
  file2                               A     2076  Thu Apr 28 18:26:04 2016
  .file4                              H      530  Thu Apr 28 22:01:36 2016
  file1                               A     2076  Thu Apr 28 18:26:04 2016

                36244 blocks of size 1048576. 29330 blocks available
smb: \> lcd /tmp
smb: \> mget *
Get file file3? y
getting file \file3 of size 95116 as file3 (1386.4 kb/s) (average 1386.4 kb/s)
Get file hosts? y
getting file \hosts of size 276 as hosts (269.5 kb/s) (average 1369.9 kb/s)
Get file file2? y
getting file \file2 of size 2076 as file2 (1013.6 kb/s) (average 1359.8 kb/s)
Get file .file4? y
getting file \.file4 of size 530 as .file4 (517.5 kb/s) (average 1347.9 kb/s)
Get file file1? y
getting file \file1 of size 2076 as file1 (2027.1 kb/s) (average 1357.3 kb/s)
smb: \> quit
[root@linux120 ~]# ls -l /tmp/hosts
-rw-r--r-- 1 root root 276 May 11 16:34 /tmp/hosts
[root@linux120 ~]#


리눅스 끝.

'모의해킹 침해대응 전문가 과정' 카테고리의 다른 글

20160512 윈도우 서버  (0) 2016.05.14
20160511 윈도우 서버  (0) 2016.05.12
20160510 리눅스 네트워크  (0) 2016.05.11
20160509 리눅스 네트워크  (0) 2016.05.10
20160504 리눅스 네트워크  (0) 2016.05.05
Posted by 22Hz
, |

================================================메모================================================

\\172.16.13.1
\04_과정진행
\01_1.1_정보보안 및 정보보안전문가의 역할
파일이름 : 정보보안및정보보안전문가의역할.hwp

================================================강의================================================

6 WEB Mail (Open Source Web Mail)

무료 웹메일의 종류

■ Roundcube Webmail
   - http://roundcube.net/

■ Squirrelmail (일명: 다람쥐 웹메일)
   - http://squirrelmail.org/
   - http://blog.naver.com/dwb01?Redirect=Log&logNo=40063038950
   - http://blog.naver.com/june8th98/150014363290
   - http://moyaria.tistory.com/59
   - http://kjhfull.tistory.com/entry/centoswebmail

■ Nutsmail
   - http://nutsmail.com/

■ Atmail
   - http://atmail.com/

[EX1] 다람쥐 웹메일 설치하고 설정하기

설정할 때 다음과 같이 사이트를 참고 하였다.
   - http://blog.naver.com/dwb01?Redirect=Log&logNo=40063038950
   - http://kjhfull.tistory.com/entry/centoswebmail
   - http://blog.naver.com/june8th98/150014363290
   - http://moyaria.tistory.com/59

http://www.spamassassin.org/
The official site of the SpamAssassin project.
(설정하는 방법 참고) http://blog.naver.com/PostView.nhn?blogId=khi830&logNo=20107472547

NFS(Network File System)
■ 분산 파일 시스템 : NFS(UNIX/LINUX), CIFS(WINDOWS)

(1) NFS 서버 데몬
NFS 서버는 언제든지 클라이언트가 마운트 할 수 있도록 준비 되어 있어야 하며 NFS는 rpc.mountd, rpc.nfsd 두 데 몬을 가지고 있다. rpc.mountd 데몬과 rpc.nfsd 데몬은 RPC 기반의 서비스이기 때문에, rpcbind(portmapper)가 반 드시 떠 있어야만 사용이 가능하다.

(2) NFS 관련 파일 
■ /etc/exports (NFS Server)에서 부팅시에 공유하는 정보를 담는 파일
■ /etc/fstab  (NFS Client)에서 부팅시에 마운트하는 정보를 담는 파일

(3) NFS 관련 명령어
■ exportfs 명령어 (NFS Server) 공유자원을 확인 할 때 사용하는 명령어
■ showmount 명령어 (NFS Client) 공유할 자원 확인 할 때 사용하는 명령어
■ mount 명령어 (NFS Client) 공유된 자원 마운트 할 때 사용하는 명령어

(3-1) exportfs 명령어

NFS 서버에서 공유된 자원을 확인 할 때 사용하는 명령어이다.

(명령어 형식)
# exportfs         /* 공유된 자원 정보를 간략하게 보여준다. */
# exportfs -v      /* 공유된 자원 정보를 자세하게 보여준다. */
# exportfs -ar     /* 공유된 자원 목록(예: /etc/exports)을 다시 읽는다.(reread) */

■ NFS 서버에서 디렉토리 공유 방법
------------------------------------------
(첫번째 방법)  # vi /etc/exports
/share  *(rw)
# service nfs restart
------------------------------------------
(두번째 방법) # vi /etc/exports
/share  *(rw)
# exportfs -ar
------------------------------------------

(3-2) showmount 명령어

NFS 서버의 공유된 자원을 확인할 때 사용한다.

(명령어 형식)
# showmount -e                /* 로컬 서버에 공유된 자원 확인 */
# showmount -e 172.16.9.252   /* 원격 서버에 공유된 자원 확인 */

(3-3) mount 명령어

NFS 서버의 공유된 자원을 마운트 할 때 사용하는 명령어이다.
현재 마운트 할 때는 mount 명령어를 사용하고 부팅시에 마운트하기 위해서는 /etc/fstab 파일을 사용한다.

(명령어 형식)
# mount [-t nfs] nfs.linux.co.kr:/usr/local /usr/local
# mount [-t nfs] 172.16.9.2XX:/share /mnt/share

(4) NFS 서비스 제어

(현재서비스 제어)
# service nfs start     /* NFS 서비스 start */
# service nfs stop      /* NFS 서비스 stop */
# service nfs restart   /* NFS 서비스 restart */
# service nfs status    /* NFS 서비스 상태 확인 */
# service nfs reload    /* NFS 설정 파일 다시 읽기(# exportfs –ar) */

(부팅시 서비스 제어)
# chkconfig nfs on        (# chkconfig --level 35 nfs on)
# ntsysv                  (# setup)
# system-config-service   (# serviceconf)

(NFS GUI 방식의 설정 툴)
# system-config-nfs &
# cat /etc/exports
# exportfs

3 NFS(Network File System) 서버 실습
■ root 사용자의 서버 자원 마운트
■ Man Page 서버 구축
■ Home Directory 서버 구축
■ 원격 CD 마운트
■ 원격 백업 서버 구축


■ (NFS Server/Client에서 UID/GID 퍼미션 관계)

==== NFS Server =====                       ==== NFS Client =====
 # vi /etc/exports                           # mount S:/share /p
 /share/file1        <-- UID/GID check -->     /p/file1
 /share/dir1                                   /p/dir1
=====================                       ======================
/share/file1(rw-r--r-- user01 other)           /p/file1(rw-r--r--  500  1 )
user01(UID=500)                                     A
                                                    | 
                                                    |
                                                  user01 (# cd /p ; cat file1)
                                                  (UID=500)

/share/file1(rw-r--r-- root root)              /p/file1(rw-r--r--   0   0 )
root(UID=0)                                         A
                                                    | 
                                                    |
                                                   root (# cd /p ; cat file1)
                                                 (UID=0)
                                                    A
                                                    |
                                                    +---> (root(X) -> anonymous(nfsnobody))

[참고] no_root_squash 옵션(root_squash <----> no_root_squash)
NFS 서버에서 NFS 클라이언트의 root 사용자를 인정할 때 사용하는 공유 옵션이다.


(실무 예) Diskless Client(EX: Hardless Client)

Diskless Server (/disk/OS1) ------> Diskless Client(/)
http://aroundck.tistory.com/849

(실무 예) Application Server

■ 노트북(window/vmware/linux(centos))
# rpm --root=/disk/app1 -ivh <PKG>.rpm
# vi /etc/exports
/disk *(rw)
# service nfs restart

■ 상용서버
# mkdir -p /mnt/app1
# mount IP:/disk /mnt/app1


(실무 예) 오락서버(EX: 리니지), 메일서버(EX: daum.net/naver.com)

오락서버(EX: 리니지)
10000 대(NFS 클라이언트)
- server1(/home/user01)              NFS 서버(NAS)
- server2(/home/user01)              (/export/home/user01)
- server3(/home/user01)
- server4(/home/user01)
- .....

(실무 예) 웹서버(EX: 이중화)

WEB1(/www)
WEB2(/www)                           NFS 서버(NAS) - /www
WEB3(/www)


[EX4] 원격서버의 CD 마운트 

리눅스 서버에는 CD-ROM이 장착이 되지 않은 서버가 존재할 수 있다. 이런 경우, 다른 서버에 존재하는 CD-ROM에 CD를 장착하고 공유한후, 마운트 해서 사용하면 된다.

리눅스 서버에 CD-ROM이 고장난 경우
리눅스 서버중에 CD-ROM이 없는 서버의 경우


1. 네트워크 파일 서비스의 종류(Network File Service Type)

네트워크를 지원하는 수 많은 플랫폼들은 각각 자신의 플랫폼에 사용할 목적으로 다양한 파일 서비스 규격들을 만들어 냈다. 개별적인 플랫폼을 위해 만들어진 이러한 기술들은 자신의 플랫폼 내에서만 호환성을 가지고 있던 초기의 제한점을 넘어서 지금은 다양한 이기종의 플랫폼과 호환될 수 있는 형태로 확장되어 가고 있다.

네트워크 파일 서비스의 종류는 다음과 같다.
l NFS(Network File System)
l AFS(Andrew File System)
l NetWare
l Lan Manager
l Microsoft Network Service(CIFS)
l Apple Talk

Linux(NFS)     | Windows(CIFS)
---------------+--------+-------
SAMBA(CIFS) <--+--------+
     |         |
     V         |
  /share       |


2. 삼바(SAMBA) 서버 개요

■ (서버)Linux  <-----  NFS     -----> (클라이언트/서버)Linux/UNIX
■ (서버)Linux  <----- CIFS/SMB -----> (클라이언트/서버)Windows

마이크로소프트에서는 SMB라는 이름보다는 좀 더 범위가 큰  CIFS(Common  Internet  File  System)라는 프로토콜로 부른다. 이 프로토콜은  SMB 프로토콜에  Lan Manager, NetBIOS 프로토콜까지 포함한다.

삼바(SAMBA) 공식 사이트: http://www.samba.org

(1) 삼바(SAMBA)의 기능

SAMBA 기능은 유닉스/리눅스 플랫폼 환경에서 파일과 하드웨어(CD-ROM, Printer)를 서로 공유할 수 있게 해주는 프 로토콜이다. 이것을 정리해 보면 다음과 같다.

- 유닉스/리눅스 파티션과 윈도우와의 공유
- 윈도우 파티션과 유닉스/리눅스와의 공유
- 유닉스/리눅스의 프린터와 윈도우와의 공유
- 윈도우의 프린터와 유닉스와의 공유

(2) 삼바(SAMBA)의 활용

- 유닉스/리눅스 서버의 디렉토리를 MS 윈도우에서의 하나의 드라이브로 사용
- 프린터 공유
- 유닉스/리눅스 서버의 FTP 대치(EX: File Server)    
- CD-ROM 데이터 공유
- 백업(Backup) 시스템으로 사용

3. 삼바(SAMBA) 서버

패키지: samba, samba-clinet, samba-common
----- Linux(SAMBA) Server -----      ----- Windows 7 Server -----
      (linux2XX)
nmbd(137,138)
smbd(139)
- /etc/samba/smb.conf
-------------------------------      ----------------------------

ㅇ nmbd(NetBIOS Name Server)
   - 자원 검색(Resource Browing)
   - WINS 서버 관리(WINS Server)
ㅇ smbd(SMB/CIFS Server)
   - 인증/인가 관리(Authentication and Authorization)
   - 파일/프린터 공유 관리(File and Printer Sharing)

   * SMB(오픈버전) = CIFS(라이센스버전)

4. 삼바(SAMBA) 관련 명령어
■ smbclient 명령어
■ smbstatus 명령어
■ testparm 명령어
■ mount.cifs/umount.cifs 명령어

================================================실습================================================

① 다람쥐 웹메일 설치(squirrelmail 프로그램 설치)
# yum list | grep squirrelmail

# yum -y install squirrelmail
-> 출력 과정 생략

# rpm -ql squirrelmail

② 소유권 변경
# chown apache.apache -R /usr/share/squirrelmail
# chown apache.apache /etc/squirrelmail/config.php
# chown apache.apache -R /var/lib/squirrelmail
# chown apache.apache -R /var/spool/squirrelmail

③ 다람쥐 웹 메일 설정

(선수작업)
터미널에서 오른쪽 마우스 선택 > Edit Current Profile > Colors >
Text Color       : 빨강
Background color : 회색

# /usr/share/squirrelmail/config/conf.pl

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color off
S   Save data
Q   Quit

Command >> 2











SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : localhost
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

A.  Update IMAP Settings   : localhost:143 (uw)
B.  Change Sendmail Config : /usr/sbin/sendmail

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> 1

The domain name is the suffix at the end of all email addresses.  If
for example, your email address is jdoe@example.com, then your domain
would be example.com.

[localhost]: linux220.example.com









SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : linux220.example.com
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

A.  Update IMAP Settings   : localhost:143 (uw)
B.  Change Sendmail Config : /usr/sbin/sendmail

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> A












SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : linux220.example.com
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

IMAP Settings
--------------
4.  IMAP Server            : localhost
5.  IMAP Port              : 143
6.  Authentication type    : login
7.  Secure IMAP (TLS)      : false
8.  Server software        : uw
9.  Delimiter              : /

B.  Change Sendmail Config : /usr/sbin/sendmail
H.  Hide IMAP Server Settings

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> 4

This is the hostname where your IMAP server can be contacted.
[localhost]: mail.linux220.example.com






SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : linux220.example.com
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

IMAP Settings
--------------
4.  IMAP Server            : mail.linux220.example.com
5.  IMAP Port              : 143
6.  Authentication type    : login
7.  Secure IMAP (TLS)      : false
8.  Server software        : uw
9.  Delimiter              : /

B.  Change Sendmail Config : /usr/sbin/sendmail
H.  Hide IMAP Server Settings

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> 8

Each IMAP server has its own quirks.  As much as we tried to stick
to standards, it doesn't help much if the IMAP server doesn't follow
the same principles.  We have made some work-arounds for some of
these servers.  If you would like to use them, please select your
IMAP server.  If you do not wish to use these work-arounds, you can
set this to "other", and none will be used.
    cyrus       = Cyrus IMAP server
    uw          = University of Washington's IMAP server
    exchange    = Microsoft Exchange IMAP server
    courier     = Courier IMAP server
    macosx      = Mac OS X Mailserver
    hmailserver = hMailServer
    other       = Not one of the above servers
[uw]: other

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : linux220.example.com
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

IMAP Settings
--------------
4.  IMAP Server            : mail.linux220.example.com
5.  IMAP Port              : 143
6.  Authentication type    : login
7.  Secure IMAP (TLS)      : false
8.  Server software        : other
9.  Delimiter              : /

B.  Change Sendmail Config : /usr/sbin/sendmail
H.  Hide IMAP Server Settings

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> S

Data saved in config.php
Press enter to continue...






SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : linux220.example.com
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

IMAP Settings
--------------
4.  IMAP Server            : mail.linux220.example.com
5.  IMAP Port              : 143
6.  Authentication type    : login
7.  Secure IMAP (TLS)      : false
8.  Server software        : other
9.  Delimiter              : /

B.  Change Sendmail Config : /usr/sbin/sendmail
H.  Hide IMAP Server Settings

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> R







SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color off
S   Save data
Q   Quit

Command >> 10











SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : en_US
2.  Default Charset        : iso-8859-1
3.  Enable lossy encoding  : false

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> 1

SquirrelMail attempts to set the language in many ways.  If it
can not figure it out in another way, it will default to this
language.  Please use the code for the desired language.

[en_US]: ko_KR












SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : ko_KR
2.  Default Charset        : iso-8859-1
3.  Enable lossy encoding  : false

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> 2

This option controls what character set is used when sending
mail and when sending HTML to the browser.

This option is used only when default language is 'en_US'.

[iso-8859-1]: euc-kr   











SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : ko_KR
2.  Default Charset        : euc-kr
3.  Enable lossy encoding  : false

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> S

Data saved in config.php
Press enter to continue...













SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : ko_KR
2.  Default Charset        : euc-kr
3.  Enable lossy encoding  : false

R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit

Command >> Q


Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!

[root@linux220 ~]#


[root@linux220 ~]# vi /etc/httpd/conf/httpd.conf
[root@linux220 ~]# cat /etc/httpd/conf/httpd.conf | grep /webmail/
Alias /webmail/ "/usr/share/squirrelmail/"
[root@linux220 ~]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: [Tue May 10 16:43:12 2016] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 540 will probably never match because it overlaps an earlier Alias.
                                                           [  OK  ]
[root@linux220 ~]# vi /var/named/chroot/var/named/example220.zone
[root@linux220 ~]# cat /var/named/chroot/var/named/example220.zone | grep www
www                                                             IN      A               172.16.6.220
www1                            IN  A       172.16.6.120
www2                            IN  A       172.16.6.120
www3                            IN  A       172.16.6.120
;www                                                            IN      A               172.16.6.2
;www                                                            IN      A               172.16.6.3
;www                                                            IN      A               172.16.6.4
[root@linux220 ~]# service named restart
Stopping named: .                                          [  OK  ]
Starting named:                                            [  OK  ]
[root@linux220 ~]# nslookup www.linux220.example.com
Server:         172.16.6.220
Address:        172.16.6.220#53

Name:   www.linux220.example.com
Address: 172.16.6.220

[root@linux220 ~]# firefox http://www.linux220.example.com/webmail/src/login.php


그림1
그림2



[root@linux220 ~]# mkdir -p /share
[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) Sharing For Client
#
/share                                  172.16.0.0/255.255.0.0(rw)
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [FAILED]
Shutting down NFS daemon:                                  [FAILED]
Shutting down NFS quotas:                                  [FAILED]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 ~]# chkconfig nfs on
[root@linux220 ~]# exportfs
/share          172.16.0.0/255.255.0.0
[root@linux220 ~]# exportfs -v
/share          172.16.0.0/255.255.0.0(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@linux220 ~]# mkdir -p /share1
[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) Sharing For Client
#
/share                                  172.16.0.0/255.255.0.0(rw)
/share1                                 172.16.0.0/255.255.0.0(rw)
[root@linux220 ~]# exportfs -ar
[root@linux220 ~]# -a : all, -r : reread(/etc/exports)
[root@linux220 ~]# exportfs -v
/share1         172.16.0.0/255.255.0.0(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/share          172.16.0.0/255.255.0.0(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@linux220 ~]#


[root@linux220 ~]# showmount -e
Export list for linux220.example.com:
/share  172.16.0.0/255.255.0.0
/share1 172.16.0.0/255.255.0.0
[root@linux220 ~]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share  172.16.0.0/255.255.0.0
/share1 172.16.0.0/255.255.0.0
[root@linux220 ~]# showmount -e 172.16.6.249
Export list for 172.16.6.249:
/share  172.16.0.0/255.255.0.0
/share1 172.16.0.0/255.255.0.0
[root@linux220 ~]#


[NFS_Server]

[root@linux220 ~]# mkdir /share2 /share3
[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) Sharing For Client
#
/share                                  172.16.0.0/255.255.0.0(rw)
/share1                                 172.16.0.0/255.255.0.0(rw)
/share2                                 172.16.0.0/255.255.0.0(rw)
/share3                                 172.15.0.0/255.255.0.0(rw)
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 ~]# exportfs
/share1         172.16.0.0/255.255.0.0
/share2         172.16.0.0/255.255.0.0
/share3         172.15.0.0/255.255.0.0
/share          172.16.0.0/255.255.0.0
[root@linux220 ~]#


[NFS_Client]

[root@linux120 ~]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share  172.16.0.0/255.255.0.0
/share3 172.15.0.0/255.255.0.0
/share2 172.16.0.0/255.255.0.0
/share1 172.16.0.0/255.255.0.0
[root@linux120 ~]# mkdir -p /p /p1 /p2 /p3
[root@linux120 ~]# mount 172.16.6.220:/share /p
[root@linux120 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final
172.16.6.220:/share
               nfs     36G  5.0G   29G  15% /p
[root@linux120 ~]# mount 172.16.6.220:/share3 /p3
mount: 172.16.6.220:/share3 failed, reason given by server: Permission denied
[root@linux120 ~]#


[NFS_Server]

[root@linux220 ~]# cd /share
[root@linux220 /share]# mkdir dir1
[root@linux220 /share]# cp /etc/passwd file1
[root@linux220 /share]# cp /etc/group dir1/file2
[root@linux220 /share]# ls -R
.:
dir1  file1

./dir1:
file2
[root@linux220 /share]# find .
.
./dir1
./dir1/file2
./file1
[root@linux220 /share]#


[NFS_Client]

oot@linux120 ~]# cd /p
[root@linux120 /p]# ls
dir1  file1
[root@linux120 /p]# mkdir -p /test
[root@linux120 /p]# cp file1 /test
cp: overwrite `/test/file1'? y
[root@linux120 /p]# cat /test/file1 | more
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
distcache:x:94:94:Distcache:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
squid:x:23:23::/var/spool/squid:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
hsqldb:x:96:96::/var/lib/hsqldb:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:102:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
[root@linux120 /p]# cd
[root@linux120 ~]# umount /p
[root@linux120 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final


[NFS_Server]

[root@linux220 /share]# service nfs status
rpc.mountd (pid 15518) is running...
nfsd (pid 15515 15514 15513 15512 15511 15510 15509 15508) is running...
rpc.rquotad (pid 15502) is running...
[root@linux220 /share]# mkdir /share4
[root@linux220 /share]# vi /etc/exports
[root@linux220 /share]# cat /etc/exports
#
# (1) Sharing For Client
#
/share                                  172.16.0.0/255.255.0.0(rw)
/share1                                 172.16.0.0/255.255.0.0(rw)
/share2                                 172.16.0.0/255.255.0.0(rw)
/share3                                 172.15.0.0/255.255.0.0(rw)
/share4                                 *(rw)
[root@linux220 /share]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 /share]# service nfs reload
[root@linux220 /share]# exportfs
/share1         172.16.0.0/255.255.0.0
/share2         172.16.0.0/255.255.0.0
/share3         172.15.0.0/255.255.0.0
/share          172.16.0.0/255.255.0.0
/share4         <world>
[root@linux220 /share]#


[root@linux220 /share]# system-config-
system-config-authentication     system-config-network            system-config-samba
system-config-date               system-config-network-cmd        system-config-securitylevel
system-config-display            system-config-network-gui        system-config-securitylevel-tui
system-config-httpd              system-config-network-tui        system-config-services
system-config-kdump              system-config-nfs                system-config-soundcard
system-config-keyboard           system-config-packages           system-config-time
system-config-language           system-config-printer            system-config-users
system-config-lvm                system-config-rootpassword      
[root@linux220 /share]# system-config-
[root@linux220 /share]# mkdir /share5
[root@linux220 /share]# system-config-nfs
[root@linux220 /share]# pic03,04
[root@linux220 /share]# cat /etc/exports
#
# (1) Sharing For Client
#
/share                                  172.16.0.0/255.255.0.0(rw)
/share1                                 172.16.0.0/255.255.0.0(rw)
/share2                                 172.16.0.0/255.255.0.0(rw)
/share3                                 172.15.0.0/255.255.0.0(rw)
/share4                                 *(rw)
/share5                        *(ro,sync)
[root@linux220 /share]# exportfs
/share1         172.16.0.0/255.255.0.0
/share2         172.16.0.0/255.255.0.0
/share3         172.15.0.0/255.255.0.0
/share          172.16.0.0/255.255.0.0
/share4         <world>
/share5         <world>




[NFS_Server]

[root@linux220 ~]# cp /etc/exports /etc/exports.old
[root@linux220 ~]# > /etc/exports
[root@linux220 ~]# cat /etc/exports
[root@linux220 ~]# mkdir -p /share
[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) NFS Server Test
#
/share                  172.16.0.0/255.255.0.0(rw)
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 ~]# erportfs
bash: erportfs: command not found
[root@linux220 ~]# exportfs
/share          172.16.0.0/255.255.0.0
[root@linux220 ~]# rm -rf /share/*
[root@linux220 ~]# touch /share/testfile.txt
[root@linux220 ~]# ls -ld /share
drwxr-xr-x 2 root root 4.0K May 10 18:20 /share
[root@linux220 ~]# ls -l /share/testfile.txt
-rw-r--r-- 1 root root 0 May 10 18:20 /share/testfile.txt
[root@linux220 ~]#

----- linux2XX -----
/share (rwxr-xr-x root root)
   |
   +----- testfile.txt (rw-r--r-- root root)


[NFS_Client]

[root@linux120 ~]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share 172.16.0.0/255.255.0.0
[root@linux120 ~]# mkdir -p /mnt/server
[root@linux120 ~]# mount 172.16.6.220:/share /mnt/server
[root@linux120 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final
172.16.6.220:/share
               nfs     36G  5.0G   29G  15% /mnt/server
[root@linux120 ~]# df -h -t nfs
Filesystem    Type    Size  Used Avail Use% Mounted on
172.16.6.220:/share
               nfs     36G  5.0G   29G  15% /mnt/server
[root@linux120 ~]# cd /mnt/server
[root@linux120 /mnt/server]# ls -l
total 0
-rw-r--r-- 1 root root 0 May 10 18:20 testfile.txt
[root@linux120 /mnt/server]# mkdir dir1
mkdir: cannot create directory `dir1': Permission denied
[root@linux120 /mnt/server]# echo 1111 >> testfile.txt
bash: testfile.txt: Permission denied
[root@linux120 /mnt/server]#


[S]

[root@linux220 ~]# chmod 777 /share
[root@linux220 ~]# ls -ld /share
drwxrwxrwx 2 root root 4.0K May 10 18:20 /share
[root@linux220 ~]#


[C]

[root@linux120 /mnt/server]# touch linux120.txt
[root@linux120 /mnt/server]# mkdir linux120
[root@linux120 /mnt/server]# ls -l
total 4.0K
drwxr-xr-x 2 nfsnobody nfsnobody 4.0K May 10 18:29 linux120
-rw-r--r-- 1 nfsnobody nfsnobody    0 May 10 18:29 linux120.txt
-rw-r--r-- 1 root      root         0 May 10 18:20 testfile.txt
[root@linux120 /mnt/server]#


[S]

[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) NFS Server Test
#
/share                  172.16.0.0/255.255.0.0(rw,no_root_squash)
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 ~]# exportfs -v
/share          172.16.0.0/255.255.0.0(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@linux220 ~]#


[C]

[root@linux120 /mnt/server]# touch centos120.txt
[root@linux120 /mnt/server]# mkdir centos120
[root@linux120 /mnt/server]# ls -l
total 8.0K
drwxr-xr-x 2 root      root      4.0K May 10 18:31 centos120
-rw-r--r-- 1 root      root         0 May 10 18:31 centos120.txt
drwxr-xr-x 2 nfsnobody nfsnobody 4.0K May 10 18:29 linux120
-rw-r--r-- 1 nfsnobody nfsnobody    0 May 10 18:29 linux120.txt
-rw-r--r-- 1 root      root         0 May 10 18:20 testfile.txt
[root@linux120 /mnt/server]#

[root@linux120 /mnt/server]# cd
[root@linux120 ~]# umount /mnt/server/
[root@linux120 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final



[C]

[root@linux120 ~]# man ls
[root@linux120 ~]# cd /usr/share
[root@linux120 /usr/share]# mv man man.old
[root@linux120 /usr/share]# man ls
No manual entry for ls
[root@linux120 /usr/share]#


[S]

[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) NFS Server Test
#
/share                  172.16.0.0/255.255.0.0(rw,no_root_squash)
#
# (2) MAN Page Server Test
#
/usr/share/man  172.16.0.0/255.255.0.0(ro)
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 ~]# exportfs
/usr/share/man  172.16.0.0/255.255.0.0
/share          172.16.0.0/255.255.0.0
[root@linux220 ~]# exportfs -v
/usr/share/man  172.16.0.0/255.255.0.0(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/share          172.16.0.0/255.255.0.0(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@linux220 ~]#


[C]

[root@linux120 /usr/share]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share         172.16.0.0/255.255.0.0
/usr/share/man 172.16.0.0/255.255.0.0
[root@linux120 /usr/share]# mkdir /usr/share/man
[root@linux120 /usr/share]# mount 172.16.6.220:/usr/share/man /usr/share/man
[root@linux120 /usr/share]# df -h -t nfs
Filesystem    Type    Size  Used Avail Use% Mounted on
172.16.6.220:/usr/share/man
               nfs     36G  5.0G   29G  15% /usr/share/man
[root@linux120 /usr/share]# man ls
[root@linux120 /usr/share]# ls /usr/share/man
bg  en            fr.UTF-8  it.ISO8859-1  man1   man3   man5   man7x  mann          pt         ru.UTF-8  zh_CN
cs  es            hr        it.UTF-8      man1p  man3p  man5x  man8   nl            pt_BR      sk        zh_TW
da  fi            hu        ja            man1x  man3x  man6   man8x  pl            ro         sl
de  fr            id        ko            man2   man4   man6x  man9   pl.ISO8859-2  ru         sv
el  fr.ISO8859-1  it        man0p         man2x  man4x  man7   man9x  pl.UTF-8      ru.KOI8-R  tr
[root@linux120 /usr/share]#
[root@linux120 /usr/share]#
[root@linux120 /usr/share]#
[root@linux120 /usr/share]# cd
[root@linux120 ~]# umount /usr/share/man
[root@linux120 ~]# cd /usr/share
[root@linux120 /usr/share]# rmdir man
[root@linux120 /usr/share]# mv man.old man
[root@linux120 /usr/share]# man ls
[root@linux120 /usr/share]#




[S]

[root@linux220 ~]# mkdir -p /export/home
[root@linux220 ~]# useradd -u 3000 -g 100 -d /export/home/nfsuser nfsuser
[root@linux220 ~]# passwd nfsuser
Changing password for user nfsuser.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) NFS Server Test
#
/share                  172.16.0.0/255.255.0.0(rw,no_root_squash)
#
# (2) MAN Page Server Test
#
/usr/share/man  172.16.0.0/255.255.0.0(ro)
#
# (3) Home Directory Server Test
#
/export/home    172.16.0.0/255.255.0.0(rw)
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
xStarting RPC idmapd:                                      [  OK  ]
[root@linux220 ~]# exportfs -v
/usr/share/man  172.16.0.0/255.255.0.0(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/export/home    172.16.0.0/255.255.0.0(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/share          172.16.0.0/255.255.0.0(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@linux220 ~]# su - nfsuser
[nfsuser@linux220 ~]$ pwd
/export/home/nfsuser
[nfsuser@linux220 ~]$ touch README_nfsuser
[nfsuser@linux220 ~]$ ls -l README_nfsuser
-rw-r--r-- 1 nfsuser users 0 May 10 18:48 README_nfsuser
[nfsuser@linux220 ~]$ tail -f README_nfsuser
linux220


[C]

[root@linux120 ~]# useradd -u 3000 -g 100 -M nfsuser
[root@linux120 ~]# passwd nfsuser
Changing password for user nfsuser.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@linux120 ~]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share         172.16.0.0/255.255.0.0
/export/home   172.16.0.0/255.255.0.0
/usr/share/man 172.16.0.0/255.255.0.0
[root@linux120 ~]# mkdir /home/nfsuser
[root@linux120 ~]# mkdir -p /home/nfsuser
[root@linux120 ~]# chown nfsuser:users /home/nfsuser
[root@linux120 ~]# mount 172.16.6.220:/export/home/nfsuser /home/nfsuser
[root@linux120 ~]# df -h -t nfs
Filesystem    Type    Size  Used Avail Use% Mounted on
172.16.6.220:/export/home/nfsuser
               nfs     36G  5.0G   29G  15% /home/nfsuser
[root@linux120 ~]# telnet localhost
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

    linux120.example.com (Linux release 2.6.18-409.el5 #1 SMP Tue Mar 15 18:22:22 EDT 2016) (1)

login: nfsuser
Password:
[nfsuser@linux120 ~]$ id
uid=3000(nfsuser) gid=100(users) groups=100(users)
[nfsuser@linux120 ~]$ pwd
/home/nfsuser
[nfsuser@linux120 ~]$ ls -l
total 0
-rw-r--r-- 1 nfsuser users 0 May 10 18:48 README_nfsuser
[nfsuser@linux120 ~]$ echo linux220 >> README_nfsuser
[nfsuser@linux120 ~]$ cat README_nfsuser
linux220
[nfsuser@linux120 ~]$ exit
logout

Connection closed by foreign host.
[root@linux120 ~]# cd
[root@linux120 ~]# umount /home/nfsuser/
[root@linux120 ~]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share         172.16.0.0/255.255.0.0
/export/home   172.16.0.0/255.255.0.0
/usr/share/man 172.16.0.0/255.255.0.0
[root@linux120 ~]# showmount -e 172.16.6.249
Export list for 172.16.6.249:
/share         172.16.0.0/255.255.0.0
/export/home   172.16.0.0/255.255.0.0
/usr/share/man 172.16.0.0/255.255.0.0
[root@linux120 ~]# mount 172.16.6.249:/export/home/nfsuser /home/nfsuser
[root@linux120 ~]# df -h -t nfs
Filesystem    Type    Size  Used Avail Use% Mounted on
172.16.6.249:/export/home/nfsuser
               nfs     36G  4.9G   29G  15% /home/nfsuser
[root@linux120 ~]# telnet localhost
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

    linux120.example.com (Linux release 2.6.18-409.el5 #1 SMP Tue Mar 15 18:22:22 EDT 2016) (1)

nlogin:nfsuser
Password:
Last login: Tue May 10 18:52:18 from localhost.localdomain
[nfsuser@linux120 ~]$ ls -l
total 4
-rw-r--r-- 1 nfsuser users 27 May 10 18:54 README_nfsuser
[nfsuser@linux120 ~]$ echo linux220 >> README_nfsuser
[nfsuser@linux120 ~]$ cat README_nfsuser
linux249
linux200
linux221
linux220
[nfsuser@linux120 ~]$


[S]

[root@linux220 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final
[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# cat /etc/exports
#
# (1) NFS Server Test
#
/share                  172.16.0.0/255.255.0.0(rw,no_root_squash)
#
# (2) MAN Page Server Test
#
/usr/share/man  172.16.0.0/255.255.0.0(ro)
#
# (3) Home Directory Server Test
#
/export/home    172.16.0.0/255.255.0.0(rw)
#
# (4) CD/DVD Share Test
#
/media/CentOS_5.5_Final         172.16.0.0/255.255.0.0{ro)
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:  exportfs: No options for /media/CentOS_5.5_Final 172.16.0.0/255.255.0.0{ro): suggest 172.16.0.0/255.255.0.0{ro)(sync) to avoid warning
                                                           [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 ~]# exportfs -v
/media/CentOS_5.5_Final
                172.16.0.0/255.255.0.0{ro)(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/usr/share/man  172.16.0.0/255.255.0.0(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/export/home    172.16.0.0/255.255.0.0(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/share          172.16.0.0/255.255.0.0(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@linux220 ~]# vi /etc/exports
[root@linux220 ~]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
[root@linux220 ~]# exportfs -v
/media/CentOS_5.5_Final
                172.16.0.0/255.255.0.0(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/usr/share/man  172.16.0.0/255.255.0.0(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/export/home    172.16.0.0/255.255.0.0(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/share          172.16.0.0/255.255.0.0(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@linux220 ~]#



[C]

[root@linux120 ~]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share                  172.16.0.0/255.255.0.0
/export/home            172.16.0.0/255.255.0.0
/usr/share/man          172.16.0.0/255.255.0.0
/media/CentOS_5.5_Final 172.16.0.0/255.255.0.0{ro)
[root@linux120 ~]# showmount -e 172.16.6.220
Export list for 172.16.6.220:
/share                  172.16.0.0/255.255.0.0
/export/home            172.16.0.0/255.255.0.0
/usr/share/man          172.16.0.0/255.255.0.0
/media/CentOS_5.5_Final 172.16.0.0/255.255.0.0
[root@linux120 ~]# mkdir /mnt/cdrom
mkdir: cannot create directory `/mnt/cdrom': File exists
[root@linux120 ~]# mkdir -p /mnt/cdrom
[root@linux120 ~]# mount 172.16.6.220:/media/CentOS_5.5_Final /mnt/cdrom
[root@linux120 ~]# cd /mnt/cdrom/
[root@linux120 /mnt/cdrom]# ls
CentOS    RELEASE-NOTES-cs       RELEASE-NOTES-en_US       RELEASE-NOTES-ja          RELEASE-NOTES-ro
EULA      RELEASE-NOTES-cs.html  RELEASE-NOTES-en_US.html  RELEASE-NOTES-ja.html     RELEASE-NOTES-ro.html
GPL       RELEASE-NOTES-de       RELEASE-NOTES-es          RELEASE-NOTES-nl          repodata
images    RELEASE-NOTES-de.html  RELEASE-NOTES-es.html     RELEASE-NOTES-nl.html     RPM-GPG-KEY-beta
isolinux  RELEASE-NOTES-en       RELEASE-NOTES-fr          RELEASE-NOTES-pt_BR       RPM-GPG-KEY-CentOS-5
NOTES     RELEASE-NOTES-en.html  RELEASE-NOTES-fr.html     RELEASE-NOTES-pt_BR.html  TRANS.TBL
[root@linux120 /mnt/cdrom]# cd CentOS/
[root@linux120 /mnt/cdrom/CentOS]# ls lynx*
lynx-2.8.5-28.1.el5_2.1.i386.rpm
[root@linux120 /mnt/cdrom/CentOS]# rpm -Uvh lynx*
Preparing...                ########################################### [100%]
        package lynx-2.8.5-28.1.el5_2.1.i386 is already installed
[root@linux120 /mnt/cdrom/CentOS]# rpm -qa | grep lynx
lynx-2.8.5-28.1.el5_2.1
[root@linux120 /mnt/cdrom/CentOS]#


[root@linux120 /mnt/cdrom/CentOS]# cd
[root@linux120 ~]# umount /home/nfsuser/
[root@linux120 ~]# userdel -r nfsuser
[root@linux120 ~]#

[root@linux120 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final
172.16.6.220:/media/CentOS_5.5_Final
               nfs    3.9G  3.9G     0 100% /mnt/cdrom
[root@linux120 ~]# umount /mnt/cdrom
[root@linux120 ~]# df -h -t nfs
Filesystem    Type    Size  Used Avail Use% Mounted on
[root@linux120 ~]#





[S]

[root@linux220 ~]# showmount -e 172.16.6.252
Export list for 172.16.6.252:
/nfstest                   172.16.0.0/16
/export/centos             172.16.0.0/16
/backup/linux240           172.16.6.240
/backup/linux239           172.16.6.239
/backup/linux238           172.16.6.238
/backup/linux237           172.16.6.237
/backup/linux236           172.16.6.236
/backup/linux235           172.16.6.235
/backup/linux234           172.16.6.234
/backup/linux233           172.16.6.233
/backup/linux232           172.16.6.232
/backup/linux231           172.16.6.231
/backup/linux230           172.16.6.230
/backup/linux229           172.16.6.229
/backup/linux228           172.16.6.228
/backup/linux227           172.16.6.227
/backup/linux226           172.16.6.226
/backup/linux225           172.16.6.225
/backup/linux224           172.16.6.224
/backup/linux223           172.16.6.223
/backup/linux222           172.16.6.222
/backup/linux221           172.16.6.221
/backup/linux220           172.16.6.220
/backup/linux219           172.16.6.219
/backup/linux218           172.16.6.218
/backup/linux217           172.16.6.217
/backup/linux216           172.16.6.216
/backup/linux215           172.16.6.215
/backup/linux214           172.16.6.214
/backup/linux213           172.16.6.213
/backup/linux212           172.16.6.212
/backup/linux211           172.16.6.211
/backup/linux210           172.16.6.210
/backup/linux209           172.16.6.209
/backup/linux208           172.16.6.208
/backup/linux207           172.16.6.207
/backup/linux206           172.16.6.206
/backup/linux205           172.16.6.205
/backup/linux204           172.16.6.204
/backup/linux203           172.16.6.203
/backup/linux202           172.16.6.202
/backup/linux201           172.16.6.201
/backup/linux200           172.16.6.200
/root/packages/vmwaretools 172.16.0.0/16
[root@linux220 ~]# rm -rf /backup ; mkdir -p /backup
[root@linux220 ~]# mount 172.16.6.252:/backup/linux220 /backup
[root@linux220 ~]# df -h -t nfs
Filesystem    Type    Size  Used Avail Use% Mounted on
172.16.6.252:/backup/linux220
               nfs     18G   12G  5.4G  69% /backup
[root@linux220 ~]# tar cvzf /backup/home.tar.gz /home
tar: Removing leading `/' from member names
/home/
/home/499
/home/user01/
/home/user01/file2
/home/user01/file3
/home/user01/file4
/home/user01/.bash_history
/home/user01/.emacs
/home/user01/.bash_profile
/home/user01/mail/
/home/user01/mail/.imap/
/home/user01/mail/.imap/INBOX/
/home/user01/mail/.imap/INBOX/dovecot.index.cache
/home/user01/mail/.imap/INBOX/dovecot.index
/home/user01/mail/.imap/INBOX/dovecot.index.log
/home/user01/.bashrc
/home/user01/.bash_logout
/home/user01/.mozilla/
/home/user01/.mozilla/plugins/
/home/user01/.mozilla/extensions/
/home/user01/file1
/home/lost+found/
/home/mail01/
/home/mail01/.bash_history
/home/mail01/.emacs
/home/mail01/.bash_profile
/home/mail01/.bashrc
/home/mail01/.bash_logout
/home/mail01/.mozilla/
/home/mail01/.mozilla/plugins/
/home/mail01/.mozilla/extensions/
/home/user03/
/home/user03/.bash_history
/home/user03/.emacs
/home/user03/.bash_profile
/home/user03/.bashrc
/home/user03/.bash_logout
/home/user03/.mozilla/
/home/user03/.mozilla/plugins/
/home/user03/.mozilla/extensions/
/home/user02/
/home/user02/.emacs
/home/user02/.bash_profile
/home/user02/.bashrc
/home/user02/.bash_logout
/home/user02/.mozilla/
/home/user02/.mozilla/plugins/
/home/user02/.mozilla/extensions/
/home/mail02/
/home/mail02/.bash_history
/home/mail02/.emacs
/home/mail02/.bash_profile
/home/mail02/.bashrc
/home/mail02/.bash_logout
/home/mail02/.mozilla/
/home/mail02/.mozilla/plugins/
/home/mail02/.mozilla/extensions/
/home/team01/
/home/team01/.emacs
/home/team01/.bash_profile
/home/team01/.bashrc
/home/team01/.bash_logout
/home/team01/.mozilla/
/home/team01/.mozilla/plugins/
/home/team01/.mozilla/extensions/
/home/fedora/
/home/fedora/.sh_history
/home/fedora/.bash_history
/home/fedora/.bash_profile
/home/fedora/mail/
/home/fedora/mail/Trash
/home/fedora/mail/Sent
/home/fedora/mail/.subscriptions
/home/fedora/mail/.imap/
/home/fedora/mail/.imap/Trash/
/home/fedora/mail/.imap/Trash/dovecot.index.cache
/home/fedora/mail/.imap/Trash/dovecot.index
/home/fedora/mail/.imap/Trash/dovecot.index.log
/home/fedora/mail/.imap/INBOX/
/home/fedora/mail/.imap/INBOX/dovecot.index.cache
/home/fedora/mail/.imap/INBOX/dovecot.index
/home/fedora/mail/.imap/INBOX/dovecot.index.log
/home/fedora/mail/Drafts
/home/fedora/.bashrc
/home/fedora/.bash_logout
/home/fedora/.mozilla/
/home/fedora/.mozilla/plugins/
/home/fedora/.mozilla/extensions/
/home/team02/
/home/team02/.emacs
/home/team02/.bash_profile
/home/team02/.bashrc
/home/team02/.bash_logout
/home/team02/.mozilla/
/home/team02/.mozilla/plugins/
/home/team02/.mozilla/extensions/
[root@linux220 ~]# ls -l /backup
total 8.0K
-rw-r--r-- 1 root root 6.9K May 10 20:13 home.tar.gz
[root@linux220 ~]# ssh 172.16.6.252 ls -R /backup
The authenticity of host '172.16.6.252 (172.16.6.252)' can't be established.
RSA key fingerprint is e2:f0:f8:a2:47:3b:b4:7c:ae:65:38:0e:31:bf:1f:84.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.6.252' (RSA) to the list of known hosts.
root@172.16.6.252's password:
/backup:
linux200
linux201
linux202
linux203
linux204
linux205
linux206
linux207
linux208
linux209
linux210
linux211
linux212
linux213
linux214
linux215
linux216
linux217
linux218
linux219
linux220
linux221
linux222
linux223
linux224
linux225
linux226
linux227
linux228
linux229
linux230
linux231
linux232
linux233
linux234
linux235
linux236
linux237
linux238
linux239
linux240

/backup/linux200:
home.tar.gz

/backup/linux201:

/backup/linux202:
home.tar.gz

/backup/linux203:

/backup/linux204:
home.tar.gz

/backup/linux205:
home.tar.gz

/backup/linux206:

/backup/linux207:

/backup/linux208:
home.tar.gz

/backup/linux209:
home.tar.gz

/backup/linux210:
home.tar.gz

/backup/linux211:
home.tar.gz

/backup/linux212:
home.tar.gz

/backup/linux213:
home.tar.gz

/backup/linux214:

/backup/linux215:
backup.log
home,
home.tar.gz

/backup/linux216:
home.tar.gz

/backup/linux217:
home.tar.gz

/backup/linux218:
home.tar.gz

/backup/linux219:

/backup/linux220:
home.tar.gz

/backup/linux221:

/backup/linux222:

/backup/linux223:

/backup/linux224:
home.tar.gz

/backup/linux225:

/backup/linux226:
home.tar.gz

/backup/linux227:
home.tar.gz

/backup/linux228:
home.tar.gz

/backup/linux229:
home.tar.gz

/backup/linux230:

/backup/linux231:

/backup/linux232:

/backup/linux233:

/backup/linux234:

/backup/linux235:

/backup/linux236:

/backup/linux237:

/backup/linux238:

/backup/linux239:

/backup/linux240:
[root@linux220 ~]#




[SMB]

[root@linux220 ~]# egrep '(netbios|microsoft-ds)' /etc/services
netbios-ns      137/tcp                         # NETBIOS Name Service
netbios-ns      137/udp
netbios-dgm     138/tcp                         # NETBIOS Datagram Service
netbios-dgm     138/udp
netbios-ssn     139/tcp                         # NETBIOS session service
netbios-ssn     139/udp
microsoft-ds    445/tcp
microsoft-ds    445/udp
[root@linux220 ~]# cd /etc/samba
[root@linux220 /etc/samba]# ls
lmhosts  smb.conf  smbusers
[root@linux220 /etc/samba]# chkconfig smb on
[root@linux220 /etc/samba]# service smb restart
Shutting down SMB services:                                [FAILED]
Shutting down NMB services:                                [FAILED]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]
[root@linux220 /etc/samba]# pgrep -lf nmbd
18202 nmbd -D
[root@linux220 /etc/samba]# pgrep -lf smbd
18198 smbd -D
18201 smbd -D
[root@linux220 /etc/samba]# cat lmhosts
127.0.0.1 localhost
[root@linux220 /etc/samba]# cat smbusers
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator admin
nobody = guest pcguest smbguest
[root@linux220 /etc/samba]# vi smb.conf
[root@linux220 /etc/samba]#


[root@linux220 /etc/samba]# cd
[root@linux220 ~]# smbclient -L 172.16.6.252
Password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Sharename       Type      Comment
        ---------       ----      -------
        docs            Disk      Documentation Directory
        public          Disk      Samba Test
        IPC$            IPC       IPC Service (Samba Server(linux252) Version 3.0.33-3.41.el5_11)
        Microsoft_XPS_Document_Writer:1 Printer   Microsoft XPS Document Writer
        Microsoft_XPS_Document_Writer(_2):9 Printer   Microsoft XPS Document Writer( 2)
        Microsoft_XPS_Document_Writer(_2):8 Printer   Foxit PhantomPDF Printer( 2)
        Microsoft_XPS_Document_Writer(_2):11 Printer   Fax( 2)
        Microsoft_XPS_Document_Writer(_2):10 Printer   Adobe PDF( 2)
        Microsoft_XPS_Document_Writer(_1):10 Printer   Microsoft XPS Document Writer( 2)
        Hancom_PDF:4    Printer   Adobe PDF
        Hancom_PDF:2    Printer   Hancom PDF
        Hancom_PDF(_2):9 Printer   Hancom PDF( 2)
        Hancom_PDF(_2):12 Printer   Hancom PDF( 2)
        Hancom_PDF(_2):11 Printer   Hancom PDF( 2)
        Hancom_PDF(_2):10 Printer   Hancom PDF( 2)
        Hancom_PDF(_1):9 Printer   Microsoft XPS Document Writer( 2)
        Haansoft_PDF:2  Printer   Haansoft PDF
        Foxit_PhantomPDF_Printer:6 Printer   Foxit PhantomPDF Printer
        Foxit_PhantomPDF_Printer(_2):9 Printer   Foxit PhantomPDF Printer( 2)
        Foxit_PhantomPDF_Printer(_2):8 Printer   Foxit PhantomPDF Printer( 2)
        Foxit_PhantomPDF_Printer(_2):12 Printer   Foxit PhantomPDF Printer( 2)
        Foxit_PhantomPDF_Printer(_2):11 Printer   Foxit PhantomPDF Printer( 2)
        Fax:3           Printer   Fax
        Fax(_2):9       Printer   Fax( 2)
        Fax(_2):8       Printer   Fax( 2)
        Fax(_2):12      Printer   Fax( 2)
        Fax(_2):11      Printer   Fax( 2)
        Fax(_2):10      Printer   Fax( 2)
        Fax(_1):8       Printer   Fax( 1)
        doPDF_v7:7      Printer   Canon iR2200-3300 PCL
        doPDF_v7:5      Printer   doPDF v7
        Canon_iR2200-3300_PS3:5 Printer   Canon iR2200-3300 PS3
        Canon_iR2200-3300_PCL:7 Printer   Canon iR2200-3300 PCL
        Adobe_PDF:6     Printer   Adobe PDF
        Adobe_PDF:4     Printer   Adobe PDF
        Adobe_PDF(_2):9 Printer   Adobe PDF( 2)
        Adobe_PDF(_2):8 Printer   Adobe PDF( 2)
        Adobe_PDF(_2):11 Printer   Adobe PDF( 2)
        Adobe_PDF(_2):10 Printer   Adobe PDF( 2)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Server               Comment
        ---------            -------
        LINUX252             Samba Server(linux252) Version 3.0.33-3.41.el5_1

        Workgroup            Master
        ---------            -------
        WORKGROUP           
[root@linux220 ~]# smbclient -L 172.16.6.252 -N
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Sharename       Type      Comment
        ---------       ----      -------
        docs            Disk      Documentation Directory
        public          Disk      Samba Test
        IPC$            IPC       IPC Service (Samba Server(linux252) Version 3.0.33-3.41.el5_11)
        Microsoft_XPS_Document_Writer:1 Printer   Microsoft XPS Document Writer
        Microsoft_XPS_Document_Writer(_2):9 Printer   Microsoft XPS Document Writer( 2)
        Microsoft_XPS_Document_Writer(_2):8 Printer   Foxit PhantomPDF Printer( 2)
        Microsoft_XPS_Document_Writer(_2):11 Printer   Fax( 2)
        Microsoft_XPS_Document_Writer(_2):10 Printer   Adobe PDF( 2)
        Microsoft_XPS_Document_Writer(_1):10 Printer   Microsoft XPS Document Writer( 2)
        Hancom_PDF:4    Printer   Adobe PDF
        Hancom_PDF:2    Printer   Hancom PDF
        Hancom_PDF(_2):9 Printer   Hancom PDF( 2)
        Hancom_PDF(_2):12 Printer   Hancom PDF( 2)
        Hancom_PDF(_2):11 Printer   Hancom PDF( 2)
        Hancom_PDF(_2):10 Printer   Hancom PDF( 2)
        Hancom_PDF(_1):9 Printer   Microsoft XPS Document Writer( 2)
        Haansoft_PDF:2  Printer   Haansoft PDF
        Foxit_PhantomPDF_Printer:6 Printer   Foxit PhantomPDF Printer
        Foxit_PhantomPDF_Printer(_2):9 Printer   Foxit PhantomPDF Printer( 2)
        Foxit_PhantomPDF_Printer(_2):8 Printer   Foxit PhantomPDF Printer( 2)
        Foxit_PhantomPDF_Printer(_2):12 Printer   Foxit PhantomPDF Printer( 2)
        Foxit_PhantomPDF_Printer(_2):11 Printer   Foxit PhantomPDF Printer( 2)
        Fax:3           Printer   Fax
        Fax(_2):9       Printer   Fax( 2)
        Fax(_2):8       Printer   Fax( 2)
        Fax(_2):12      Printer   Fax( 2)
        Fax(_2):11      Printer   Fax( 2)
        Fax(_2):10      Printer   Fax( 2)
        Fax(_1):8       Printer   Fax( 1)
        doPDF_v7:7      Printer   Canon iR2200-3300 PCL
        doPDF_v7:5      Printer   doPDF v7
        Canon_iR2200-3300_PS3:5 Printer   Canon iR2200-3300 PS3
        Canon_iR2200-3300_PCL:7 Printer   Canon iR2200-3300 PCL
        Adobe_PDF:6     Printer   Adobe PDF
        Adobe_PDF:4     Printer   Adobe PDF
        Adobe_PDF(_2):9 Printer   Adobe PDF( 2)
        Adobe_PDF(_2):8 Printer   Adobe PDF( 2)
        Adobe_PDF(_2):11 Printer   Adobe PDF( 2)
        Adobe_PDF(_2):10 Printer   Adobe PDF( 2)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Server               Comment
        ---------            -------
        LINUX252             Samba Server(linux252) Version 3.0.33-3.41.el5_1

        Workgroup            Master
        ---------            -------
        WORKGROUP           
[root@linux220 ~]# smbclient //172.16.6.252/public
Password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]
Server not using user level security and no password supplied.
smb: \> ?
?              altname        archive        blocksize      cancel        
case_sensitive cd             chmod          chown          close         
del            dir            du             exit           get           
getfacl        hardlink       help           history        lcd           
link           lock           lowercase      ls             mask          
md             mget           mkdir          more           mput          
newer          open           posix          posix_open     posix_mkdir   
posix_rmdir    posix_unlink   print          prompt         put           
pwd            q              queue          quit           rd            
recurse        reget          rename         reput          rm            
rmdir          showacls       setmode        stat           symlink       
tar            tarmode        translate      unlock         volume        
vuid           wdel           logon          listconnect    showconnect   
!             
smb: \> dir
  .                                   D        0  Sun Sep 20 15:19:44 2015
  ..                                  D        0  Tue May 10 13:11:59 2016
  WelcomToMyServer.txt                         0  Wed Mar 19 19:43:53 2014
  passwd                                    2461  Sun Sep 20 15:19:28 2015
  WelcomeToMyServer.txt                        0  Sun Sep 20 15:19:44 2015

                36701 blocks of size 524288. 10552 blocks available
smb: \> lcd /tmp
smb: \> mget passwd
Get file passwd? y
getting file \passwd of size 2461 as passwd (400.5 kb/s) (average 400.6 kb/s)
smb: \> quit
[root@linux220 ~]# ls -l /tmp/passwd
-rw-r--r-- 1 root root 2.5K May 10 21:14 /tmp/passwd
[root@linux220 ~]# smbclient //172.16.6.252/public -U root
Password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]
Server not using user level security and no password supplied.
smb: \> dir
  .                                   D        0  Sun Sep 20 15:19:44 2015
  ..                                  D        0  Tue May 10 13:11:59 2016
  WelcomToMyServer.txt                         0  Wed Mar 19 19:43:53 2014
  passwd                                    2461  Sun Sep 20 15:19:28 2015
  WelcomeToMyServer.txt                        0  Sun Sep 20 15:19:44 2015

                36701 blocks of size 524288. 10552 blocks available
smb: \> quit
[root@linux220 ~]# smbstatus

Samba version 3.0.33-3.41.el5_11
PID     Username      Group         Machine                       
-------------------------------------------------------------------

Service      pid     machine       Connected at
-------------------------------------------------------

No locked files

[root@linux220 ~]# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = MYGROUP
        server string = Samba Server Version %v
        passdb backend = tdbsam
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No
[root@linux220 ~]# cd /etc/samba/
[root@linux220 /etc/samba]# cp smb.conf smb.conf.orig
[root@linux220 /etc/samba]# testparm smb.conf.orig
Load smb config files from smb.conf.orig
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = MYGROUP
        server string = Samba Server Version %v
        passdb backend = tdbsam
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No
[root@linux220 /etc/samba]#
[root@linux220 /etc/samba]#



[root@linux220 /etc/samba]# vi ~/.bashrc
[root@linux220 /etc/samba]# cat ~/.bashrc | tail -13
#
# Mail Alias
#
alias MAIL='cd /etc/mail'
alias sendmail.cf='vi /etc/mail/sendmail.cf'
alias mlog='tail -f /var/log/maillog'
#
# Samba Alias
#
alias smb.conf='vi /etc/samba/smb.conf'
alias SMB='cd /etc/samba'
alias smblog='tail –f /var/log/samba/smbd.log'
alias nmblog='tail -f /var/log/samba/nmbd.log'
[root@linux220 /etc/samba]# . ~/.bashrc
[root@linux220 /etc/samba]# cd
[root@linux220 ~]# SMB
[root@linux220 /etc/samba]# vi /smb.conf
[root@linux220 /etc/samba]# ls
lmhosts  passdb.tdb  secrets.tdb  smb.conf  smb.conf.orig  smbusers
[root@linux220 /etc/samba]# vi smb.conf.orig
[root@linux220 /etc/samba]# vi smb.conf
[root@linux220 /etc/samba]# cat smb.conf | tail -10
#
# Specific Configuration
#
[public]
                comment = Samba Test
                path = /samba
                public = yes
                writable = yes
                printable = no

[root@linux220 /etc/samba]# mkdir /samba
[root@linux220 /etc/samba]# chmod 777 /samba
[root@linux220 /etc/samba]# cp /etc/passwd /samba
[root@linux220 /etc/samba]# service smb restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]
[root@linux220 /etc/samba]# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[public]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        server string = Samba Server linux220
        security = SHARE
        passdb backend = tdbsam
        hosts allow = 127., 172.16., 192.168.10.
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No

[public]
        comment = Samba Test
        path = /samba
        read only = No
        guest ok = Yes
[root@linux220 /etc/samba]# smbclient -L localhost -U root
Password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Sharename       Type      Comment
        ---------       ----      -------
        public          Disk      Samba Test
        IPC$            IPC       IPC Service (Samba Server linux220)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.41.el5_11]

        Server               Comment
        ---------            -------
        LINUX220             Samba Server linux220

        Workgroup            Master
        ---------            -------
        WORKGROUP           
[root@linux220 /etc/samba]#


그림5
그림6
그림7
그림8



[root@linux220 /etc/samba]# cd
[root@linux220 ~]# mkdir -p /mnt/server
[root@linux220 ~]# mount -t cifs 172.16.6.31:samba_share /mnt/server -o user=soldeskN
Password:
[root@linux220 ~]# df -h
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3     36G  5.0G   29G  15% /
/dev/sda8     ext3    487M   11M  451M   3% /data1
/dev/sda7     ext3    487M   11M  451M   3% /data2
/dev/sda6     ext3    487M   11M  451M   3% /data3
/dev/sda5     ext3    487M   11M  451M   3% /data4
/dev/sda3     ext3    487M   11M  451M   3% /home
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
/dev/hdc   iso9660    3.9G  3.9G     0 100% /media/CentOS_5.5_Final
172.16.6.31:samba_share
              cifs    234G   64G  171G  27% /mnt/server
[root@linux220 ~]# cd /mnt/server
[root@linux220 /mnt/server]# ls
20090330_5.pdf
[root@linux220 /mnt/server]# cp /etc/passwd file1.txt
[root@linux220 /mnt/server]# cp /etc/hosts file2.txt
[root@linux220 /mnt/server]# cp /etc/group file3.txt
[root@linux220 /mnt/server]# ls
20090330_5.pdf  file1.txt  file2.txt  file3.txt
[root@linux220 /mnt/server]# ls
1111.pdf  2222.pdf  file1.txt  file2.txt  file3.txt
[root@linux220 /mnt/server]#


그림9 ~ 그림15


■ 다른 예
# mount -t cifs 172.16.9.1:samba_share /mnt/server -o user=administrator
# mount -t cifs 172.16.9.1:samba_share /mnt/server -o username=administrator
# mount.cifs 172.16.9.1:samba_share /mnt/server -o user=soldesk
# mount.cifs //172.16.9.1/samba_share /mnt/server -o user=soldesk


[참고]  (다른 방법) 윈도우(Windows XP) 공유 자원을 리눅스(Linux CentOS 5.4)에서 접근 하기

(두번째 방법) 바탕화면에서 확인하기
-> "root's Home" 아이콘 더블클릭
-> 새로 뜬 'root' 창에서 'File' 부분 선택
-> "Connect to Server" 선택
-> 새로 뜬 "Connect to Server" 창에서
   Service type : "Windows share" 선택
   Server : <자신 윈도우 서버의 이름>    (예) 172.16.9.X
-> 공유된 자원이 보일것이다.
   바탕화면에 아이콘으로 생성된다.
   다음부터는 바탕화면의 아이콘 클릭하면 된다.

그림16 ~ 그림17


[참고] 부팅시에 SMB 마운트(리눅스 서버에 공유된 자원을 윈도우에서 부팅시에 마운트)

(Windows 쪽에서) "네트워크 드라이브 연결"을 사용
윈도우(Windows XP) 서버에서 네트워크 연결이 되면 자동으로 리눅스 서버(삼바 서버)의 자원을 마운트 할 수 있도록 하기 위해서는 "네트워크 드라이브 연결"을 사용한다.

내컴퓨터 > "네트워크 드라이브 연결"

"Z:", "\\192.168.0.250\public"

그림18


(Linux 쪽에서) /etc/fstab 파일 사용
# vi /etc/fstab

---------------------------------------------------------------------------------------------
#
# (2) SAMBA(CIFS) Mount Test
#
172.16.9.X:samba_share       /mnt/server     cifs    credentials=/etc/samba/cred     0 0
or
//172.16.9.X/samba_share     /mnt/server     cifs    username=soldesk,udi=soldesk,noauto   0 0
---------------------------------------------------------------------------------------------
(참고) # mount -t cifs 172.16.9.X:samba_share /mnt/server -o credentials=/etc/samba/cred

# vi /etc/samba/cred
---------------------------------------------------------------------------------------------
username=soldesk
password=soldesklove
---------------------------------------------------------------------------------------------

# chmod 600 /etc/samba/cred   /* root 사용자만 읽을수 있도록 설정 */
# reboot
l 리눅스 서버가 리부팅되면 자동으로 윈도우 서버의 공유된 자원을 마운트 한다.




















Posted by 22Hz
, |

================================================메모================================================

윈도우서버 2주

강의 160811~160812(2일) -> 160808~160809(2일) 변경
방학 160806~160810(5일) -> 160810~160815(6일) 변경

================================================복습================================================
================================================강의================================================

[참고] 개정된 FTP 응답(FTP Response Code)

개정된 FTP 응답코드(Revised FTP Reply Codes)의 자세한 내용은 RFC_640 문서에서 찾아 볼 수 있다.
RFC 사이트:  http://www.faqs.org/rfc/rfc640.txt 참조

대표적인 FTP 응답코드는 다음과 같은 것이 있다.(RFC 문서 참조)
■ 220  Service ready for new user
■ 230  User logged on, proceed
■ 331  User name okay, need password
■ 530  Not logged in
■ 221  Service closing TELNET connection (logged off if appropriate)


(주의) ftpd_banner 설정과 banner_file 설정이 두개 다 설정 되어 있는 경우에는 banner_file에 지정된 내용이 출력된다.


-> 기본적으로 인증된 사용자라면 권한(퍼미션)이 되는 범위안에서 다른 디렉토리로 이동이 가능하다. 하지만 디렉토리 이동이 가능하다면 디렉토리안의 내용을 살펴 볼수 있기 때문에 보안상 좋지 않다.


(userlist_deny=YES) 두개의 파일 중 한개의 파일에라도 사용자가 정의되어 있으면 FTP 로그인 할 수 없다.
- /etc/vsftpd/ftpusers
- /etc/vsftpd/user_list

(userlist_deny=NO) user_list 파일에 존재하는 사용자만 FTP 로그인을 할 수 있다.
- /etc/vsftpd/ftpusers
- /etc/vsftpd/user_list


(실무 예) FTP 사용자 제한
# cat /etc/vsftpd/user_list
root
wasuser
oracle

# vi /etc/vsftpd/vsftpd.conf
userlist_enable=YES
userlist_deny=NO


인증된 사용자(Local User) ---> /home/$USER
익명사용자(Anonymous User) ---> /var/ftp


(실무 예) max_clients, max_per_ip
# cat /etc/vsftd/vsftpd.conf
.....
max_clients=100
max_per_ip=3
.....
(참고) 실무에서는 max_client 개수의 제한이 필요하며, 개수의 제한은 서버의 H/W 사양에 비례한다.


[EX9] 익명사용자 FTP 서버에 파일 업로드 기능 설정

Anonymous FTP 서버에 파일 업로드 기능 설정
◾ 업로드 디렉토리(EX: /var/pub/incoming) 퍼미션 설정
◾  /etc/vsftpd/vsftpd.conf 파일 설정
   ◾  anon_upload_enable=YES
   ◾  chown_uploads=YES
   ◾  chown_username=ftpupload


FTP 보안

INDEX
----------------------------
■ FTP 보안 개요
■ FTP 호스트 제한
■ FTP 사용자 제한
■ FTP 프로그램 업데이트/패치
■ FTP 포트관리
----------------------------

(1) FTP 보안 개요

FTP 보안에 관한 기본적인 개념은 다음과 같은 것들에 관해 깉이 있게 살펴 보는 것이다.
■ FTP 호스트 제한
■ FTP 사용자 제한
■ FTP 프로그램 업데이트 & 패치
■ 포트 관리

인증(Authentication), 권한부여(Authorization), 접근제어(Access Control)

http://www.codeproject.com/Articles/98950/ASP-NET-authentication-and-authorization
http://resources.infosecinstitute.com/identity-management/


○ FTP 서버에서 호스트에 관한 제한을 두는 설정 : Firewall(EX: iptables), tcp_wrapper
○ FTP 서버에서 사용자에 관한 제한을 두는 설정 : /etc/vsftpd/ftpusers, /etc/vsftpd/user_list

(2-1) tcp_wrapper을 통한 FTP 서버 제한

tcp_wrapper (/usr/share/doc/tcp_wrappers-7.6)
Ÿ tcp_wrapper는 finger, ftp, telnet, rlogin, rsh,  exec, tftp, talk, comsat등의 네트워크 서비스를 필터링 할 수 있는 프로그램이다.
Ÿ /usr/sbin/tcpd 데몬에 의해서 TCP 서비스를 제어 하는 역할을 가지고 있다.
Ÿ TCP 제어를 위해서는 /etc/hosts.allow, /etc/hosts.deny 파일을 가지고 설정한다.    

(Rule 적용 순서)
- /etc/hosts.allow 파일에 정의된것은 허용이 되고,
- 만약 정의 되지 않은 내용이 있다면, /etc/hosts.deny 파일에 정의된것은 거부가 되고,
- 만약 정의 되지 않은 내용이 있다면, 허용된다.

------> tcpd ---+----> ① /etc/hosts.allow(Allow)        
                |
                +----------------------------> ② /etc/hosts.deny(Deny)            
                |
                +--------------------------------------------------> ③ (Allow)               

Ÿ tcp_wrapper는 Firewall(iptable)과 비교하였을때 성능을 떨어트리지 않는 장점을 가지고 있다. 빠르게 tcp 방 식의 서비스를 제어할 수 있는 장점을 가지고 있다.
Ÿ (권장) 이 파일에 설정할 때 시스템이름이나 도메인 이름을 사용하지 말고 IP주소를 사용할 것을 권장합니다.
Ÿ (권장) 또한, /etc/hosts.deny 파일에는 deny ALL로 설정한 후 접속을 허용할 주소만 /etc/hosts.allow 파일에 기록할것을 권장한다.
Ÿ (주의) 2개의 설정파일(EX: hosts.allow, hosts.deny)에 정의를 할 때 저장하는 즉시 유효하므로 작성시에 주의하여야 합니다. (서비스를 restart 하는 방법이 아니므로 주의해야 한다.)
Ÿ 2개의 설정 파일에 정의하는 방식은 다음과 같습니다.
# cat /etc/hosts.allow (# cat /etc/hosts.deny)
<데몬이름>: <Source IP주소 or 네트워크 or 이름>::[옵션]


(5) FTP 포트 관리

(5-1) FTP 서버/클라이언트 포트 연결 과정

FTP는 연결(Connection)을 이루는 포트와 데이터를 전송하는 포트가 있다. 2개의 포트를 사용하는 서비스이다. 포 트를 서비스에 사용하는 방식은 2가지가 있는데 (ㄱ)패시브 모드(Passvie Mode)와 액티브 모드(Active Mode)로 구 분한다. 기본은 액티브 모드 상태이다. 동작 모드를 변화 시키기위해서는 ftp 명령어의 -p 옵션이나 ftp 명령어의 서브 프롬프트에서 "passive" 명령어를 사용하면 된다. 동작은 다음과 같다.

● Active Mode(Default)
① FTP Client opens command channel to server; tells server second port number to use
② FTP Server acknowledges
③ FTP Server opens data channel to clients second port as instructed
④ FTP Client acknowledges and data flows

● Passive Mode
① FTP Client opens command channel to FTP server and requests "passive" mode.
② FTP Server Allocates port for the data channel and transmits the port number to use for the data transmission
③ FTP Client opens the data channel on the specified port
④ FTP Server responds with okay to transmit and data begins to flow

패시브모드(Passive)는 파이어월(Firewall) 서버안쪽에 있는 FTP 클라이언트가 FTP 서버에 접속하여 데이터를 전송 할때 유용하게 사용될 수 있다. (man ftp 부분 중 passive 명령어 참조)

http://mintnlatte.tistory.com/407

(실무 예) Active Mode/Passive Mode 사용에 대해서

                                    |
<----------- Intranet ----------->  | <----------- Internet ----------->
                                    |
                                    |
------ FTP Server ----     ----- Firewall-----                 ------ FTP Client ------
        vsftpd(21,####)             |                          # ftp Server
/etc/vsftpd/vsftpd.conf             |
                                    |
----------------------     -------------------                 ------------------------
(1) FTP 서버 구축                   |
(2) 방화벽 서비스 오픈 요청         |
                                    |

(2) 메일 관련 프로토콜
l 메일 전송을 위한 프로토콜(Mail Transport Protocol): SMTP(7bit), ESMTP(8bit) 등
l 메일 수신을 위한 프로토콜(Mail Access Protocol)   : POP3(#mv), IMAP4(#cp) 등

IMAP http://www.ktword.co.kr/abbr_view.php?nav=2&m_temp1=2719&id=476
POP http://www.ktword.co.kr/abbr_view.php?nav=2&m_temp1=992&id=476
SMTP http://www.ktword.co.kr/abbr_view.php?nav=2&m_temp1=196&id=476

그림9


----------------------------------------------------------------------------
(선수지식)
●메일(MAIL)서버는 DNS 서버의 의존적
(Client)                         (DNS) Forward Zone File
# mailx root@paran.com  ----->   paran.com.  IN  MX  10  mail.paran.com.
                                 mail        IN  A       172.16.6.XXX

●메일서버는 도메인당 하나씩 구성이 가능
(DNS) Forward Zone File
paran.com.   IN  MX  10  mail.paran.com.
mail         IN  A       172.16.6.254
paran.com.   IN  MX  20  mail2.paran.com.
mail2        IN  A       172.16.6.253

●스팸메일 서버 구성
paran.com.   IN  MX  10  spam.paran.com.
spam         IN  A       172.16.6.254
or
paran.com.   IN  MX  10  spam.paran.com.
spam         IN  A       172.16.6.254
paran.com.   IN  MX  20  mail.paran.com.
mail         IN  A       172.16.6.253
----------------------------------------------------------------------------

<CTRL + ESC> => "cmd" => <ENTER>
C:\> nslookup -q=MX kornet.net
C:\> nslookup -q=MX naver.com
C:\> nslookup -q=MX daum.net
C:\> nslookup -q=MX google.com


(실무 예) /etc/aliases 파일의 대표적인 사용 예

webmaster@daum.net   ------> webmaster@example.com
webmaster@naver.com  ------> webmaster@example.com
webmaster@google.com ------> webmaster@example.com

# vi /etc/aliases
webmaster:    webmaster@example.com
# newaliases
# praliases

(실무 예) /etc/aliases 파일의 대표적인 사용 예(EX: 메일링 리스트)

공지 메일(회사내의 모든 사용자에게 공지 메일 발송)
         (회사내의 특정 팀에게 공지 메일 발송)


[EX4] 메일 클라이언트 프로그램 사용

메일 클라이언트 프로그램(MUA)
(GUI) 에볼루션(Evolution), 썬더버드
(TUI) mutt

(1) 메일 클라이언트 프로그램(EX: evolution 사용)

----- MAIL Client ----- ----- MAIL Server ---- ---- MAIL Server --- ----- MAIL Client -----
      (linux1XX)              (linux2XX)            (linux2XX)            (linux1XX)

      MUA: Evolution          MTA:sendmail          MTA:sendmail          MUA: Evolution
                           /var/spool/mqueue     /var/mail/<사용자이름>
----------------------- ---------------------- -------------------- -----------------------

================================================실습================================================

[root@linux220 ~]# vi ~/.bashrc
[root@linux220 ~]# cat ~/.bashrc | tail
alias DNS='cd /var/named/chroot/var/named'
#alias named-checkconf='named-checkconf /var/named/chroot/etc/named.caching-nameserver.conf'
#
# FTP Server Alias
#
alias FTP='cd /etc/vsftpd'
alias vsftpd.conf='vi /etc/vsftpd/vsftpd.conf'
alias ftpusers='vi /etc/vsftpd/ftpusers'
alias user_list='vi /etc/vsftpd/user_list'
alias flog='tail -f /var/log/xferlog'
[root@linux220 ~]# . ~/.bashrc
[root@linux220 ~]# FTP
[root@linux220 /etc/vsftpd]# ls
ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -5

#
# Specific Configuration
#
banner_file=/etc/vsftpd/banner.txt
[root@linux220 /etc/vsftpd]# vi banner.txt
[root@linux220 /etc/vsftpd]# cat banner.txt
+====================================================+
|                                                    |
|        Welcome to linux252.example.com             |
|                                                    |
|                                                    |
| This is the linux252.example.com test server.      |
|                                                    |
| If you have not already done so, make sure         |
| you have read the Downloading/Installation,        |
| FAQ, and Disclaimer links on                       |
| http://www.solaris254.example.com.                 |
|                                                    |
| This is a restricted access system. All            |
| tranfers are logged.  If you disagree              |
| with this practice, log off now.                   |
|                                                    |
| Questions go to SeoungChan Baik at                 |
| the address given on linux252.example.com          |
|                                                    |
|                                                    |
+====================================================+
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [FAILED]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# chkconfig vsftpd on
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220-+====================================================+
220-|                                                    |
220-|        Welcome to linux252.example.com             |
220-|                                                    |
220-|                                                    |
220-| This is the linux252.example.com test server.      |
220-|                                                    |
220-| If you have not already done so, make sure         |
220-| you have read the Downloading/Installation,        |
220-| FAQ, and Disclaimer links on                       |
220-| http://www.solaris254.example.com.                 |
220-|                                                    |
220-| This is a restricted access system. All            |
220-| tranfers are logged.  If you disagree              |
220-| with this practice, log off now.                   |
220-|                                                    |
220-| Questions go to SeoungChan Baik at                 |
220-| the address given on linux252.example.com          |
220-|                                                    |
220-|                                                    |
220-+====================================================+
220
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]#


[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -5

#
# Specific Configuration
#
#banner_file=/etc/vsftpd/banner.txt
[root@linux220 /etc/vsftpd]#



[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 Welcome to blah FTP service.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | grep ftpd_banner
ftpd_banner=Welcome to blah FTP service.
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | grep ftpd_banner
#ftpd_banner=Welcome to blah FTP service.
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]#


[root@linux220 /etc/vsftpd]# su - user01
[user01@linux220 ~]$ cp /etc/passwd file1
cp: cannot create regular file `file1': Permission denied
[user01@linux220 ~]$ ls -l
total 8
-rw-r--r-- 1 root root 2076 Apr 28 18:26 file1
-rw-r--r-- 1 root root  229 Apr 19 21:36 file2
-rw-r--r-- 1 root root  789 Apr 28 18:26 file3
-rw-r--r-- 1 root root 2076 Apr 28 21:46 file4
[user01@linux220 ~]$ su
Password:
[root@linux220 /home/user01]# rm -f file?
[root@linux220 /home/user01]# su - user01
[user01@linux220 ~]$ cp /etc/passwd file1
[user01@linux220 ~]$ cp file1 file2
[user01@linux220 ~]$ cp file1 file3
[user01@linux220 ~]$ cp file1 file4
[user01@linux220 ~]$ ls -l
total 12
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file1
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file2
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file3
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file4
[user01@linux220 ~]$ exit
logout

[root@linux220 /home/user01]# exit
exit
[user01@linux220 ~]$ ls -l
total 12
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file1
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file2
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file3
-rw-r--r-- 1 user01 user01 2076 May  9 16:24 file4
[user01@linux220 ~]$ exit
logout

[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (127,0,0,1,231,157)
150 Here comes the directory listing.
-rw-r--r--    1 501      501          2076 May 09 07:24 file1
-rw-r--r--    1 501      501          2076 May 09 07:24 file2
-rw-r--r--    1 501      501          2076 May 09 07:24 file3
-rw-r--r--    1 501      501          2076 May 09 07:24 file4
226 Directory send OK.
ftp> cd /etc
250 Directory successfully changed.
ftp> dir
227 Entering Passive Mode (127,0,0,1,78,16)
150 Here comes the directory listing.
-rw-r--r--    1 0        0            2518 Mar 21  2012 DIR_COLORS
-rw-r--r--    1 0        0            2420 Mar 21  2012 DIR_COLORS.xterm
drwxr-xr-x    2 0        0            4096 Apr 28 11:56 MESS
-rw-r--r--    1 0        0           92794 Aug 06  2012 Muttrc
-rw-r--r--    1 0        0               0 Aug 06  2012 Muttrc.local
drwxr-xr-x    4 0        0            4096 Apr 27 07:58 NetworkManager
drwxr-xr-x    8 0        0            4096 Apr 27 08:05 X11
-rw-r--r--    1 0        0            2562 May 24  2008 a2ps-site.cfg
-rw-r--r--    1 0        0           15288 May 24  2008 a2ps.cfg
drwxr-xr-x    4 0        0            4096 Feb 23  2012 acpi
-rw-r--r--    1 0        0              45 May 04 12:08 adjtime
drwxr-xr-x    4 0        0            4096 Apr 11 18:35 alchemist
-rw-r--r--    1 0        0            1512 Apr 25  2005 aliases
-rw-r-----    1 0        51          12288 May 09 07:02 aliases.db
drwxr-xr-x    4 0        0            4096 Apr 11 18:34 alsa
drwxr-xr-x    2 0        0            4096 Apr 27 08:07 alternatives
-rw-r--r--    1 0        0             298 Mar 28  2007 anacrontab
-rw-r--r--    1 0        0             395 Nov 22  2006 ant.conf
drwxr-xr-x    2 0        0            4096 Apr 26 13:01 ant.d
-rw-r--r--    1 0        0            5421 May 04 12:08 asound.state
-rw-------    1 0        0               1 Oct 08  2014 at.deny
drwxr-x---    3 0        0            4096 Apr 27 07:58 audisp
drwxr-x---    2 0        0            4096 Apr 27 07:58 audit
-rw-r--r--    1 0        0             717 Sep 17  2014 auto.master
-rw-r--r--    1 0        0             581 Sep 17  2014 auto.misc
-rwxr-xr-x    1 0        0            1292 Sep 17  2014 auto.net
-rwxr-xr-x    1 0        0             742 Sep 17  2014 auto.smb
-rw-------    1 0        0            3902 Sep 17  2014 autofs_ldap_auth.conf
drwxr-xr-x    4 0        0            4096 Apr 27 08:00 avahi
-rw-r--r--    1 0        0            1708 Apr 29 07:42 bashrc
-rw-r--r--    1 0        0            1872 Feb 22  2012 bashrc.rpmnew
drwxr-xr-x    2 0        0            4096 May 09 07:02 blkid
drwxr-xr-x    2 0        0            4096 Apr 11 18:37 bluetooth
drwxr-xr-x    2 0        0            4096 Apr 27 07:57 bonobo-activation
-rw-r--r--    1 0        0             351 Sep 20  2009 capi.conf
-rw-r--r--    1 0        0             977 Feb 26  2009 cdrecord.conf
drwxr-xr-x    2 0        0            4096 Apr 29 11:21 cipe
-rw-r--r--    1 0        0            6308 Nov 11  2007 conman.conf
drwx------    2 0        0            4096 Apr 27 07:59 cron.d
drwxr-xr-x    2 0        0            4096 Apr 27 08:02 cron.daily
-rw-r--r--    1 0        0               0 Apr 11 18:35 cron.deny
drwxr-xr-x    2 0        0            4096 Jan 09  2013 cron.hourly
drwxr-xr-x    2 0        0            4096 Jan 09  2013 cron.monthly
drwxr-xr-x    2 0        0            4096 Apr 27 07:59 cron.weekly
-rw-r--r--    1 0        0             255 Jan 09  2013 crontab
-rw-r--r--    1 0        0            1044 Feb 22  2012 csh.cshrc
-rw-r--r--    1 0        0             823 Feb 22  2012 csh.login
drwxr-xr-x    5 0        7            4096 Apr 27 08:02 cups
drwxr-xr-x    4 0        0            4096 Apr 27 07:57 dbus-1
drwxr-xr-x    2 0        0            4096 Apr 28 08:53 default
drwxr-xr-x    2 0        0            4096 Apr 27 08:01 depmod.d
drwxr-xr-x    2 0        0            4096 Feb 22  2012 desktop-profiles
drwxr-xr-x    3 0        0            4096 Aug 24  2015 dev.d
-rw-r--r--    1 0        0             178 Jul 08  2015 dhcp6c.conf
-rw-r--r--    1 0        0           18484 Sep 01  2009 dnsmasq.conf
drwxr-xr-x    2 0        0            4096 Sep 01  2009 dnsmasq.d
-rw-r--r--    1 0        0           42956 Nov 25  2014 dovecot.conf
-rw-rw-r--    1 0        6               0 Feb 23  2012 dumpdates
-rw-r--r--    1 0        0            4843 Dec 15  2008 enscript.cfg
-rw-r--r--    1 0        0               0 Feb 22  2012 environment
-rw-r--r--    1 0        0             153 Feb 22  2012 esd.conf
-rw-r--r--    1 0        0               0 Jan 12  2000 exports
-rw-r--r--    1 0        0           22060 Jan 07  2007 fb.modes
-rw-r--r--    1 0        0              59 Jan 31  2006 filesystems
drwxr-xr-x    2 0        0            4096 Apr 27 08:08 firmware
drwxr-xr-x    4 0        0            4096 Apr 11 18:34 fonts
drwxr-xr-x    2 0        0            4096 Apr 27 07:58 foomatic
-rw-r--r--    1 0        0            1644 May 02 09:51 fstab
-rw-r--r--    1 0        0            1471 Apr 28 07:13 fstab.old
drwxr-xr-x    6 0        0            4096 Apr 11 18:36 gconf
drwxr-xr-x    2 0        0            4096 Oct 24  2013 gcrypt
drwxr-xr-x    7 0        0            4096 Apr 27 07:59 gdm
drwxr-xr-x    2 0        0            4096 Sep 24  2013 ghostscript
drwxr-xr-x    4 0        0            4096 Dec 03  2013 gimp
drwxr-xr-x    3 0        0            4096 Jul 10  2013 gnome-vfs-2.0
-rw-r--r--    1 0        0           10793 Jan 06  2007 gnome-vfs-mime-magic
-rw-r--r--    1 0        0            1756 Jan 06  2007 gpm-root.conf
-rw-r--r--    1 0        0             789 Apr 28 09:26 group
-rw-r--r--    1 0        0             775 Apr 28 09:26 group-
lrwxrwxrwx    1 0        0              22 Apr 11 18:41 grub.conf -> ../boot/grub/grub.conf
-r--------    1 0        0             654 Apr 28 09:26 gshadow
-r--------    1 0        0             643 Apr 28 09:26 gshadow-
-rw-r--r--    1 0        0             833 Mar 22  2007 gssapi_mech.conf
drwxr-xr-x    3 0        0            4096 Apr 27 08:06 gtk-2.0
drwxr-xr-x    3 0        0            4096 Jan 09  2013 hal
-rw-r--r--    1 0        0               0 Feb 22  2012 host.conf
-rw-r--r--    1 0        0             276 May 03 10:03 hosts
-rw-r--r--    1 0        0             161 Jan 12  2000 hosts.allow
-rw-r--r--    1 0        0             165 Feb 22  2012 hosts.deny
drwxr-xr-x    2 0        0            4096 Apr 27 08:01 hp
drwxr-xr-x    4 0        0            4096 Apr 27 07:58 httpd
-rw-r--r--    1 0        0            3579 May 06  2015 idmapd.conf
lrwxrwxrwx    1 0        0              11 Apr 11 18:34 init.d -> rc.d/init.d
-rw-r--r--    1 0        0             658 Sep 22  2014 initlog.conf
-rw-r--r--    1 0        0            1666 Apr 11 18:41 inittab
-rw-r--r--    1 0        0             758 Sep 23  2004 inputrc
drwxr-xr-x    2 0        0            4096 Apr 27 07:55 iproute2
drwxr-xr-x    2 0        0            4096 Apr 26 12:43 iscsi
drwxr-xr-x    2 0        0            4096 Apr 11 18:37 isdn
-rw-r--r--    1 0        0              48 Sep 19  2014 issue
-rw-r--r--    1 0        0              47 Sep 19  2014 issue.net
drwxr-xr-x    3 0        0            4096 Apr 27 07:56 java
drwxr-xr-x    2 0        0            4096 Jan 09  2013 jvm
drwxr-xr-x    2 0        0            4096 Jan 09  2013 jvm-commmon
-rw-r--r--    1 0        0           32016 May 04  2011 jwhois.conf
-rw-r--r--    1 0        0            1265 Apr 27 07:59 kdump.conf
-rw-r--r--    1 0        0             608 Sep 03  2014 krb5.conf
-rw-r--r--    1 0        0           45719 Apr 27 08:55 ld.so.cache
-rw-r--r--    1 0        0              28 Oct 08  2006 ld.so.conf
drwxr-xr-x    2 0        0            4096 Apr 27 08:04 ld.so.conf.d
-rw-r--r--    1 0        0            9028 Jun 15  2015 ldap.conf
-rw-r--r--    1 0        0            3544 Jan 09  2013 lftp.conf
-rw-r-----    1 0        0             191 Oct 27  2011 libaudit.conf
-rw-r--r--    1 0        0            2506 Aug 07  2012 libuser.conf
drwx------    3 0        0            4096 Apr 26 12:53 libvirt
-rw-r--r--    1 0        0             557 Apr 27 07:57 localtime
-rw-r--r--    1 0        0            1503 Sep 17  2014 login.defs
-rw-r--r--    1 0        0             619 Jun 04  2012 logrotate.conf
drwxr-xr-x    2 0        0            4096 Apr 27 08:05 logrotate.d
drwxr-xr-x    4 0        0            4096 Aug 29  2012 logwatch
drwxr-xr-x    2 0        0            4096 Apr 27 08:08 lsb-release.d
drwxr-xr-x    5 0        0            4096 Apr 27 07:56 lvm
drwxr-xr-x    3 0        0            4096 Apr 27 07:58 mail
-rw-r--r--    1 0        0             112 Jan 07  2007 mail.rc
-rw-r--r--    1 0        0             293 Jan 07  2007 mailcap
drwxr-xr-x    2 0        0            4096 Apr 11 18:35 makedev.d
-rw-r--r--    1 0        0            4617 May 30  2012 man.config
drwxr-xr-x    2 0        0            4096 Apr 27 07:56 maven
drwxr-xr-x    2 0        0            4096 Apr 11 18:34 mgetty+sendfax
-rw-r--r--    1 0        0           14100 Jan 07  2007 mime.types
-rw-r--r--    1 0        0            1112 Jan 07  2007 minicom.users
-rw-r--r--    1 0        0             330 Sep 18  2014 mke2fs.conf
-rw-r--r--    1 0        0             560 May 02 08:57 modprobe.conf
-rw-r--r--    1 0        0             579 May 02 08:57 modprobe.conf~
drwxr-xr-x    2 0        0            4096 Apr 27 08:06 modprobe.d
-rw-r--r--    1 0        0               0 Jan 12  2000 motd
-rw-r--r--    1 0        0             453 May 09 07:02 mtab
-rw-r--r--    1 0        0            1983 Jan 07  2007 mtools.conf
-rw-r--r--    1 0        0            2706 Oct 22  2015 multipath.conf
-rw-r--r--    1 0        0             441 Jan 22  2013 my.cnf
lrwxrwxrwx    1 0        25             51 May 02 12:04 named.caching-nameserver.conf -> /var/named/chroot/etc/named.caching-nameserver.conf
lrwxrwxrwx    1 0        25             41 May 02 12:04 named.rfc1912.zones -> /var/named/chroot/etc/named.rfc1912.zones
drwxr-xr-x    2 0        0            4096 Apr 27 07:56 netplug
drwxr-xr-x    2 0        0            4096 Apr 27 07:56 netplug.d
drwxr-xr-x    2 9        13           4096 Apr 11 18:35 news
-rw-r--r--    1 0        0            1895 Aug 17  2015 nscd.conf
-rw-r--r--    1 0        0            1717 Apr 27 08:02 nsswitch.conf
drwxr-xr-x    2 0        0            4096 Apr 27 08:05 ntp
-rw-r--r--    1 0        0            1868 Dec 20  2014 ntp.conf
drwxr-xr-x    2 0        0            4096 Feb 23  2012 oddjob
-rw-r--r--    1 0        0            4461 Jul 19  2006 oddjobd.conf
drwxr-xr-x    2 0        0            4096 Apr 27 08:05 oddjobd.conf.d
drwxr-xr-x    3 0        0            4096 Apr 27 07:57 openldap
drwxr-xr-x    2 0        0            4096 May 11  2011 opt
drwxr-xr-x    2 0        0            4096 Apr 27 08:05 pam.d
drwxr-xr-x    2 0        0            4096 Apr 27 08:00 pam_pkcs11
-rw-r--r--    1 0        0              12 Jan 06  2007 pam_smb.conf
drwxr-xr-x    3 0        0            4096 Apr 27 07:55 pango
-rw-r--r--    1 0        0            2076 Apr 28 09:26 passwd
-rw-r--r--    1 0        0            2035 Apr 28 09:26 passwd-
drwxr-xr-x    2 0        0            4096 Apr 11 18:37 pcmcia
drwxr-xr-x    2 0        0            4096 Apr 26 11:49 php.d
-rw-r--r--    1 0        0           45079 Nov 06  2014 php.ini
-rw-r--r--    1 0        0            2875 Jan 07  2007 pinforc
drwxr-xr-x    7 0        0            4096 May 11  2011 pki
drwxr-xr-x    5 0        0            4096 Apr 27 08:05 pm
drwxr-xr-x    3 0        0            4096 Apr 27 07:59 ppp
-rw-r--r--    1 0        0          383503 May 03 08:10 prelink.cache
-rw-r--r--    1 0        0             973 Sep 18  2008 prelink.conf
drwxr-xr-x    2 0        0            4096 Apr 11 20:00 prelink.conf.d
-rw-r--r--    1 0        0             135 May 09 07:02 printcap
-rw-r--r--    1 0        0            1099 Apr 29 07:39 profile
drwxr-xr-x    2 0        0            4096 Apr 29 07:40 profile.d
-rw-r--r--    1 0        0            1344 Feb 22  2012 profile.rpmnew
-rw-r--r--    1 0        0            6108 Oct 11  2006 protocols
drwxr-xr-x    2 0        0            4096 Apr 27 08:02 purple
-rw-r--r--    1 0        0             220 Jan 09  2013 quotagrpadmins
-rw-r--r--    1 0        0             290 Jan 09  2013 quotatab
drwxr-xr-x    3 0        0            4096 Apr 27 07:59 racoon
lrwxrwxrwx    1 0        0               7 Apr 27 07:58 rc -> rc.d/rc
drwxr-xr-x   10 0        0            4096 Apr 27 07:58 rc.d
lrwxrwxrwx    1 0        0              13 Apr 27 07:58 rc.local -> rc.d/rc.local
-rwxr-x---    1 9        13           4428 Jan 26  2010 rc.news
lrwxrwxrwx    1 0        0              15 Apr 27 07:58 rc.sysinit -> rc.d/rc.sysinit
lrwxrwxrwx    1 0        0              10 Apr 27 07:58 rc0.d -> rc.d/rc0.d
lrwxrwxrwx    1 0        0              10 Apr 27 07:58 rc1.d -> rc.d/rc1.d
lrwxrwxrwx    1 0        0              10 Apr 27 07:58 rc2.d -> rc.d/rc2.d
lrwxrwxrwx    1 0        0              10 Apr 27 07:58 rc3.d -> rc.d/rc3.d
lrwxrwxrwx    1 0        0              10 Apr 27 07:58 rc4.d -> rc.d/rc4.d
lrwxrwxrwx    1 0        0              10 Apr 27 07:58 rc5.d -> rc.d/rc5.d
lrwxrwxrwx    1 0        0              10 Apr 27 07:58 rc6.d -> rc.d/rc6.d
drwxr-xr-x    2 0        0            4096 Apr 11 18:35 readahead.d
-rw-r--r--    1 0        0             435 May 09 07:02 reader.conf
drwxr-xr-x    2 0        0            4096 Apr 27 08:00 reader.conf.d
drwxr-xr-x    2 0        0            4096 Apr 27 08:04 redhat-lsb
-rw-r--r--    1 0        0              28 Sep 19  2014 redhat-release
-rw-r--r--    1 0        0            1484 Jan 06  2007 request-key.conf
-rw-r--r--    1 0        0              76 May 03 12:58 resolv.conf
drwxr-xr-x    3 0        0            4096 Apr 11 18:36 rhgb
lrwxrwxrwx    1 0        0              11 Apr 27 07:56 rmt -> ../sbin/rmt
lrwxrwxrwx    1 0        0              31 May 03 11:31 rndc.conf -> /var/named/chroot/etc/rndc.conf
lrwxrwxrwx    1 0        25             31 Apr 11 18:37 rndc.key -> /var/named/chroot//etc/rndc.key
-rw-r--r--    1 0        0            1615 Aug 30  2001 rpc
drwxr-xr-x    2 0        0            4096 Dec 09  2014 rpm
-rw-r--r--    1 0        0             133 Apr 29 08:19 rsyncd.conf
-rw-r--r--    1 0        0             754 Sep 22  2014 rwtab
drwxr-xr-x    2 0        0            4096 Sep 22  2014 rwtab.d
drwxr-xr-x    2 0        0            4096 Apr 27 07:59 samba
drwxr-xr-x    2 0        0            4096 Apr 11 18:37 sane.d
drwxr-xr-x    2 0        0            4096 Sep 03  2012 sasl2
drwxr-xr-x    2 0        0            4096 Apr 27 07:58 scim
-rw-r--r--    1 0        0             103 Mar 14  2007 scrollkeeper.conf
-rw-r--r--    1 0        0             666 Aug 24  2015 scsi_id.config
-rw-------    1 0        0             190 Apr 19 12:41 securetty
drwxr-xr-x    5 0        0            4096 Apr 27 07:58 security
drwxr-xr-x    3 0        0            4096 Sep 17  2014 selinux
-rw-r--r--    1 0        0          362031 Feb 23  2006 services
-rw-r--r--    1 0        0             216 Oct 01  2013 sestatus.conf
drwxr-xr-x    2 0        0            4096 Apr 27 08:04 setroubleshoot
drwxr-xr-x    2 0        0            4096 Apr 11 18:35 setuptool.d
drwxr-xr-x    2 0        0            4096 Apr 26 13:00 sgml
-r--------    1 0        0            1419 Apr 28 09:26 shadow
-r--------    1 0        0            1294 Apr 28 09:26 shadow-
-rw-r--r--    1 0        0              60 Apr 11 18:35 shells
drwxr-xr-x    3 0        0            4096 Apr 28 08:28 skel
-rw-r--r--    1 0        0           21851 Jan 06  2007 slrn.rc
-rw-r--r--    1 0        0            6717 Jan 09  2013 smartd.conf
drwxr-xr-x    2 0        0            4096 Mar 16  2015 smrsh
drwxr-xr-x    3 0        0            4096 Mar 14  2007 sound
drwxr-xr-x    2 0        0            4096 Apr 27 08:00 squid
drwxr-xr-x    2 0        0            4096 Apr 27 07:59 ssh
drwxr-xr-x    2 0        0            4096 Nov 03  2014 stunnel
-r--r-----    1 0        0            3381 Mar 10  2014 sudoers
drwxr-xr-x   10 0        0            4096 May 03 10:18 sysconfig
-rw-r--r--    1 0        0             994 Sep 22  2014 sysctl.conf
-rw-r--r--    1 0        0             938 Apr 11 18:35 syslog.conf
-rw-------    1 0        0            6411 May 25  2008 tcsd.conf
-rw-r--r--    1 0        0          807103 Jan 06  2007 termcap
drwxrwxr-x    3 0        91           4096 Apr 26 13:01 tomcat5
-rw-r--r--    1 0        0            1309 May 09 07:02 tpvmlp.conf
-rw-r--r--    1 0        0            2643 Jan 07  2007 tux.mime.types
drwxr-xr-x    5 0        0            4096 Apr 27 07:57 udev
-rw-r--r--    1 0        0             143 Apr 11 20:00 updatedb.conf
-rw-r--r--    1 0        0            1533 Jan 09  2013 vimrc
-rw-r--r--    1 0        0            1533 Jan 09  2013 virc
drwxr-xr-x    3 0        0            4096 Apr 11 20:00 vmware-caf
drwxr-xr-x    6 0        0            4096 Apr 27 08:33 vmware-tools
drwxr-xr-x    2 0        0            4096 May 09 07:21 vsftpd
-rw-r--r--    1 0        0            2678 Jan 09  2013 warnquota.conf
-rw-r--r--    1 0        0           23735 Jan 09  2007 webalizer.conf
-rw-r--r--    1 0        0            4204 May 10  2012 wgetrc
drwxr-xr-x    2 0        0            4096 Apr 27 07:58 wpa_supplicant
-rw-r--r--    1 0        0               0 May 02 08:49 wvdial.conf
drwxr-xr-x    4 0        0            4096 Apr 11 18:36 xdg
-rw-r--r--    1 0        0            1001 Oct 08  2013 xinetd.conf
drwxr-xr-x    2 0        0            4096 Apr 29 09:35 xinetd.d
drwxr-xr-x    2 0        0            4096 Apr 11 18:35 xml
-rw-r--r--    1 0        0             585 Jun 30  2011 yp.conf
drwxr-xr-x    3 0        0            4096 Apr 27 08:05 yum
-rw-r--r--    1 0        0             379 Jul 26  2012 yum.conf
drwxr-xr-x    2 0        0            4096 Apr 27 09:31 yum.repos.d
226 Directory send OK.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -5
#
# Specific Configuration
#
#banner_file=/etc/vsftpd/banner.txt
chroot_local_user=YES
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (127,0,0,1,54,1)
150 Here comes the directory listing.
-rw-r--r--    1 501      501          2076 May 09 07:24 file1
-rw-r--r--    1 501      501          2076 May 09 07:24 file2
-rw-r--r--    1 501      501          2076 May 09 07:24 file3
-rw-r--r--    1 501      501          2076 May 09 07:24 file4
226 Directory send OK.
ftp> cd /etc
550 Failed to change directory.
ftp> dir
227 Entering Passive Mode (127,0,0,1,209,116)
150 Here comes the directory listing.
-rw-r--r--    1 501      501          2076 May 09 07:24 file1
-rw-r--r--    1 501      501          2076 May 09 07:24 file2
-rw-r--r--    1 501      501          2076 May 09 07:24 file3
-rw-r--r--    1 501      501          2076 May 09 07:24 file4
226 Directory send OK.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -5
#
# Specific Configuration
#
#banner_file=/etc/vsftpd/banner.txt
#chroot_local_user=YES
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]#


[root@linux220 /etc/vsftpd]# ls
banner.txt  ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh
[root@linux220 /etc/vsftpd]# cat user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -5
# Specific Configuration
#
#banner_file=/etc/vsftpd/banner.txt
#chroot_local_user=YES
userlist_deny=NO
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# vi user_list
[root@linux220 /etc/vsftpd]# cat user_list | tail -3
games
nobody
user01
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): root
530 Permission denied.
Login failed.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -3
#banner_file=/etc/vsftpd/banner.txt
#chroot_local_user=YES
#userlist_deny=NO
[root@linux220 /etc/vsftpd]# vi user_list
[root@linux220 /etc/vsftpd]# cat user_list | tail -3
operator
games
nobody
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]#


[root@linux220 /etc/vsftpd]# cd /var/ftp
[root@linux220 /var/ftp]# ls -l
total 8.0K
drwxr-xr-x 2 root root 4.0K Jan  9  2013 pub
[root@linux220 /var/ftp]# cd pub
[root@linux220 /var/ftp/pub]# mkdir test
[root@linux220 /var/ftp/pub]# cd test
[root@linux220 /var/ftp/pub/test]# cp /etc/passwd .
[root@linux220 /var/ftp/pub/test]# ls
passwd
[root@linux220 /var/ftp/pub/test]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (127,0,0,1,233,62)
150 Here comes the directory listing.
drwxr-xr-x    3 0        0            4096 May 09 07:41 pub
226 Directory send OK.
ftp> cd pub
250 Directory successfully changed.
ftp> dir
227 Entering Passive Mode (127,0,0,1,84,175)
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 May 09 07:41 test
226 Directory send OK.
ftp> cd test
250 Directory successfully changed.
ftp> dir
227 Entering Passive Mode (127,0,0,1,116,228)
150 Here comes the directory listing.
-rw-r--r--    1 0        0            2076 May 09 07:41 passwd
226 Directory send OK.
ftp> quit
221 Goodbye.
[root@linux220 /var/ftp/pub/test]# firefox &
[1] 5411
[root@linux220 /var/ftp/pub/test]#
(Gecko:5411): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer' has no property named `window'

(Gecko:5411): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer' has no property named `window'
console.error:
  [CustomizableUI]
  Custom widget with id loop-button does not return a valid node
console.error:
  [CustomizableUI]
  Custom widget with id loop-button does not return a valid node

(Gecko:5411): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer' has no property named `window'

(Gecko:5411): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer' has no property named `window'

[1]+  Done                    firefox
[root@linux220 /var/ftp/pub/test]#

그림1
그림2


[root@linux220 /var/ftp/pub/test]# FTP
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -3
#chroot_local_user=YES
#userlist_deny=NO
listen_port=2121
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# ftp localhost
ftp: connect: Connection refused
ftp> quit
[root@linux220 /etc/vsftpd]# ftp localhost 21
ftp: connect: Connection refused
ftp> quit
[root@linux220 /etc/vsftpd]# ftp localhost 2121
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -3
#chroot_local_user=YES
#userlist_deny=NO
#listen_port=2121
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]#


[root@linux220 /etc/vsftpd]# vi vsftpd.conf
You have new mail in /var/spool/mail/root
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -3
#userlist_deny=NO
#listen_port=2121
max_clients=3
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 221 Goodbye.
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -3
#userlist_deny=NO
#listen_port=2121
#max_clients=3
[root@linux220 /etc/vsftpd]#

그림3


[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -3
#listen_port=2121
#max_clients=3
max_per_ip=3
[root@linux220 /etc/vsftpd]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /etc/vsftpd]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user01
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
[root@linux220 /etc/vsftpd]# vi vsftpd.conf
[root@linux220 /etc/vsftpd]# cat vsftpd.conf | tail -3
#listen_port=2121
#max_clients=3
#max_per_ip=3
[root@linux220 /etc/vsftpd]#

그림4


[root@linux220 /etc/vsftpd]# cd /var/ftp/pub
[root@linux220 /var/ftp/pub]# mkdir incoming
[root@linux220 /var/ftp/pub]# chmod 603 incoming
[root@linux220 /var/ftp/pub]# ls -l
total 8.0K
drw-----wx 2 root root 4.0K May  9 17:27 incoming
drwxr-xr-x 2 root root 4.0K May  9 16:41 test
[root@linux220 /var/ftp/pub]# useradd -d /var/ftp/pub/incoming -r -s /sbin/nologin ftpupload
[root@linux220 /var/ftp/pub]# vi /etc/vsftpd/vsftpd.conf
[root@linux220 /var/ftp/pub]# cat /etc/vsftpd/vsftpd.conf | grep anon_upload
anon_upload_enable=YES
[root@linux220 /var/ftp/pub]# cat /etc/vsftpd/vsftpd.conf | grep chown_
chown_uploads=YES
chown_username=ftpupload
[root@linux220 /var/ftp/pub]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@linux220 /var/ftp/pub]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub/incoming
250 Directory successfully changed.
ftp> put
(local-file) /etc/passwd
(remote-file) passwd
local: /etc/passwd remote: passwd
227 Entering Passive Mode (127,0,0,1,69,116)
150 Ok to send data.
226 File receive OK.
2133 bytes sent in 5.5e-05 seconds (3.8e+04 Kbytes/s)
ftp> ls
227 Entering Passive Mode (127,0,0,1,98,227)
150 Here comes the directory listing.
226 Transfer done (but failed to open directory).
ftp> quit
221 Goodbye.
[root@linux220 /var/ftp/pub]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
distcache:x:94:94:Distcache:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
squid:x:23:23::/var/spool/squid:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
hsqldb:x:96:96::/var/lib/hsqldb:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:102:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
fedora:x:500:500:fedora:/home/fedora:/bin/bash
tomcat:x:91:91:Tomcat:/usr/share/tomcat5:/bin/sh
user01:x:501:501::/home/user01:/bin/bash
user02:x:502:502::/home/user02:/bin/bash
user03:x:503:503::/home/user03:/bin/bash
ftpupload:x:101:103::/var/ftp/pub/incoming:/sbin/nologin
[root@linux220 /var/ftp/pub]# ls -l /var/ftp/pub/incoming/
total 4.0K
-rw------- 1 ftpupload ftp 2.1K May  9 17:39 passwd
[root@linux220 /var/ftp/pub]# vi /etc/vsftpd//vsftpd.conf
[root@linux220 /var/ftp/pub]# cat /etc/vsftpd//vsftpd.conf | grep anon_upload
#anon_upload_enable=YES
[root@linux220 /var/ftp/pub]# cat /etc/vsftpd//vsftpd.conf | grep chown_
#chown_uploads=YES
#chown_username=whoever
[root@linux220 /var/ftp/pub]#


[참고] max_clients 개수의 산정

max_clients의 개수는 서버의 자원(CPU, MEM, DISK, Network)에 따라서 결정할 수 있다.

[TERM1] 테스트용 윈도우1
# pgrep –lf vsftpd
8868 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

# ftp localhost
user01 사용자로 로그인

[TERM2] 테스트용 윈도우2
# pgrep -lf vsftpd
8868  /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
10262 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
10265 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

# pmap 8868
..... (중략) .....
00002b0480fab000   2048K -----  /lib64/libsepol.so.1
00002b04811ab000      4K rw---  /lib64/libsepol.so.1
00002b04811ac000     48K rw---    [ anon ]
00002b0499578000    132K rw---    [ anon ]
00007fff1d94a000     84K rw---    [ stack ]
00007fff1d9fd000     12K r-x--    [ anon ]
ffffffffff600000   8192K -----    [ anon ]
 total            52488K

-> 8868(vsftpd) 데몬 하나가 약 5M 정도의 메모리 공간을 사용한다.
-> 한명의 FTP 사용자가 접속할 때 마다 vsftpd 데몬이 2개(한개당 5M 정도씩) 뜨게 되는 것이다.

# pmap `pgrep vsftpd` | grep total
 total            52488K
 total            54580K
 total            54604K

# top     (# top -n 1 | grep Mem:)
Tasks: 157 total,   1 running, 155 sleeping,   0 stopped,   1 zombie
Cpu(s):  1.6%us,  0.7%sy,  0.0%ni, 97.4%id,  0.0%wa,  0.2%hi,  0.1%si,  0.0%st
Mem:   1035032k total,   519328k used,   515704k free,    32448k buffers
Swap:  1052248k total,        0k used,  1052248k free,   365828k cached
..... (중략) .....

-> 전체 메모리 : 1035032KB
-> 사용중인 메모리 : 519328KB
-> 남은 메모리 공간: 515704KB
1035032KB * (80/100) * {(남은메모리) * (80/100)}


전체메모리의 OS를 사용하기 위한 20%를 제외하고
남은 80% 중에서 사용량을 제외한 용량에서 80% 정도를 산정
7일의 샘플링구간을 둬서 사용량 분석 -> 최종치 결정
ftp 보통 per ip 2개

그림5
그림6
그림7


[root@linux220 ~]# ftp -d localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
ftp: setsockopt: Bad file descriptor
---> AUTH GSSAPI
530 Please login with USER and PASS.
---> AUTH KERBEROS_V4
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): root
---> USER root
331 Please specify the password.
Password:
---> PASS XXXX
230 Login successful.
cmds.c:284: verbose=1 debug=1 overbose=1
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
---> PASV
227 Entering Passive Mode (127,0,0,1,44,208)
---> LIST
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Apr 11 20:24 Desktop
drwx------    2 0        0            4096 May 02 11:52 Downloads
-rw-r--r--    1 0        0            1690 Apr 27 09:17 RPM-GPG-KEY-test
-rw-------    1 0        0            1413 Apr 11 18:41 anaconda-ks.cfg
drwxr-xr-x    2 0        0            4096 Apr 28 11:49 bin
-rw-------    1 0        0              92 Apr 26 13:15 dead.letter
-rw-r--r--    1 0        0           30720 Apr 11 18:41 install.log
-rw-r--r--    1 0        0            5639 Apr 11 18:41 install.log.syslog
-rw-r--r--    1 0        0         1048576 May 04 11:42 linux220.txt
-rw-------    1 0        0           32567 Apr 26 13:16 mbox
drwxr-xr-x    3 0        0            4096 Apr 22 11:41 mnt
drwxr-xr-x    3 0        0            4096 Apr 26 13:03 workspace
-rw-r--r--    1 0        0          278362 Apr 26 11:44 yum.log
226 Directory send OK.
ftp> help
Commands may be abbreviated.  Commands are:

!               cr              mdir            proxy           send
$               delete          mget            sendport        site
account         debug           mkdir           put             size
append          dir             mls             pwd             status
ascii           disconnect      mode            quit            struct
bell            form            modtime         quote           system
binary          get             mput            recv            sunique
bye             glob            newer           reget           tenex
case            hash            nmap            rstatus         trace
ccc             help            nlist           rhelp           type
cd              idle            ntrans          rename          user
cdup            image           open            reset           umask
chmod           lcd             passive         restart         verbose
clear           ls              private         rmdir           ?
close           macdef          prompt          runique
cprotect        mdelete         protect         safe
ftp> passive
Passive mode off.
ftp> passive
Passive mode on.
ftp> quit
---> QUIT
221 Goodbye.
[root@linux220 ~]# ftp -d localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
ftp: setsockopt: Bad file descriptor
---> AUTH GSSAPI
530 Please login with USER and PASS.
---> AUTH KERBEROS_V4
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): root
---> USER root
331 Please specify the password.
Password:
---> PASS XXXX
230 Login successful.
cmds.c:284: verbose=1 debug=1 overbose=1
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> passive
Passive mode off.
ftp> ls
---> PORT 127,0,0,1,173,1
200 PORT command successful. Consider using PASV.
---> LIST
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Apr 11 20:24 Desktop
drwx------    2 0        0            4096 May 02 11:52 Downloads
-rw-r--r--    1 0        0            1690 Apr 27 09:17 RPM-GPG-KEY-test
-rw-------    1 0        0            1413 Apr 11 18:41 anaconda-ks.cfg
drwxr-xr-x    2 0        0            4096 Apr 28 11:49 bin
-rw-------    1 0        0              92 Apr 26 13:15 dead.letter
-rw-r--r--    1 0        0           30720 Apr 11 18:41 install.log
-rw-r--r--    1 0        0            5639 Apr 11 18:41 install.log.syslog
-rw-r--r--    1 0        0         1048576 May 04 11:42 linux220.txt
-rw-------    1 0        0           32567 Apr 26 13:16 mbox
drwxr-xr-x    3 0        0            4096 Apr 22 11:41 mnt
drwxr-xr-x    3 0        0            4096 Apr 26 13:03 workspace
-rw-r--r--    1 0        0          278362 Apr 26 11:44 yum.log
226 Directory send OK.
ftp> quit
---> QUIT
221 Goodbye.
[root@linux220 ~]#


[TERM1]
[root@linux220 ~]# tail -f /var/log/xferlog
Mon May  9 08:39:36 2016 1 127.0.0.1 2133 /pub/incoming/passwd b _ i a ftp ftp 0 * c
Mon May  9 09:46:55 2016 1 127.0.0.1 2133 /test/file1 b _ o r root ftp 0 * c
Mon May  9 09:47:09 2016 1 127.0.0.1 2133 /root/file1 b _ i r root ftp 0 * c

[root@linux220 ~]#


[TERM2]
[root@linux220 ~]# cp /etc/passwd /test/file1
cp: overwrite `/test/file1'? y
[root@linux220 ~]# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): root
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /test
250 Directory successfully changed.
ftp> lcd /tmp
Local directory now /tmp
ftp> bin
200 Switching to Binary mode.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> prompt
Interactive mode off.
ftp> mget file1
local: file1 remote: file1
227 Entering Passive Mode (127,0,0,1,201,75)
150 Opening BINARY mode data connection for file1 (2133 bytes).
##
226 File send OK.
2133 bytes received in 5.9e-05 seconds (3.5e+04 Kbytes/s)
ftp> cd /root
250 Directory successfully changed.
ftp> lcd /tmp
Local directory now /tmp
ftp> mput file1
local: file1 remote: file1
227 Entering Passive Mode (127,0,0,1,150,94)
150 Ok to send data.
##
226 File receive OK.
2133 bytes sent in 9.3e-05 seconds (2.2e+04 Kbytes/s)
ftp> quit
221 Goodbye.
[root@linux220 ~]#

그림8



[root@linux220 ~]# telnet localhost 110
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused
[root@linux220 ~]# rpm -qa | grep dovecot
dovecot-1.0.7-9.el5_11.4
[root@linux220 ~]# rpm -qa dovecot
dovecot-1.0.7-9.el5_11.4
[root@linux220 ~]# rpm -ql dovecot
/etc/dovecot.conf
/etc/pam.d/dovecot
/etc/pki/dovecot
/etc/pki/dovecot/certs
/etc/pki/dovecot/certs/dovecot.pem
/etc/pki/dovecot/dovecot-openssl.cnf
/etc/pki/dovecot/private
/etc/pki/dovecot/private/dovecot.pem
/etc/rc.d/init.d/dovecot
/etc/sysconfig/dovecot
/usr/lib/dovecot
/usr/lib/dovecot/imap
/usr/lib/dovecot/imap/lib01_acl_plugin.so
/usr/lib/dovecot/imap/lib02_lazy_expunge_plugin.so
/usr/lib/dovecot/imap/lib10_quota_plugin.so
/usr/lib/dovecot/imap/lib11_imap_quota_plugin.a
/usr/lib/dovecot/imap/lib11_imap_quota_plugin.la
/usr/lib/dovecot/imap/lib11_imap_quota_plugin.so
/usr/lib/dovecot/imap/lib11_trash_plugin.so
/usr/lib/dovecot/imap/lib20_convert_plugin.so
/usr/lib/dovecot/imap/lib20_mail_log_plugin.so
/usr/lib/dovecot/imap/lib20_zlib_plugin.a
/usr/lib/dovecot/imap/lib20_zlib_plugin.la
/usr/lib/dovecot/imap/lib20_zlib_plugin.so
/usr/lib/dovecot/lda
/usr/lib/dovecot/lda/lib01_acl_plugin.so
/usr/lib/dovecot/lda/lib10_quota_plugin.so
/usr/lib/dovecot/lda/lib11_trash_plugin.so
/usr/lib/dovecot/lda/lib20_convert_plugin.so
/usr/lib/dovecot/lda/lib20_mail_log_plugin.so
/usr/lib/dovecot/lib01_acl_plugin.a
/usr/lib/dovecot/lib01_acl_plugin.la
/usr/lib/dovecot/lib01_acl_plugin.so
/usr/lib/dovecot/lib02_lazy_expunge_plugin.a
/usr/lib/dovecot/lib02_lazy_expunge_plugin.la
/usr/lib/dovecot/lib02_lazy_expunge_plugin.so
/usr/lib/dovecot/lib10_quota_plugin.a
/usr/lib/dovecot/lib10_quota_plugin.la
/usr/lib/dovecot/lib10_quota_plugin.so
/usr/lib/dovecot/lib11_trash_plugin.a
/usr/lib/dovecot/lib11_trash_plugin.la
/usr/lib/dovecot/lib11_trash_plugin.so
/usr/lib/dovecot/lib20_convert_plugin.a
/usr/lib/dovecot/lib20_convert_plugin.la
/usr/lib/dovecot/lib20_convert_plugin.so
/usr/lib/dovecot/lib20_mail_log_plugin.a
/usr/lib/dovecot/lib20_mail_log_plugin.la
/usr/lib/dovecot/lib20_mail_log_plugin.so
/usr/lib/dovecot/pop3
/usr/lib/dovecot/pop3/lib02_lazy_expunge_plugin.so
/usr/lib/dovecot/pop3/lib10_quota_plugin.so
/usr/lib/dovecot/pop3/lib20_convert_plugin.so
/usr/lib/dovecot/pop3/lib20_mail_log_plugin.so
/usr/libexec/dovecot
/usr/libexec/dovecot/checkpassword-reply
/usr/libexec/dovecot/deliver
/usr/libexec/dovecot/dict
/usr/libexec/dovecot/dovecot-auth
/usr/libexec/dovecot/gdbhelper
/usr/libexec/dovecot/idxview
/usr/libexec/dovecot/imap
/usr/libexec/dovecot/imap-login
/usr/libexec/dovecot/logview
/usr/libexec/dovecot/pop3
/usr/libexec/dovecot/pop3-login
/usr/libexec/dovecot/rawlog
/usr/libexec/dovecot/ssl-build-param
/usr/sbin/dovecot
/usr/sbin/dovecotpw
/usr/share/doc/dovecot-1.0.7
/usr/share/doc/dovecot-1.0.7/COPYING
/usr/share/doc/dovecot-1.0.7/COPYING.LGPL
/usr/share/doc/dovecot-1.0.7/COPYING.MIT
/usr/share/doc/dovecot-1.0.7/REDHAT-FAQ.txt
/usr/share/doc/dovecot-1.0.7/UW-to-Dovecot-Migration
/usr/share/doc/dovecot-1.0.7/UW-to-Dovecot-Migration/maildir-migration.txt
/usr/share/doc/dovecot-1.0.7/UW-to-Dovecot-Migration/migrate-folders
/usr/share/doc/dovecot-1.0.7/UW-to-Dovecot-Migration/migrate-users
/usr/share/doc/dovecot-1.0.7/UW-to-Dovecot-Migration/perfect_maildir.pl
/usr/share/doc/dovecot-1.0.7/auth-protocol.txt
/usr/share/doc/dovecot-1.0.7/documentation.txt
/usr/share/doc/dovecot-1.0.7/examples
/usr/share/doc/dovecot-1.0.7/examples/dovecot-ldap-example.conf
/usr/share/doc/dovecot-1.0.7/examples/dovecot-sql-example.conf
/usr/share/doc/dovecot-1.0.7/examples/mkcert.sh
/usr/share/doc/dovecot-1.0.7/securecoding.txt
/usr/share/doc/dovecot-1.0.7/wiki
/usr/share/doc/dovecot-1.0.7/wiki/ACL.txt
/usr/share/doc/dovecot-1.0.7/wiki/AixPluginsSupport.txt
/usr/share/doc/dovecot-1.0.7/wiki/AuthDatabase.LDAP.txt
/usr/share/doc/dovecot-1.0.7/wiki/AuthDatabase.Passwd.txt
/usr/share/doc/dovecot-1.0.7/wiki/AuthDatabase.PasswdFile.txt
/usr/share/doc/dovecot-1.0.7/wiki/AuthDatabase.SQL.txt
/usr/share/doc/dovecot-1.0.7/wiki/AuthDatabase.VPopMail.txt
/usr/share/doc/dovecot-1.0.7/wiki/AuthDatabase.txt
/usr/share/doc/dovecot-1.0.7/wiki/Authentication.Kerberos.txt
/usr/share/doc/dovecot-1.0.7/wiki/Authentication.MasterUsers.txt
/usr/share/doc/dovecot-1.0.7/wiki/Authentication.Mechanisms.txt
/usr/share/doc/dovecot-1.0.7/wiki/Authentication.MultipleDatabases.txt
/usr/share/doc/dovecot-1.0.7/wiki/Authentication.PasswordSchemes.txt
/usr/share/doc/dovecot-1.0.7/wiki/Authentication.RestrictAccess.txt
/usr/share/doc/dovecot-1.0.7/wiki/Authentication.txt
/usr/share/doc/dovecot-1.0.7/wiki/BasicConfiguration.txt
/usr/share/doc/dovecot-1.0.7/wiki/Chrooting.txt
/usr/share/doc/dovecot-1.0.7/wiki/Clients.NegativeUIDs.txt
/usr/share/doc/dovecot-1.0.7/wiki/Clients.txt
/usr/share/doc/dovecot-1.0.7/wiki/CommandLine.txt
/usr/share/doc/dovecot-1.0.7/wiki/CompilingSource.txt
/usr/share/doc/dovecot-1.0.7/wiki/Debugging.Authentication.txt
/usr/share/doc/dovecot-1.0.7/wiki/Debugging.ProcessTracing.txt
/usr/share/doc/dovecot-1.0.7/wiki/Debugging.Thunderbird.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.AuthProcess.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.Indexes.Cache.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.Indexes.MailIndexApi.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.Indexes.MainIndex.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.Indexes.TransactionLog.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.Indexes.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.MailProcess.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.Processes.txt
/usr/share/doc/dovecot-1.0.7/wiki/Design.txt
/usr/share/doc/dovecot-1.0.7/wiki/FindMailLocation.txt
/usr/share/doc/dovecot-1.0.7/wiki/FinishBasicConfiguration.txt
/usr/share/doc/dovecot-1.0.7/wiki/HowTo.EximAndDovecotSASL.txt
/usr/share/doc/dovecot-1.0.7/wiki/HowTo.PostfixAndDovecotSASL.txt
/usr/share/doc/dovecot-1.0.7/wiki/HowTo.SimpleVirtualInstall.txt
/usr/share/doc/dovecot-1.0.7/wiki/HowTo.txt
/usr/share/doc/dovecot-1.0.7/wiki/IndexFiles.txt
/usr/share/doc/dovecot-1.0.7/wiki/InetdInstall.txt
/usr/share/doc/dovecot-1.0.7/wiki/Iptables.txt
/usr/share/doc/dovecot-1.0.7/wiki/LDA.Exim.txt
/usr/share/doc/dovecot-1.0.7/wiki/LDA.Postfix.txt
/usr/share/doc/dovecot-1.0.7/wiki/LDA.Qmail.txt
/usr/share/doc/dovecot-1.0.7/wiki/LDA.Sendmail.txt
/usr/share/doc/dovecot-1.0.7/wiki/LDA.Sieve.txt
/usr/share/doc/dovecot-1.0.7/wiki/LDA.txt
/usr/share/doc/dovecot-1.0.7/wiki/Logging.txt
/usr/share/doc/dovecot-1.0.7/wiki/LoginProcess.txt
/usr/share/doc/dovecot-1.0.7/wiki/MDA.txt
/usr/share/doc/dovecot-1.0.7/wiki/MTA.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailLocation.LocalDisk.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailLocation.Maildir.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailLocation.Mbox.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailLocation.SharedDisk.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailLocation.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailboxFormat.MH.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailboxFormat.Maildir.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailboxFormat.dbox.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailboxFormat.mailstore.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailboxFormat.mbox.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailboxFormat.mbx.txt
/usr/share/doc/dovecot-1.0.7/wiki/MailboxFormat.txt
/usr/share/doc/dovecot-1.0.7/wiki/MboxLocking.txt
/usr/share/doc/dovecot-1.0.7/wiki/MboxProblems.txt
/usr/share/doc/dovecot-1.0.7/wiki/Migration.Courier.txt
/usr/share/doc/dovecot-1.0.7/wiki/Migration.Cyrus.txt
/usr/share/doc/dovecot-1.0.7/wiki/Migration.Linuxconf.txt
/usr/share/doc/dovecot-1.0.7/wiki/Migration.MailFormat.txt
/usr/share/doc/dovecot-1.0.7/wiki/Migration.UW.txt
/usr/share/doc/dovecot-1.0.7/wiki/Migration.txt
/usr/share/doc/dovecot-1.0.7/wiki/MissingMailboxes.txt
/usr/share/doc/dovecot-1.0.7/wiki/NFS.txt
/usr/share/doc/dovecot-1.0.7/wiki/Namespaces.txt
/usr/share/doc/dovecot-1.0.7/wiki/OSCompatibility.txt
/usr/share/doc/dovecot-1.0.7/wiki/POP3Server.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.BSDAuth.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.CheckPassword.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.ExtraFields.AllowNets.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.ExtraFields.Host.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.ExtraFields.NoDelay.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.ExtraFields.NoLogin.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.ExtraFields.Proxy.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.ExtraFields.User.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.ExtraFields.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.PAM.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.Shadow.txt
/usr/share/doc/dovecot-1.0.7/wiki/PasswordDatabase.txt
/usr/share/doc/dovecot-1.0.7/wiki/PerformanceTuning.txt
/usr/share/doc/dovecot-1.0.7/wiki/Plugins.Convert.txt
/usr/share/doc/dovecot-1.0.7/wiki/Plugins.Expire.txt
/usr/share/doc/dovecot-1.0.7/wiki/Plugins.Lazyexpunge.txt
/usr/share/doc/dovecot-1.0.7/wiki/Plugins.MailLog.txt
/usr/share/doc/dovecot-1.0.7/wiki/Plugins.Trash.txt
/usr/share/doc/dovecot-1.0.7/wiki/Plugins.txt
/usr/share/doc/dovecot-1.0.7/wiki/PopBSMTPAndDovecot.txt
/usr/share/doc/dovecot-1.0.7/wiki/PopRelay.txt
/usr/share/doc/dovecot-1.0.7/wiki/PostLoginScripting.txt
/usr/share/doc/dovecot-1.0.7/wiki/QuickConfiguration.txt
/usr/share/doc/dovecot-1.0.7/wiki/Quota.Dict.txt
/usr/share/doc/dovecot-1.0.7/wiki/Quota.Dirsize.txt
/usr/share/doc/dovecot-1.0.7/wiki/Quota.FS.txt
/usr/share/doc/dovecot-1.0.7/wiki/Quota.Maildir.txt
/usr/share/doc/dovecot-1.0.7/wiki/Quota.txt
/usr/share/doc/dovecot-1.0.7/wiki/Rootless.txt
/usr/share/doc/dovecot-1.0.7/wiki/RunningDovecot.txt
/usr/share/doc/dovecot-1.0.7/wiki/SSL.CertificateClientImporting.txt
/usr/share/doc/dovecot-1.0.7/wiki/SSL.CertificateCreation.txt
/usr/share/doc/dovecot-1.0.7/wiki/SSL.DovecotConfiguration.txt
/usr/share/doc/dovecot-1.0.7/wiki/SSL.txt
/usr/share/doc/dovecot-1.0.7/wiki/Sasl.txt
/usr/share/doc/dovecot-1.0.7/wiki/SecurityTuning.txt
/usr/share/doc/dovecot-1.0.7/wiki/SharedMailboxes.txt
/usr/share/doc/dovecot-1.0.7/wiki/SystemUsers.txt
/usr/share/doc/dovecot-1.0.7/wiki/TestInstallation.txt
/usr/share/doc/dovecot-1.0.7/wiki/TestPop3Installation.txt
/usr/share/doc/dovecot-1.0.7/wiki/TimeMovedBackwards.txt
/usr/share/doc/dovecot-1.0.7/wiki/UpgradingDovecot.txt
/usr/share/doc/dovecot-1.0.7/wiki/UserDatabase.ExtraFields.txt
/usr/share/doc/dovecot-1.0.7/wiki/UserDatabase.Prefetch.txt
/usr/share/doc/dovecot-1.0.7/wiki/UserDatabase.Static.txt
/usr/share/doc/dovecot-1.0.7/wiki/UserDatabase.txt
/usr/share/doc/dovecot-1.0.7/wiki/UserIds.txt
/usr/share/doc/dovecot-1.0.7/wiki/Variables.txt
/usr/share/doc/dovecot-1.0.7/wiki/VirtualUsers.txt
/usr/share/doc/dovecot-1.0.7/wiki/WhyDoesItNotWork.txt
/usr/share/doc/dovecot-1.0.7/wiki/maildrop.txt
/usr/share/doc/dovecot-1.0.7/wiki/mutt.txt
/usr/share/doc/dovecot-1.0.7/wiki/uw2dovecot.sh.txt
/var/lib/dovecot
/var/run/dovecot
/var/run/dovecot/login
[root@linux220 ~]# vi /etc/dovecot.conf
[root@linux220 ~]# cat /etc/dovecot.conf | grep protocols
# Protocols we want to be serving: imap imaps pop3 pop3s
protocols = imap imaps pop3 pop3s
# SSL protocols to use
#ssl_protocols = !SSLv2 !SSLv3
[root@linux220 ~]# service sovecot restart
sovecot: unrecognized service
[root@linux220 ~]# service dovecot restart
Stopping Dovecot Imap:                                     [FAILED]
Starting Dovecot Imap:                                     [  OK  ]
[root@linux220 ~]# chkconfig dovecot on
[root@linux220 ~]# chkconfig --list dovecot
dovecot         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@linux220 ~]# mailx -v user01
Subject: test1
hello
.
Cc:
user01... Connecting to [127.0.0.1] via relay...
220 linux220.example.com ESMTP Sendmail 8.13.8/8.13.8; Mon, 9 May 2016 19:57:11 +0900
>>> EHLO linux220.example.com
250-linux220.example.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@linux220.example.com> SIZE=33 AUTH=root@linux220.example.com
250 2.1.0 <root@linux220.example.com>... Sender ok
>>> RCPT To:<user01@linux220.example.com>
>>> DATA
250 2.1.5 <user01@linux220.example.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 u49AvBq7006774 Message accepted for delivery
user01... Sent (u49AvBq7006774 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 linux220.example.com closing connection
[root@linux220 ~]# mailx -v user01
Subject: test2
hello
.
Cc:
user01... Connecting to [127.0.0.1] via relay...
220 linux220.example.com ESMTP Sendmail 8.13.8/8.13.8; Mon, 9 May 2016 19:57:48 +0900
>>> EHLO linux220.example.com
250-linux220.example.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@linux220.example.com> SIZE=33 AUTH=root@linux220.example.com
250 2.1.0 <root@linux220.example.com>... Sender ok
>>> RCPT To:<user01@linux220.example.com>
>>> DATA
250 2.1.5 <user01@linux220.example.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 u49Avmgg006780 Message accepted for delivery
user01... Sent (u49Avmgg006780 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 linux220.example.com closing connection
[root@linux220 ~]# mailx -v user01
Subject: test3
hello
.
Cc:
user01... Connecting to [127.0.0.1] via relay...
220 linux220.example.com ESMTP Sendmail 8.13.8/8.13.8; Mon, 9 May 2016 19:57:59 +0900
>>> EHLO linux220.example.com
250-linux220.example.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@linux220.example.com> SIZE=33 AUTH=root@linux220.example.com
250 2.1.0 <root@linux220.example.com>... Sender ok
>>> RCPT To:<user01@linux220.example.com>
>>> DATA
250 2.1.5 <user01@linux220.example.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 u49Avxhr006786 Message accepted for delivery
user01... Sent (u49Avxhr006786 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 linux220.example.com closing connection
[root@linux220 ~]#


[root@linux220 ~]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.
USER user01
+OK
PASS user01
+OK Logged in.
LIST
+OK 3 messages:
1 599
2 599
3 599
.
TOP 1 1
+OK
Return-Path: <root@linux220.example.com>
Received: from linux220.example.com (localhost.localdomain [127.0.0.1])
        by linux220.example.com (8.13.8/8.13.8) with ESMTP id u49AvBq7006774
        for <user01@linux220.example.com>; Mon, 9 May 2016 19:57:11 +0900
Received: (from root@localhost)
        by linux220.example.com (8.13.8/8.13.8/Submit) id u49AvBUn006773
        for user01; Mon, 9 May 2016 19:57:11 +0900
Date: Mon, 9 May 2016 19:57:11 +0900
From: root <root@linux220.example.com>
Message-Id: <201605091057.u49AvBUn006773@linux220.example.com>
To: user01@linux220.example.com
Subject: test1

hello
.
RETR 1
+OK 599 octets
Return-Path: <root@linux220.example.com>
Received: from linux220.example.com (localhost.localdomain [127.0.0.1])
        by linux220.example.com (8.13.8/8.13.8) with ESMTP id u49AvBq7006774
        for <user01@linux220.example.com>; Mon, 9 May 2016 19:57:11 +0900
Received: (from root@localhost)
        by linux220.example.com (8.13.8/8.13.8/Submit) id u49AvBUn006773
        for user01; Mon, 9 May 2016 19:57:11 +0900
Date: Mon, 9 May 2016 19:57:11 +0900
From: root <root@linux220.example.com>
Message-Id: <201605091057.u49AvBUn006773@linux220.example.com>
To: user01@linux220.example.com
Subject: test1

hello
.
DELE 1
+OK Marked to be deleted.
LIST
+OK 2 messages:
2 599
3 599
.
RETR 1
-ERR Message is deleted.
QUIT
+OK Logging out, messages deleted.
Connection closed by foreign host.
[root@linux220 ~]#


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\soldeskN>nslookup -q=MX naver.com
서버:    kns.kornet.net
Address:  168.126.63.1

권한 없는 응답:
naver.com       MX preference = 10, mail exchanger = mx3.naver.com
naver.com       MX preference = 10, mail exchanger = mx1.naver.com
naver.com       MX preference = 10, mail exchanger = mx4.naver.com

naver.com       nameserver = ns1.naver.com
naver.com       nameserver = ns2.naver.com
mx4.naver.com   internet address = 125.209.238.137
ns1.naver.com   internet address = 125.209.248.6
ns2.naver.com   internet address = 125.209.249.6

C:\Users\soldeskN>nslookup -q=MX google.com
서버:    kns.kornet.net
Address:  168.126.63.1

권한 없는 응답:
google.com      MX preference = 10, mail exchanger = aspmx.l.google.com
google.com      MX preference = 40, mail exchanger = alt3.aspmx.l.google.com
google.com      MX preference = 50, mail exchanger = alt4.aspmx.l.google.com
google.com      MX preference = 20, mail exchanger = alt1.aspmx.l.google.com
google.com      MX preference = 30, mail exchanger = alt2.aspmx.l.google.com

google.com      nameserver = ns2.google.com
google.com      nameserver = ns1.google.com
google.com      nameserver = ns4.google.com
google.com      nameserver = ns3.google.com
ASPMX.l.google.com      internet address = 64.233.188.26
ASPMX.l.google.com      AAAA IPv6 address = 2404:6800:4008:c01::1b
alt1.ASPMX.l.google.com internet address = 74.125.25.26
alt2.ASPMX.l.google.com internet address = 74.125.193.26
alt2.ASPMX.l.google.com AAAA IPv6 address = 2607:f8b0:4003:c17::1a
ALT3.ASPMX.l.google.com internet address = 173.194.219.27
ALT3.ASPMX.l.google.com AAAA IPv6 address = 2607:f8b0:4001:c05::1a
alt4.ASPMX.l.google.com internet address = 173.194.219.27
ns1.google.com  internet address = 216.239.32.10
ns2.google.com  internet address = 216.239.34.10
ns3.google.com  internet address = 216.239.36.10
ns4.google.com  internet address = 216.239.38.10

C:\Users\soldeskN>


[root@linux220 ~]# rpm -qa | grep sendmail
sendmail-8.13.8-10.el5_11
sendmail-cf-8.13.8-10.el5_11
[root@linux220 ~]# rpm -qli sendmail
Name        : sendmail                     Relocations: (not relocatable)
Version     : 8.13.8                            Vendor: CentOS
Release     : 10.el5_11                     Build Date: Mon 16 Mar 2015 05:44:07 PM KST
Install Date: Wed 27 Apr 2016 04:58:20 PM KST      Build Host: builder17.centos.org
Group       : System Environment/Daemons    Source RPM: sendmail-8.13.8-10.el5_11.src.rpm
Size        : 1372218                          License: Sendmail
Signature   : DSA/SHA1, Mon 16 Mar 2015 11:36:40 PM KST, Key ID a8a447dce8562897
Summary     : A widely used Mail Transport Agent (MTA).
Description :
The Sendmail program is a very widely used Mail Transport Agent (MTA).
MTAs send mail from one machine to another. Sendmail is not a client
program, which you use to read your email. Sendmail is a
behind-the-scenes program which actually moves your email over
networks or the Internet to where you want it to go.

If you ever need to reconfigure Sendmail, you will also need to have
the sendmail.cf package installed. If you need documentation on
Sendmail, you can install the sendmail-doc package.
/etc/aliases.db
/etc/mail
/etc/mail/Makefile
/etc/mail/access
/etc/mail/access.db
/etc/mail/domaintable
/etc/mail/domaintable.db
/etc/mail/helpfile
/etc/mail/local-host-names
/etc/mail/mailertable
/etc/mail/mailertable.db
/etc/mail/sendmail.cf
/etc/mail/sendmail.mc
/etc/mail/submit.cf
/etc/mail/submit.mc
/etc/mail/trusted-users
/etc/mail/virtusertable
/etc/mail/virtusertable.db
/etc/pam.d/smtp.sendmail
/etc/rc.d/init.d/sendmail
/etc/smrsh
/etc/sysconfig/sendmail
/usr/bin/hoststat
/usr/bin/mailq.sendmail
/usr/bin/makemap
/usr/bin/newaliases.sendmail
/usr/bin/purgestat
/usr/bin/rmail.sendmail
/usr/lib/sasl2/Sendmail.conf
/usr/lib/sendmail.sendmail
/usr/sbin/mailstats
/usr/sbin/makemap
/usr/sbin/praliases
/usr/sbin/sendmail.sendmail
/usr/sbin/smrsh
/usr/share/man/man1/mailq.sendmail.1.gz
/usr/share/man/man1/newaliases.sendmail.1.gz
/usr/share/man/man5/aliases.sendmail.5.gz
/usr/share/man/man8/mailstats.8.gz
/usr/share/man/man8/makemap.8.gz
/usr/share/man/man8/praliases.8.gz
/usr/share/man/man8/rmail.8.gz
/usr/share/man/man8/sendmail.sendmail.8.gz
/usr/share/man/man8/smrsh.8.gz
/var/log/mail
/var/log/mail/statistics
/var/spool/clientmqueue
/var/spool/mqueue
[root@linux220 ~]# rpm -ql sendmail-cf
/usr/share/sendmail-cf
/usr/share/sendmail-cf/README
/usr/share/sendmail-cf/cf
/usr/share/sendmail-cf/cf/Build
/usr/share/sendmail-cf/cf/Makefile
/usr/share/sendmail-cf/cf/README
/usr/share/sendmail-cf/cf/chez.cs.mc
/usr/share/sendmail-cf/cf/clientproto.mc
/usr/share/sendmail-cf/cf/cs-hpux10.mc
/usr/share/sendmail-cf/cf/cs-hpux9.mc
/usr/share/sendmail-cf/cf/cs-osf1.mc
/usr/share/sendmail-cf/cf/cs-solaris2.mc
/usr/share/sendmail-cf/cf/cs-sunos4.1.mc
/usr/share/sendmail-cf/cf/cs-ultrix4.mc
/usr/share/sendmail-cf/cf/cyrusproto.mc
/usr/share/sendmail-cf/cf/generic-bsd4.4.cf
/usr/share/sendmail-cf/cf/generic-bsd4.4.mc
/usr/share/sendmail-cf/cf/generic-hpux10.cf
/usr/share/sendmail-cf/cf/generic-hpux10.mc
/usr/share/sendmail-cf/cf/generic-hpux9.cf
/usr/share/sendmail-cf/cf/generic-hpux9.mc
/usr/share/sendmail-cf/cf/generic-linux.cf
/usr/share/sendmail-cf/cf/generic-linux.mc
/usr/share/sendmail-cf/cf/generic-mpeix.cf
/usr/share/sendmail-cf/cf/generic-mpeix.mc
/usr/share/sendmail-cf/cf/generic-nextstep3.3.cf
/usr/share/sendmail-cf/cf/generic-nextstep3.3.mc
/usr/share/sendmail-cf/cf/generic-osf1.cf
/usr/share/sendmail-cf/cf/generic-osf1.mc
/usr/share/sendmail-cf/cf/generic-solaris.cf
/usr/share/sendmail-cf/cf/generic-solaris.mc
/usr/share/sendmail-cf/cf/generic-sunos4.1.cf
/usr/share/sendmail-cf/cf/generic-sunos4.1.mc
/usr/share/sendmail-cf/cf/generic-ultrix4.cf
/usr/share/sendmail-cf/cf/generic-ultrix4.mc
/usr/share/sendmail-cf/cf/huginn.cs.mc
/usr/share/sendmail-cf/cf/knecht.mc
/usr/share/sendmail-cf/cf/mail.cs.mc
/usr/share/sendmail-cf/cf/mail.eecs.mc
/usr/share/sendmail-cf/cf/mailspool.cs.mc
/usr/share/sendmail-cf/cf/python.cs.mc
/usr/share/sendmail-cf/cf/s2k-osf1.mc
/usr/share/sendmail-cf/cf/s2k-ultrix4.mc
/usr/share/sendmail-cf/cf/submit.cf
/usr/share/sendmail-cf/cf/submit.mc
/usr/share/sendmail-cf/cf/tcpproto.mc
/usr/share/sendmail-cf/cf/ucbarpa.mc
/usr/share/sendmail-cf/cf/ucbvax.mc
/usr/share/sendmail-cf/cf/uucpproto.mc
/usr/share/sendmail-cf/cf/vangogh.cs.mc
/usr/share/sendmail-cf/domain
/usr/share/sendmail-cf/domain/Berkeley.EDU.m4
/usr/share/sendmail-cf/domain/CS.Berkeley.EDU.m4
/usr/share/sendmail-cf/domain/EECS.Berkeley.EDU.m4
/usr/share/sendmail-cf/domain/S2K.Berkeley.EDU.m4
/usr/share/sendmail-cf/domain/berkeley-only.m4
/usr/share/sendmail-cf/domain/generic.m4
/usr/share/sendmail-cf/feature
/usr/share/sendmail-cf/feature/accept_unqualified_senders.m4
/usr/share/sendmail-cf/feature/accept_unresolvable_domains.m4
/usr/share/sendmail-cf/feature/access_db.m4
/usr/share/sendmail-cf/feature/allmasquerade.m4
/usr/share/sendmail-cf/feature/always_add_domain.m4
/usr/share/sendmail-cf/feature/authinfo.m4
/usr/share/sendmail-cf/feature/bestmx_is_local.m4
/usr/share/sendmail-cf/feature/bitdomain.m4
/usr/share/sendmail-cf/feature/blacklist_recipients.m4
/usr/share/sendmail-cf/feature/compat_check.m4
/usr/share/sendmail-cf/feature/conncontrol.m4
/usr/share/sendmail-cf/feature/delay_checks.m4
/usr/share/sendmail-cf/feature/dnsbl.m4
/usr/share/sendmail-cf/feature/domaintable.m4
/usr/share/sendmail-cf/feature/enhdnsbl.m4
/usr/share/sendmail-cf/feature/generics_entire_domain.m4
/usr/share/sendmail-cf/feature/genericstable.m4
/usr/share/sendmail-cf/feature/greet_pause.m4
/usr/share/sendmail-cf/feature/ldap_routing.m4
/usr/share/sendmail-cf/feature/limited_masquerade.m4
/usr/share/sendmail-cf/feature/local_lmtp.m4
/usr/share/sendmail-cf/feature/local_no_masquerade.m4
/usr/share/sendmail-cf/feature/local_procmail.m4
/usr/share/sendmail-cf/feature/lookupdotdomain.m4
/usr/share/sendmail-cf/feature/loose_relay_check.m4
/usr/share/sendmail-cf/feature/mailertable.m4
/usr/share/sendmail-cf/feature/masquerade_entire_domain.m4
/usr/share/sendmail-cf/feature/masquerade_envelope.m4
/usr/share/sendmail-cf/feature/msp.m4
/usr/share/sendmail-cf/feature/mtamark.m4
/usr/share/sendmail-cf/feature/no_default_msa.m4
/usr/share/sendmail-cf/feature/nocanonify.m4
/usr/share/sendmail-cf/feature/notsticky.m4
/usr/share/sendmail-cf/feature/nouucp.m4
/usr/share/sendmail-cf/feature/nullclient.m4
/usr/share/sendmail-cf/feature/preserve_local_plus_detail.m4
/usr/share/sendmail-cf/feature/preserve_luser_host.m4
/usr/share/sendmail-cf/feature/promiscuous_relay.m4
/usr/share/sendmail-cf/feature/queuegroup.m4
/usr/share/sendmail-cf/feature/ratecontrol.m4
/usr/share/sendmail-cf/feature/redirect.m4
/usr/share/sendmail-cf/feature/relay_based_on_MX.m4
/usr/share/sendmail-cf/feature/relay_entire_domain.m4
/usr/share/sendmail-cf/feature/relay_hosts_only.m4
/usr/share/sendmail-cf/feature/relay_local_from.m4
/usr/share/sendmail-cf/feature/relay_mail_from.m4
/usr/share/sendmail-cf/feature/smrsh.m4
/usr/share/sendmail-cf/feature/stickyhost.m4
/usr/share/sendmail-cf/feature/use_client_ptr.m4
/usr/share/sendmail-cf/feature/use_ct_file.m4
/usr/share/sendmail-cf/feature/use_cw_file.m4
/usr/share/sendmail-cf/feature/uucpdomain.m4
/usr/share/sendmail-cf/feature/virtuser_entire_domain.m4
/usr/share/sendmail-cf/feature/virtusertable.m4
/usr/share/sendmail-cf/hack
/usr/share/sendmail-cf/hack/cssubdomain.m4
/usr/share/sendmail-cf/m4
/usr/share/sendmail-cf/m4/cf.m4
/usr/share/sendmail-cf/m4/cfhead.m4
/usr/share/sendmail-cf/m4/proto.m4
/usr/share/sendmail-cf/m4/version.m4
/usr/share/sendmail-cf/mailer
/usr/share/sendmail-cf/mailer/cyrus.m4
/usr/share/sendmail-cf/mailer/cyrusv2.m4
/usr/share/sendmail-cf/mailer/fax.m4
/usr/share/sendmail-cf/mailer/local.m4
/usr/share/sendmail-cf/mailer/mail11.m4
/usr/share/sendmail-cf/mailer/phquery.m4
/usr/share/sendmail-cf/mailer/pop.m4
/usr/share/sendmail-cf/mailer/procmail.m4
/usr/share/sendmail-cf/mailer/qpage.m4
/usr/share/sendmail-cf/mailer/smtp.m4
/usr/share/sendmail-cf/mailer/usenet.m4
/usr/share/sendmail-cf/mailer/uucp.m4
/usr/share/sendmail-cf/ostype
/usr/share/sendmail-cf/ostype/a-ux.m4
/usr/share/sendmail-cf/ostype/aix3.m4
/usr/share/sendmail-cf/ostype/aix4.m4
/usr/share/sendmail-cf/ostype/aix5.m4
/usr/share/sendmail-cf/ostype/altos.m4
/usr/share/sendmail-cf/ostype/amdahl-uts.m4
/usr/share/sendmail-cf/ostype/bsd4.3.m4
/usr/share/sendmail-cf/ostype/bsd4.4.m4
/usr/share/sendmail-cf/ostype/bsdi.m4
/usr/share/sendmail-cf/ostype/bsdi1.0.m4
/usr/share/sendmail-cf/ostype/bsdi2.0.m4
/usr/share/sendmail-cf/ostype/darwin.m4
/usr/share/sendmail-cf/ostype/dgux.m4
/usr/share/sendmail-cf/ostype/domainos.m4
/usr/share/sendmail-cf/ostype/dragonfly.m4
/usr/share/sendmail-cf/ostype/dynix3.2.m4
/usr/share/sendmail-cf/ostype/freebsd4.m4
/usr/share/sendmail-cf/ostype/freebsd5.m4
/usr/share/sendmail-cf/ostype/freebsd6.m4
/usr/share/sendmail-cf/ostype/gnu.m4
/usr/share/sendmail-cf/ostype/hpux10.m4
/usr/share/sendmail-cf/ostype/hpux11.m4
/usr/share/sendmail-cf/ostype/hpux9.m4
/usr/share/sendmail-cf/ostype/irix4.m4
/usr/share/sendmail-cf/ostype/irix5.m4
/usr/share/sendmail-cf/ostype/irix6.m4
/usr/share/sendmail-cf/ostype/isc4.1.m4
/usr/share/sendmail-cf/ostype/linux.m4
/usr/share/sendmail-cf/ostype/maxion.m4
/usr/share/sendmail-cf/ostype/mklinux.m4
/usr/share/sendmail-cf/ostype/mpeix.m4
/usr/share/sendmail-cf/ostype/nextstep.m4
/usr/share/sendmail-cf/ostype/openbsd.m4
/usr/share/sendmail-cf/ostype/osf1.m4
/usr/share/sendmail-cf/ostype/powerux.m4
/usr/share/sendmail-cf/ostype/ptx2.m4
/usr/share/sendmail-cf/ostype/qnx.m4
/usr/share/sendmail-cf/ostype/riscos4.5.m4
/usr/share/sendmail-cf/ostype/sco-uw-2.1.m4
/usr/share/sendmail-cf/ostype/sco3.2.m4
/usr/share/sendmail-cf/ostype/sinix.m4
/usr/share/sendmail-cf/ostype/solaris2.m4
/usr/share/sendmail-cf/ostype/solaris2.ml.m4
/usr/share/sendmail-cf/ostype/solaris2.pre5.m4
/usr/share/sendmail-cf/ostype/solaris8.m4
/usr/share/sendmail-cf/ostype/sunos3.5.m4
/usr/share/sendmail-cf/ostype/sunos4.1.m4
/usr/share/sendmail-cf/ostype/svr4.m4
/usr/share/sendmail-cf/ostype/ultrix4.m4
/usr/share/sendmail-cf/ostype/unicos.m4
/usr/share/sendmail-cf/ostype/unicosmk.m4
/usr/share/sendmail-cf/ostype/unicosmp.m4
/usr/share/sendmail-cf/ostype/unixware7.m4
/usr/share/sendmail-cf/ostype/unknown.m4
/usr/share/sendmail-cf/ostype/uxpds.m4
/usr/share/sendmail-cf/sendmail.schema
/usr/share/sendmail-cf/sh
/usr/share/sendmail-cf/sh/makeinfo.sh
/usr/share/sendmail-cf/siteconfig
/usr/share/sendmail-cf/siteconfig/uucp.cogsci.m4
/usr/share/sendmail-cf/siteconfig/uucp.old.arpa.m4
/usr/share/sendmail-cf/siteconfig/uucp.ucbarpa.m4
/usr/share/sendmail-cf/siteconfig/uucp.ucbvax.m4
[root@linux220 ~]#


[root@linux220 ~]# grep smtp /etc/services
smtp            25/tcp          mail
smtp            25/udp          mail
smtps           465/tcp                         # SMTP over SSL (TLS)
rsmtp           2390/tcp                        # RSMTP
rsmtp           2390/udp                        # RSMTP
[root@linux220 ~]# cd /etc/mail
[root@linux220 /etc/mail]# ls
access       domaintable.db    mailertable     sendmail.cf   submit.cf      virtusertable
access.db    helpfile          mailertable.db  sendmail.mc   submit.mc      virtusertable.db
domaintable  local-host-names  Makefile        spamassassin  trusted-users
[root@linux220 /etc/mail]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 linux220.example.com ESMTP Sendmail 8.13.8/8.13.8; Mon, 9 May 2016 20:18:52 +0900
quit
221 2.0.0 linux220.example.com closing connection
Connection closed by foreign host.
[root@linux220 /etc/mail]# vi /etc/resolv.conf
[root@linux220 /etc/mail]# cat /etc/resolv.conf
search linux220.example.com
nameserver 172.16.6.220
nameserver 172.16.9.252
nameserver 168.126.63.1
[root@linux220 /etc/mail]# ping 172.16.9.252
PING 172.16.9.252 (172.16.9.252) 56(84) bytes of data.
From 172.16.6.220 icmp_seq=1 Destination Host Unreachable
From 172.16.6.220 icmp_seq=2 Destination Host Unreachable
From 172.16.6.220 icmp_seq=3 Destination Host Unreachable
From 172.16.6.220 icmp_seq=5 Destination Host Unreachable
From 172.16.6.220 icmp_seq=6 Destination Host Unreachable
From 172.16.6.220 icmp_seq=7 Destination Host Unreachable

--- 172.16.9.252 ping statistics ---
8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 7000ms
, pipe 3
[root@linux220 /etc/mail]# ping 172.16.9.252
PING 172.16.9.252 (172.16.9.252) 56(84) bytes of data.
64 bytes from 172.16.9.252: icmp_seq=1 ttl=64 time=4.13 ms
64 bytes from 172.16.9.252: icmp_seq=2 ttl=64 time=0.893 ms
64 bytes from 172.16.9.252: icmp_seq=3 ttl=64 time=0.856 ms
64 bytes from 172.16.9.252: icmp_seq=4 ttl=64 time=0.946 ms
64 bytes from 172.16.9.252: icmp_seq=5 ttl=64 time=0.865 ms

--- 172.16.9.252 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.856/1.539/4.136/1.299 ms
[root@linux220 /etc/mail]# nslookup mail.linux220.example.com
Server:         172.16.6.220
Address:        172.16.6.220#53

Name:   mail.linux220.example.com
Address: 172.16.6.220

[root@linux220 /etc/mail]# nslookup -q=MX mail.linux220.example.com
Server:         172.16.6.220
Address:        172.16.6.220#53

*** Can't find mail.linux220.example.com: No answer

[root@linux220 /etc/mail]# nslookup -q=MX linux220.example.com
Server:         172.16.6.220
Address:        172.16.6.220#53

linux220.example.com    mail exchanger = 10 mail.linux220.example.com.

[root@linux220 /etc/mail]#


[root@linux220 /etc/mail]# ls
access       domaintable.db    mailertable     sendmail.cf   submit.cf      virtusertable
access.db    helpfile          mailertable.db  sendmail.mc   submit.mc      virtusertable.db
domaintable  local-host-names  Makefile        spamassassin  trusted-users
[root@linux220 /etc/mail]# vi sendmail.cf
[root@linux220 /etc/mail]# ls
access       domaintable.db    mailertable     sendmail.cf   submit.cf      virtusertable
access.db    helpfile          mailertable.db  sendmail.mc   submit.mc      virtusertable.db
domaintable  local-host-names  Makefile        spamassassin  trusted-users
[root@linux220 /etc/mail]# file access*
access:    ASCII English text
access.db: Berkeley DB (Hash, version 8, native byte-order)
[root@linux220 /etc/mail]# cat access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain           RELAY
Connect:localhost                       RELAY
Connect:127.0.0.1                       RELAY

[root@linux220 /etc/mail]#


[root@linux220 /etc/mail]# vi ~/.bashrc
[root@linux220 /etc/mail]# cat ~/.bashrc | tail -6
#
# Mail Alias
#
alias MAIL='cd /etc/mail'
alias sendmail.cf='vi /etc/mail/sendmail.cf'
alias mlog='tail -f /var/log/maillog'
[root@linux220 /etc/mail]# . ~/.bashrc


[root@linux220 /etc/mail]# ls
access       domaintable.db    mailertable     sendmail.cf   submit.cf      virtusertable
access.db    helpfile          mailertable.db  sendmail.mc   submit.mc      virtusertable.db
domaintable  local-host-names  Makefile        spamassassin  trusted-users
[root@linux220 /etc/mail]# vi sendmail.cf
[root@linux220 /etc/mail]# vi local-host-names
[root@linux220 /etc/mail]# cat local-host-names
# local-host-names - include all aliases for your machine here.
linux220.example.com
mail.linux220.example.com
[root@linux220 /etc/mail]# vi access
[root@linux220 /etc/mail]# cat access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain                           RELAY
Connect:localhost                                                       RELAY
Connect:127.0.0.1                                                       RELAY
Connect:mail.linux220.example.com                       RELAY
Connect:example.com                                                     RELAY
Connect:172.16.6                                                        RELAY
[root@linux220 /etc/mail]# makemap hash access < access
[root@linux220 /etc/mail]# ls -l /etc/mail/access*
-rw-r--r-- 1 root root 467 May  9 21:05 /etc/mail/access
-rw-r----- 1 root root 12K May  9 21:05 /etc/mail/access.db
[root@linux220 /etc/mail]# service sendmail restart
Shutting down sm-client:                                   [  OK  ]
Shutting down sendmail:                                    [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]
[root@linux220 /etc/mail]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 smtp-information; ESMTP Mon, 9 May 2016 21:09:05 +0900
quit
221 2.0.0 mail.linux220.example.com closing connection
Connection closed by foreign host.
[root@linux220 /etc/mail]# mailx user01
Subject: local test
hello
.
Cc:
[root@linux220 /etc/mail]# su - user01
[user01@linux220 ~]$ mailx
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/user01": 3 messages 1 new 3 unread
 U  1 root@linux220.exampl  Mon May  9 19:57  19/696   "test2"
 U  2 root@linux220.exampl  Mon May  9 19:57  18/662   "test3"
>N  3 root@linux220.exampl  Mon May  9 21:10  16/663   "local test"
& exit
[user01@linux220 ~]$ exit
logout

[root@linux220 /etc/mail]# mailx user01@example.com
Subject: test from linux220^[OF
hello  
.
Cc:
[root@linux220 /etc/mail]# su - user01
[user01@linux220 ~]$ mailx
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/user01": 3 messages 1 new 3 unread
 U  1 root@linux220.exampl  Mon May  9 19:57  19/696   "test2"
 U  2 root@linux220.exampl  Mon May  9 19:57  18/662   "test3"
>N  3 root@linux220.exampl  Mon May  9 21:10  16/663   "local test"
& exit
[user01@linux220 ~]$ exit
logout


[root@linux220 /etc/mail]# mailx linux221@example.com
Subject: test from linux220
hello
.
Cc:
[root@linux220 /etc/mail]# mailx user01@linux221.example.com
Subject: test from linux220
111
.
Cc:
[root@linux220 /etc/mail]# su - user01
[user01@linux220 ~]$ mailx
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/user01": 5 messages 3 new 5 unread
 U  1 root@linux220.exampl  Mon May  9 19:57  19/696   "test2"
 U  2 root@linux220.exampl  Mon May  9 19:57  18/662   "test3"
>N  3 root@linux220.exampl  Mon May  9 21:10  16/663   "local test"
 N  4 root@linux221.exampl  Mon May  9 21:16  19/902   "test from linux221"
 N  5 root@Linux219.exampl  Mon May  9 21:17  19/892   "test from linux219"
& exit
[user01@linux220 ~]$ exit
logout


[root@linux220 /etc/mail]# mailx user01@linux219.example.com
Subject: test from linux220
111
.
Cc:
[root@linux220 /etc/mail]# nslookup -q=MX linux221.example.com
Server:         172.16.6.220
Address:        172.16.6.220#53

Non-authoritative answer:
linux221.example.com    mail exchanger = 10 mail.liunx221.example.com.

Authoritative answers can be found from:
linux221.example.com    nameserver = ns1.linux221.example.com.

You have new mail in /var/spool/mail/root
[root@linux220 /etc/mail]# nslookup -q=MX linux219.example.com
Server:         172.16.6.220
Address:        172.16.6.220#53

Non-authoritative answer:
linux219.example.com    mail exchanger = 10 mail.linux219.example.com.

Authoritative answers can be found from:
linux219.example.com    nameserver = ns1.linux219.example.com.
mail.linux219.example.com       internet address = 172.16.6.219

[root@linux220 /etc/mail]# mailx
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/root": 8 messages 8 new
>N  1 logwatch@linux220.ex  Wed Apr 27 17:25 269/10396 "Logwatch for linux220.example.com (Linux)"
 N  2 logwatch@linux220.ex  Thu Apr 28 17:26 662/27461 "Logwatch for linux220.example.com (Linux)"
 N  3 logwatch@linux220.ex  Fri Apr 29 17:10 272/9283  "Logwatch for linux220.example.com (Linux)"
 N  4 logwatch@linux220.ex  Mon May  2 19:02  47/1841  "Logwatch for linux220.example.com (Linux)"
 N  5 logwatch@linux220.ex  Tue May  3 17:09 168/6958  "Logwatch for linux220.example.com (Linux)"
 N  6 logwatch@linux220.ex  Wed May  4 17:07 135/4887  "Logwatch for linux220.example.com (Linux)"
 N  7 logwatch@linux220.ex  Mon May  9 17:07  47/1841  "Logwatch for linux220.example.com (Linux)"
 N  8 MAILER-DAEMON@mail.l  Mon May  9 21:17  61/2353  "Returned mail: see transcript for details"
& 8
Message 8:
From MAILER-DAEMON@mail.linux220.example.com  Mon May  9 21:17:36 2016
Date: Mon, 9 May 2016 21:17:36 +0900
From: Mail Delivery Subsystem <MAILER-DAEMON@mail.linux220.example.com>
To: <root@linux220.example.com>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
        boundary="u49CHaVK007214.1462796256/mail.linux220.example.com"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--u49CHaVK007214.1462796256/mail.linux220.example.com

The original message was received at Mon, 9 May 2016 21:17:35 +0900
from localhost.localdomain [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<user01@linux221.example.com>

   ----- Transcript of session follows -----
550 5.1.2 <user01@linux221.example.com>... Host unknown (Name server: mail.liunx221.example.com.: host not found)

--u49CHaVK007214.1462796256/mail.linux220.example.com
Content-Type: message/delivery-status

Reporting-MTA: dns; mail.linux220.example.com
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Mon, 9 May 2016 21:17:35 +0900

Final-Recipient: RFC822; user01@linux221.example.com
Action: failed
Status: 5.1.2
Remote-MTA: DNS; mail.liunx221.example.com
Last-Attempt-Date: Mon, 9 May 2016 21:17:36 +0900

--u49CHaVK007214.1462796256/mail.linux220.example.com
Content-Type: message/rfc822

Return-Path: <root@linux220.example.com>
Received: from linux220.example.com (localhost.localdomain [127.0.0.1])
& q
Saved 1 message in mbox
Held 7 messages in /var/spool/mail/root
[root@linux220 /etc/mail]#

219 -> 220 (O)
219 <- 220 (O)
220 -> 221 (O)
221 <- 220 (X) 호스트를 찾을수가 없다고


[root@linux220 /etc/mail]# grep -n /etc/aliases /etc/mail/sendmail.cf
180:O AliasFile=/etc/aliases
[root@linux220 /etc/mail]# vi /etc/aliases
[root@linux220 /etc/mail]# vi /etc/aliases
[root@linux220 /etc/mail]# cat /etc/aliases | tail -4
#
# Local aliases below
#
mail01:         mail02
[root@linux220 /etc/mail]# newaliases
/etc/aliases: 77 aliases, longest 10 bytes, 777 bytes total
[root@linux220 /etc/mail]# ls -l /etc/aliases*
-rw-r--r-- 1 root root  1.6K May  9 21:49 /etc/aliases
-rw-r----- 1 root smmsp  12K May  9 21:49 /etc/aliases.db
[root@linux220 /etc/mail]# praliases | grep mail
mailnull:root
mail01:mail02
mailer-daemon:postmaster
mail:root
[root@linux220 /etc/mail]# useradd mail01
[root@linux220 /etc/mail]# passwd mail01
Changing password for user mail01.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@linux220 /etc/mail]# useradd mail02
[root@linux220 /etc/mail]# passwd mail02
Changing password for user mail02.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@linux220 /etc/mail]# grep mail /etc/passwd | tail -3
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
mail01:x:504:504::/home/mail01:/bin/bash
mail02:x:505:505::/home/mail02:/bin/bash
[root@linux220 /etc/mail]# grep mail /etc/passwd
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
mail01:x:504:504::/home/mail01:/bin/bash
mail02:x:505:505::/home/mail02:/bin/bash
[root@linux220 /etc/mail]# mailx mail01
Subject: mail fowarding test
hello
.
Cc:
[root@linux220 /etc/mail]# su - mail01
[mail01@linux220 ~]$ id
uid=504(mail01) gid=504(mail01) groups=504(mail01)
[mail01@linux220 ~]$ mailx
No mail for mail01
[mail01@linux220 ~]$ su - mail02
Password:
[mail02@linux220 ~]$ id
uid=505(mail02) gid=505(mail02) groups=505(mail02)
[mail02@linux220 ~]$ mailx
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/mail02": 1 message 1 new
>N  1 root@linux220.exampl  Mon May  9 21:52  16/672   "mail fowarding test"
& 1
Message 1:
From root@linux220.example.com  Mon May  9 21:52:00 2016
Date: Mon, 9 May 2016 21:52:00 +0900
From: root <root@linux220.example.com>
To: mail01@linux220.example.com
Subject: mail fowarding test

hello

& d a
& exit
[mail02@linux220 ~]$ exit
logout

[mail01@linux220 ~]$ exit
logout

[root@linux220 /etc/mail]#


[root@linux220 ~]# vi /etc/aliases
[root@linux220 ~]# cat /etc/aliases | tail -6
#
# Local aliases below
#
mail01:         mail02
teammain:team01,tema02,user01@emample.com
teamsub::include:/etc/mail/list/teamsub.list
[root@linux220 ~]# newaliases
/etc/aliases: 79 aliases, longest 36 bytes, 860 bytes total
[root@linux220 ~]# praliases | grep team
teammain:team01,tema02,user01@emample.com
teamsub::include:/etc/mail/list/teamsub.list
[root@linux220 ~]# useradd team01
[root@linux220 ~]# passwd team01
Changing password for user team01.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@linux220 ~]# useradd team02
[root@linux220 ~]# passwd team02
Changing password for user team02.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@linux220 ~]# mailx teammain
Subject: mailing test
hello
.
Cc:
[root@linux220 ~]# mail -u team01
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/team01": 1 message 1 new
>N  1 root@linux220.exampl  Mon May  9 21:57  16/671   "mailing test"
& 1
Message 1:
From root@linux220.example.com  Mon May  9 21:57:13 2016
Date: Mon, 9 May 2016 21:57:08 +0900
From: root <root@linux220.example.com>
To: teammain@linux220.example.com
Subject: mailing test

hello

& d a
& exit
[root@linux220 ~]# mail -u team02
No mail for team02
[root@linux220 ~]# mailx
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N  1 MAILER-DAEMON@mail.l  Mon May  9 21:57  76/2830  "Returned mail: see transcript for details"
& d a
& exit
[root@linux220 ~]# vi /etc/aliases
You have mail in /var/spool/mail/root
[root@linux220 ~]# cat /etc/aliases | tail -6
#
# Local aliases below
#
mail01:         mail02
teammain:team01,team02,user01@emample.com
teamsub::include:/etc/mail/list/teamsub.list
[root@linux220 ~]# praliases
postmaster:root
daemon:root
adm:root
lp:root
shutdown:root
operator:root
ftp:root
radiusd:root
dbus:root
nscd:root
pcap:root
apache:root
dovecot:root
quagga:root
amanda:root
ident:root
gdm:root
mailnull:root
sshd:root
smmsp:root
squid:root
ntp:root
mysql:root
desktop:root
rpcuser:root
nfsnobody:root
ingres:root
toor:root
abuse:root
newsadmin:news
usenet:news
ftpadm:ftp
ftp-admin:ftp
webmaster:root
noc:root
security:root
hostmaster:root
info:postmaster
marketing:postmaster
sales:postmaster
decode:root
mail01:mail02
teammain:team01,tema02,user01@emample.com
@:@
mailer-daemon:postmaster
bin:root
sync:root
halt:root
mail:root
news:root
uucp:root
games:root
gopher:root
nobody:root
nut:root
vcsa:root
canna:root
wnn:root
rpm:root
webalizer:root
fax:root
radvd:root
pvm:root
privoxy:root
named:root
xfs:root
postgres:root
postfix:root
netdump:root
ldap:root
rpc:root
system:root
manager:root
dumper:root
newsadm:news
ftpadmin:ftp
ftp-adm:ftp
www:webmaster
support:postmaster
teamsub::include:/etc/mail/list/teamsub.list
[root@linux220 ~]# newaliases
/etc/aliases: 79 aliases, longest 36 bytes, 860 bytes total
[root@linux220 ~]# praliases | grep team
teammain:team01,team02,user01@emample.com
teamsub::include:/etc/mail/list/teamsub.list
[root@linux220 ~]# mail -u team02
No mail for team02
[root@linux220 ~]# mailx teammain
Subject: mailing test
hello
.
Cc:
[root@linux220 ~]# mail -u team01
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/team01": 2 messages 2 new
>N  1 root@linux220.exampl  Mon May  9 21:57  16/671   "mailing test"
 N  2 root@linux220.exampl  Mon May  9 21:59  16/671   "mailing test"
& d all
No applicable messages from {all}
& d a
& exit
You have new mail in /var/spool/mail/root
[root@linux220 ~]# mail -u team01
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/team01": 2 messages 2 new
>N  1 root@linux220.exampl  Mon May  9 21:57  16/671   "mailing test"
 N  2 root@linux220.exampl  Mon May  9 21:59  16/671   "mailing test"
& 1
Message 1:
From root@linux220.example.com  Mon May  9 21:57:13 2016
Date: Mon, 9 May 2016 21:57:08 +0900
From: root <root@linux220.example.com>
To: teammain@linux220.example.com
Subject: mailing test

hello

& d 1
& d 2
& exit
[root@linux220 ~]# mail -u team02
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/team02": 1 message 1 new
>N  1 root@linux220.exampl  Mon May  9 21:59  16/671   "mailing test"
& 1
Message 1:
From root@linux220.example.com  Mon May  9 21:59:05 2016
Date: Mon, 9 May 2016 21:59:05 +0900
From: root <root@linux220.example.com>
To: teammain@linux220.example.com
Subject: mailing test

hello

& d 1
& exit
[root@linux220 ~]#


[root@linux220 ~]# mkdir /etc/mail/list
[root@linux220 ~]# vi /etc/mail/list/teamsub.list
[root@linux220 ~]# cat /etc/passwd | awk -F: '{print $1}'
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
gopher
ftp
nobody
distcache
nscd
vcsa
apache
rpc
mailnull
smmsp
webalizer
dovecot
squid
pcap
ntp
dbus
avahi
rpcuser
nfsnobody
named
hsqldb
sshd
haldaemon
avahi-autoipd
xfs
gdm
sabayon
fedora
tomcat
user01
user02
user03
ftpupload
mail01
mail02
team01
team02
[root@linux220 ~]# cat /etc/passwd | awk -F: '$3 > 499 && $3 < 60000 {print $1}'
fedora
user01
user02
user03
mail01
mail02
team01
team02
[root@linux220 ~]# cat /etc/passwd | awk -F: '$3 > 499 && $3 < 60000 {print $1}' > /etc/mail/list/teamsub.list
[root@linux220 ~]# cat /etc/mail/list/teamsub.list
fedora
user01
user02
user03
mail01
mail02
team01
team02
[root@linux220 ~]# mailx teamsub
Subject: mailing test
hello
.
Cc:
[root@linux220 ~]# mail -u team01
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/team01": 1 message 1 new
>N  1 root@linux220.exampl  Mon May  9 22:06  16/668   "mailing test"
& q
Held 1 message in /var/mail/team01
[root@linux220 ~]# mail -u team02
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/team02": 1 message 1 new
>N  1 root@linux220.exampl  Mon May  9 22:06  16/668   "mailing test"
& q
Held 1 message in /var/mail/team02
[root@linux220 ~]#


그림10
그림11
그림12
그림13
그림14















Posted by 22Hz
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함