วันเสาร์ที่ 17 พฤศจิกายน พ.ศ. 2555

Update Server Nod32

สำหรับ Version 5 อัพเดทที่เซิฟเวอร์ http://nod32.coolz-server.com/v5/

สำหรับ Version 3 และ 4 อัพเดทที่เซิฟเวอร์ http://nod32.coolz-server.com/

สำหรับ Version 2 อัพเดทที่เซิฟเวอร์ http://nod32.coolz-server.com/v2/

วิธี Update Server ทำตามขั้นตอนดังนี้

วันศุกร์ที่ 27 กรกฎาคม พ.ศ. 2555

block เว็บเป็นเวลาทำยังงัย ก็แก้ ไฟล์ vi /etc/squid/squid.conf

block เว็บเป็นเวลาทำยังงัย ก็แก้ ไฟล์ vi /etc/squid/squid.conf

# ---- ACL CONTROLSacl all src 0.0.0.0/0.0.0.0
acl daytime time M T W H F 08:30-16:00
acl 2blockweb url_regex -i "/etc/squid/key.txt"
acl 2download url_regex -i "/etc/squid/download.txt"
http_access deny 2blockweb daytime
http_access deny 2download daytime
deny_info http://www.google.com 2blockweb daytime
deny_info http://www.google.com 2download daytime


สรุปว่า block ตั้งแต่ เวลา 08.30-16.00 วันจันทร์ - ศุกร์ส่วนเวลาที่เหลือก็ปล่อยตามสบาย

คำสั่งที่ทำให้ logrotate ทำงาน


คำสั่งที่ทำให้ logrotate ทำงาน


[root@proxy1 ~]# logrotate -f /etc/logrotate.conf

คำสั่ง Check Server ว่าเปิดใช้งานมานานเท่าไร

คำสั่ง  Check Server ว่าเปิดใช้งานมานานเท่าไร


[root@proxy1 ~]# uptime
 17:22:24 up 16:20,  3 users,  load average: 0.10, 0.04, 0.01

วันอังคารที่ 5 มิถุนายน พ.ศ. 2555

วันอาทิตย์ที่ 29 เมษายน พ.ศ. 2555

Repair ClearOS 5.0

ได้แล้วครับ
เราใช้คำสั่ง
fdisk -l >>> เพื่อดู file system ก่อนครับ ว่าต้องการ ซ่อมแซม ส่วนใหน
fsck /dev/dha? -y >>> ตามด้วย partitions ครับ

ใช่ไม่ใช่ยังงัยก็ขอคำแนะนำด้วยครับ ขอบคุณครับ

วันจันทร์ที่ 16 มกราคม พ.ศ. 2555

secure shell server ช้ามาก

เคยประสบปัญหาในการล็อกอินด้วย secure shell ไปยังเครื่องปลายทางช้าหรือไม่ กว่าที่จะขึ้นให้ใส่ password โดยที่เครื่องปลายทาง (secure shell server) ดูแล้วปกติไม่ได้ทำงานหนักอะไร โหลดของเครื่องก็เป็น 0.00




ตรวจสอบโหลดบนเครื่องปลายทาง ด้วยคำสั่ง uptime



[root@ssh-server ~]# uptime

16:02:28 up 1:21, 1 user, load average: 0.00, 0.00, 0.00

บทความนี้จะเสนอการแก้ไขคอนฟิกของ sshd ซึ่งทำหน้าที่เป็น secure shell server โดยตัวอย่างทดสอบ ssh จากเครื่องชื่อ ssh-client ไปยังเครื่องปลายทางชื่อ ssh-server (192.168.1.1)







1. ปิดการตรวจสอบสิทธิแบบ GSSAPI

เริ่มต้นทดสอบใช้คำสั่ง ssh จากเครื่องไคลเอนต์ด้วยออปชั่น -v เพื่อดูรายละเอียดขั้นตอนในการล็อกอินด้วย secure shell ไปยังเครื่องปลายทาง ถ้าสังเกตดูหน้าจอจะค้างตรงบรรทัด



...

debug1: Next authentication method: gssapi-with-mic

ช่วงที่หน้าจอค้าง จะเป็นขั้นตอนการตรวจสอบสิทธิ (user authentication) แบบ GSSAPI ซึ่งถ้าเราไม่ได้ใช้งาน หรือคอนฟิกไว้ สามารถเปลี่ยนคอนฟิกของ sshd เพื่อปิดการตรวจสอบสิทธิแบบนี้ออกไป



[user1@ssh-client ~]$ ssh -v 192.168.1.1 OpenSSH_5.1p1, OpenSSL 0.9.8g 19 Oct 2007

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Applying options for *

debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.

debug1: Connection established.

debug1: identity file /home/user1/.ssh/identity type -1

debug1: identity file /home/user1/.ssh/id_rsa type -1

debug1: identity file /home/user1/.ssh/id_dsa type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1

debug1: match: OpenSSH_5.1 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.1

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: server->client aes128-cbc hmac-md5 none

debug1: kex: client->server aes128-cbc hmac-md5 none

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug1: Host ''192.168.1.1'' is known and matches the RSA host key.

debug1: Found key in /home/user1/.ssh/known_hosts:2

debug1: ssh_rsa_verify: signature correct

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: SSH2_MSG_SERVICE_REQUEST sent

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,gssapi-with-mic,password

debug1: Next authentication method: gssapi-with-mic

debug1: Unspecified GSS failure. Minor code may provide more information

No credentials cache found

