2016년 4월 6일 수요일

파일질라 FTP 서버 구성

http://rootblog.tistory.com/10

2016년 3월 14일 월요일

NTP 서버 설정

출처 : http://mrain7.egloos.com/2809854

Ntp 서버를이용한 윈도우 <-> 리눅스간의 시간 동기화.

테스트 환경.
-      Server : Windows 2008 R2
IP : 211.241.161.200
서비스 : Windows 2008 에서 기본적으로 제공하는 NTP service

-      Client : CentOS 5.5 64bit
IP : 10.1.2.205
서비스 : CentOS 5.5에서 기본적으로 제공하는 ntpd

비고 : server CentOS 둘다 ntp 서비스를 이용한 자동 동기화를 생각했으나 상호간에 통신은 가능하고 NTP 관련 패킷이 전송 되는 것 까지 확인했으나 시간이 동기화 하지 않는 문제가 발생하여 Crond를 이용한 동기화










1)    Windows 설정.
시작 -> 실행 -> regedit
HKLM/SYSTEM/CurrentControlSet/Services/W32Time/Parameters
LocalNTP : REG_DWORD : 1
SNTP 서버를 항상 실행.
해당 레지스트리 파일이 없을 경우 마우스 우클릭 -> 새로 만들기 -> DWORD


           HKLM/SYSTEM/CurrentControlSet/Services/W32Time/Config
AnnounceFlags : REG_DWORD :5
기본값은 a이며  값을 5 바꿀 경우 해당 서버가 신뢰할  있는 시간서버로 설정된다.



HKLM/SYSTEM/CurrentControlSet/Services/W32Time/TimeProviders/NtpServer
Enabled : REG_DWORD : 1
NTP server 활성화.

이후 방화벽을 사용할 경우 UTP 123port 확인하고 열어  .

W32time service 재시작.
시작 -> 실행 -> cmd
-       net stop w32time
-       net start w32time


2)      Linux 에서 확인  cron 설정.
Sync 확인.
[root@localhost~]# ntpdate 211.241.161.200
18 Jul 15:03:22ntpdate[29757]: adjust time server 211.241.161.200 offset -0.068003 sec

Date 확인.
[root@localhost ~]# date
Mon Jul 18 14:48:35 KST 2011

Cron 설정.
[root@localhost sbin]# crontab –e
0 12 * * * /usr/sbin/ntpdate [ntp serverip]
[root@localhost ~]# service crond restart
Stopping crond:                                           [  OK  ]
Starting crond:                                           [  OK  ]



3)    추가
-      Windows 간 동기화.
-       HKLM/SYSTEM/CurrentControlSet/Services/W32Time/TimeProviders/NtpClient
Enabled : DWORD : 1
Client service 시작.
-       HKLM/SYSTEM/CurrentControlSet/Services/W32Time/TimeProviders/NtpClient
SpecialPollInterval: REG_DWORD : 86400(10진수)
시간 동기화 주기 (초단위 86400  경우 하루 단위)








-       Linux동기화
/etc/ntp.conf 수정.

#Permit time synchronization with our time source, but do not
#permit the source to query or modify the service on this system.

restrictdefault nomodify notrap noquery
#restrictdefault kod nomodify notrap nopeer noquery
#restrict-6 default kod nomodify notrap nopeer noquery

#Permit all access over the loopback interface. This could
#be tightened as well, but to do so would effect some of
#the administrative functions.
restrict127.0.0.1
#restrict-6 ::1

#Hosts on local network are less restricted.
restrict211.241.161.0 mask 255.255.255.0 nomodify notrap noquery
#restrict192.168.1.0 mask 255.255.255.0 nomodify notrap

#Use public servers from the pool.ntp.org project.
#Please consider joining the pool (http://www.pool.ntp.org/join.html).

server211.241.161.200

#server0.centos.pool.ntp.org
#server1.centos.pool.ntp.org
#server2.centos.pool.ntp.org

#broadcast192.168.1.255 key 42         # broadcastserver
#broadcastclient                        # broadcast client
#broadcast224.0.1.1 key 42             # multicastserver
#multicastclient224.0.1.1              # multicast client
#manycastserver239.255.254.254         # manycast server
#manycastclient239.255.254.254 key 42  # manycast client

#Undisciplined Local Clock. This is a fake driver intended for backup
#and when no outside source of synchronized time is available.
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

#Drift file.  Put this in a directorywhich the daemon can write to.
#No symbolic links allowed, either, since the daemon updates the file
#by creating a temporary in the same directory and then rename()'ing
#it to the file.

driftfile/var/lib/ntp/drift
driftfile/etc/ntpd.drift

#Key file containing the keys and key identifiers used when operating
#with symmetric key cryptography.
keys/etc/ntp/keys

#Specify the key identifiers which are trusted.
#trustedkey4 8 42

#Specify the key identifier to use with the ntpdc utility.
#requestkey8

#Specify the key identifier to use with the ntpq utility.
#controlkey8

붉은색 부분 수정
restrictdefault nomodify notrap noquery
기본으로모든 권한을 주지는 않음을 의미한다.
restrict127.0.0.1
서버자신에 대해서는 모든 권한을 가진다.
. restrict 211.241.161.0 mask255.255.255.0 nomodify notrap noquery
의경우 server에서 해당 대역대 내의 장비들에 대해 ntp통신을허가하겠다는 의미.
server211.241.161.200
동기화할 대상 서버.



확인.
[root@localhost ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 61.110.197.50   133.100.9.2      2 u   60   64    1    6.606  19649.3   0.001
 maths.kaist.ac. 133.100.9.2      2 u   59   64    1    9.258  19646.7   0.001
118.219.234.251 216.171.124.36   2 u   58   64    1    5.311  19639.3   0.001

Refid 에 정상적인 ip가 나온다면 해당 서버로부터 정상적으로 동기화되고 있다는 의미다.

*)주의 할 점.
Ntpd 서비스가 올라가 있을 경우위에서 사용한 ntpdate 사용시 오류가 발생한다.
따라서 ntpd 또는 ntpdate를 동시에 사용 하는 것은 자제하도록 한다.


참조 

2016년 1월 11일 월요일

ubuntu usb disk

출처 : http://vulpecula.tistory.com/24

1. disk 정보 확인
sudo fdisk -l

-> disk 정보 출력

Disk /dev/sdb: 2000.4 GB, 2000398933504 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029167 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disk identifier: 0x08188266

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3907024895  1953511424    7  HPFS/NTFS/exFAT

위는 2기가 NTFS 디스크임

2. 마운트 포인트 생성
sudo mkdir /media/extusb

3. usb disk 마운트
sudo mount -t ntfs-3g /dev/sdb1 /media/extusb

FAT 라면
sudo mount -t vfat /dev/sdb1 /media/extusb

usb disk에 한글이 깨져서 나오면 다음의 옵션 추가
sudo mount -t vfat /dev/sdb1 /media/extusb -o utf8

4. 언마운트
sudo umount /dev/sdb1

또는
sudo umount /media/extusb