debug1: Unspecified GSS failure. Minor code may provide more information

No credentials cache found

debug1: Unspecified GSS failure. Minor code may provide more information

debug1: Next authentication method: publickey

debug1: Trying private key: /home/user1/.ssh/identity

debug1: Trying private key: /home/user1/.ssh/id_rsa

debug1: Trying private key: /home/user1/.ssh/id_dsa

debug1: Next authentication method: password

user1@192.168.1.1''s password:

debug1: Authentication succeeded (password).

debug1: channel 0: new [client-session]

debug1: Requesting no-more-sessions@openssh.com

debug1: Entering interactive session.

debug1: Sending environment.

debug1: Sending env LANG = en_US.UTF-8

[user1@ssh-server ~]$

แก้ไขคอนฟิกของ ssh-server โดยแก้ออปชั่นของ GSSAPI ดังนี้



[root@ssh-server ssh]# cat /etc/ssh/sshd_config ...

# GSSAPI options

GSSAPIAuthentication no GSSAPICleanupCredentials no ...

หลังจากแก้ไข ใช้คำสั่ง service เพื่อรีโหลด secure sshd ใหม่อีกครั้ง เพื่อให้คอนฟิกใหม่มีผล



[root@ssh-server ssh]# service sshd restart Stopping sshd: [ OK ]

Starting sshd: [ OK ]

[root@ssh-server ssh]#

ทดสอบการ ssh อีกครั้งหลังจากปิดคุณสมบัติ GSSAPI บนเซิร์ฟเวอร์ จะเห็นว่าเร็วขึ้นมาก ไม่มีบรรทัดที่เกี่ยวข้องกับ GSSAPI ขึ้นมาอีก



[user1@ssh-client ~]$ ssh -v 192.168.1.1 OpenSSH_5.1p1, OpenSSL 0.9.8g 19 Oct 2007

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Applying options for *

debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.

debug1: Connection established.

debug1: identity file /home/user1/.ssh/identity type -1

debug1: identity file /home/user1/.ssh/id_rsa type -1

debug1: identity file /home/user1/.ssh/id_dsa type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1

debug1: match: OpenSSH_5.1 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.1

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: server->client aes128-cbc hmac-md5 none

debug1: kex: client->server aes128-cbc hmac-md5 none

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug1: Host ''192.168.1.1'' is known and matches the RSA host key.

debug1: Found key in /home/user1/.ssh/known_hosts:2

debug1: ssh_rsa_verify: signature correct

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: SSH2_MSG_SERVICE_REQUEST sent

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,password

debug1: Next authentication method: publickey

debug1: Trying private key: /home/user1/.ssh/identity

debug1: Trying private key: /home/user1/.ssh/id_rsa

debug1: Trying private key: /home/user1/.ssh/id_dsa

debug1: Next authentication method: password

user1@192.168.1.1''s password:

[user1@ssh-client ~]$



2. ปิดการตรวจสอบชื่อ hostname กับ DNS (reverse hostname lookup)



ดีฟอลต์คอนฟิกของ sshd ที่ติดตั้งกับ Fedora เมื่อมีการล็อกอินเข้ามา เซิร์ฟเวอร์จะพยายามแปลง IP Address ของไคลเอนต์ที่เข้ามาเป็นชื่อ hostname โดยไปถามจาก DNS Server (reverse hostname lookup)



ถ้าเครื่อง ssh-server ไม่สามารถติดต่อกับ DNS Server หรือ ไม่มีข้อมูล IP Address ของเครื่องไคลเอนต์อยู่ใน DNS Server ที่คอนฟิกไว้ การล็อกอินจะค้างไปซักพักตรงบรรทัด

...

debug1: SSH2_MSG_SERVICE_ACCEPT received

ตัวอย่างการล็อกอิน

[user1@ssh-client ~]$ ssh -v 192.168.1.1 OpenSSH_5.1p1, OpenSSL 0.9.8g 19 Oct 2007

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Applying options for *

debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.

debug1: Connection established.

debug1: identity file /home/user1/.ssh/identity type -1

debug1: identity file /home/user1/.ssh/id_rsa type -1

debug1: identity file /home/user1/.ssh/id_dsa type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1

debug1: match: OpenSSH_5.1 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.1

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: server->client aes128-cbc hmac-md5 none

debug1: kex: client->server aes128-cbc hmac-md5 none

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug1: Host ''192.168.1.1'' is known and matches the RSA host key.

debug1: Found key in /home/user1/.ssh/known_hosts:2

debug1: ssh_rsa_verify: signature correct

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: SSH2_MSG_SERVICE_REQUEST sent

debug1: SSH2_MSG_SERVICE_ACCEPT received

สามารถแก้ไขปัญหานี้ด้วยการปิดคุณสมบัติการตรวจสอบชื่อ hostname จาก IP Address ของไคลเอนต์ โดยแก้ออปชั่นของ UseDNS ให้เป็นค่า no ดังนี้

[root@ssh-server ssh]# cat /etc/ssh/sshd_config ...

UseDNS no ...

หลังจากแก้ไข ใช้คำสั่ง service เพื่อรีโหลด sshd ใหม่อีกครั้ง เพื่อให้คอนฟิกใหม่มีผล

[root@ssh-server ssh]# service sshd restart Stopping sshd: [ OK ]

Starting sshd: [ OK ]

[root@ssh-server ssh]#



ที่มา : http://bunyiam.com/?name=knowledge&file=readknowledge&id=1511