<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CentOS</title>
	<atom:link href="http://centosvn.com/feed" rel="self" type="application/rss+xml" />
	<link>http://centosvn.com</link>
	<description>The Comunity ENTerprise Operating System</description>
	<lastBuildDate>Mon, 29 Aug 2011 06:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Adding a new hard drive in CentOS</title>
		<link>http://centosvn.com/tutorials/adding-a-new-hard-drive-in-centos.aspx</link>
		<comments>http://centosvn.com/tutorials/adding-a-new-hard-drive-in-centos.aspx#comments</comments>
		<pubDate>Mon, 29 Aug 2011 06:17:50 +0000</pubDate>
		<dc:creator>centosvn.com</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://centosvn.com/?p=12</guid>
		<description><![CDATA[Cách thêm HDD trong linux. There comes a time in every linux guys life that you are out of space.  You add a new hard drive but this isn’t Windows and doesn’t automatically show up; especially if you’re in a [&#8230;]]]></description>
			<content:encoded><![CDATA[<h4>Cách thêm HDD trong linux.</h4>
<p>There comes a time in every linux guys life that you are out of space.  You add a new hard drive but this isn’t Windows and doesn’t automatically show up; especially if you’re in a server environment with nothing but a command line.</p>
<p>*** NOTE : All commands must be from <strong>root</strong> user.  Also, this is assuming you are just making one big partition from the whole hard drive and does not account for separating partitions of specified sizes ***</p>
<p>First, lets get a list of all physical drives connected:</p>
<blockquote>
<pre># fdisk -l
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1044     8281507+  8e  Linux LVM

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table</pre>
</blockquote>
<p>You can see that /dev/sdb is connected but doesn’t contain any kind of a partition what-so-ever and you need *a* partition obviously.  Lets go ahead and start to format the disk, /dev/sdb and pull up the menu.</p>
<blockquote>
<pre># fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)</pre>
</blockquote>
<p>Now, lets go ahead and <strong>Press N</strong> for a new partition and just write with all defaults.  We will use a <strong>Primary Partition</strong> and make it <strong>Partition 1</strong>.</p>
<blockquote><p>Command (m for help): n<br />
Command action<br />
e extended<br />
p primary partition (1-4)<br />
p<br />
Partition number (1-4): 1<br />
First cylinder (1-261, default 1):<br />
Using default value 1<br />
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):<br />
Using default value 261</p></blockquote>
<p>Now, lets go ahead and write these changes to the secondary disk (/dev/sdb) with the “w” command.</p>
<blockquote><p>Command (m for help): w<br />
The partition table has been altered!<br />
Calling ioctl() to re-read partition table.<br />
Syncing disks.</p></blockquote>
<p>Ok, now we have the disk ready but still no file system.  This is when <strong>mkfs</strong> comes in and we will want to specify the type which will be <strong>ext3</strong> and will use the first (and only) partition on the secondary disk (<strong>/dev/sdb1</strong>).</p>
<blockquote>
<pre># mkfs -t ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
262144 inodes, 524112 blocks
26205 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.</pre>
</blockquote>
<p>Great!  We are almost there.  All we need to do now is mount it.  <strong>You do have to create a target folder before you can mount to it</strong>.  Lets go ahead and create the target folder (<strong>mkdir /drive2</strong>) and mount it (<strong>mount -t ext3 /dev/sdb1 /drive2</strong>).  Then, we will get the amount of disk space free to make sure it is mounted at the right place and reads the correct amount of space for the partition.  For this example I am only using a 2GB virtual disk (<strong>df -h</strong>).</p>
<blockquote>
<pre># mount -t ext3 /dev/sdb1 /drive2
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.7G  1.4G  4.1G  26% /
/dev/sda1              99M   18M   76M  20% /boot
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sdb1             2.0G   36M  1.9G   2% /drive2</pre>
</blockquote>
<p>You can now see that we are successful in adding the new hard drive, adding a partition, formatting it with ext3 file system, and then mounting it to mount point /drive2.</p>
]]></content:encoded>
			<wfw:commentRss>http://centosvn.com/tutorials/adding-a-new-hard-drive-in-centos.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Khắc phục sự cố máy chủ Linux bằng telnet</title>
		<link>http://centosvn.com/featured/khac-phuc-su-co-may-chu-linux-bang-telnet.aspx</link>
		<comments>http://centosvn.com/featured/khac-phuc-su-co-may-chu-linux-bang-telnet.aspx#comments</comments>
		<pubDate>Sun, 14 Aug 2011 16:47:02 +0000</pubDate>
		<dc:creator>centosvn.com</dc:creator>
				<category><![CDATA[Bảo Mật]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Giải Pháp]]></category>
		<category><![CDATA[LAN - WAN]]></category>
		<category><![CDATA[Linux - Unix]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Ứng Dụng]]></category>

		<guid isPermaLink="false">http://centosvn.com/?p=1</guid>
		<description><![CDATA[Telnet vẫn là một công cụ hữu dụng trong tập các công cụ quản trị máy chủ. Chính vì tính chất quan trọng và hữu dụng của nó mà chúng tôi muốn giới thiệu cho các bạn cách test các [&#8230;]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong>Telnet vẫn là một công cụ hữu dụng trong tập các công cụ quản trị máy chủ. Chính vì tính chất quan trọng và hữu dụng của nó mà chúng tôi muốn giới thiệu cho các bạn cách test các chức năng cơ bản của máy chủ SMTP, IMAP, HTTP và IRC thông qua telnet.</strong></p>
<p style="text-align: justify;">Telnet là một giao thức mạng chạy trên TCP/IP, cho phép máy khách có thể truyền thông với máy chủ từ xa. Trước đây telnet hay được sử dụng để kết nối với máy tính ở xa để thực hiện việc quản trị máy chủ, kiểm tra email và chạy ứng dụng. Ngày nay tuy ssh được mặc định thực hiện công việc này vì một số lý do bảo mật, nhưng telnet vẫn có những ưu việt riêng của nó. Do telnet truyền tải tất cả dữ liệu nên bạn có thể sử dụng nó để mở một TCP session, sau đó truyền thông với máy chủ đang chạy dịch vụ mạng và thực hiện gỡ rối. Tối thiểu, telnet đến một cổng nào đó trên máy tính chủ có thể giúp bạn xác nhận rằng bạn có thể truyền thông máy chủ từ xa và có một dịch vụ đang hoạt động với cổng đó.</p>
<p style="text-align: center;"><a href="http://centosvn.com/wp-content/uploads/2011/08/centosvn_28669218750.jpg"><img class="aligncenter size-medium wp-image-9" title="centosvn_28669218750" src="http://centosvn.com/wp-content/uploads/2011/08/centosvn_28669218750-300x178.jpg" alt="" width="300" height="178" /></a><span style="font-family: Arial; font-size: x-small;"><br />
</span></p>
<p align="justify">Một điều quan trọng cần phải nhớ ở đây là telnet không được mã hóa, vì vậy nó có lỗ hổng trước các kiểu tấn công “packet-sniffing” và “man-in-the-middle”. Do đó lời khuyên ở đây là bạn không nên sử dụng nó để truyền tải username và password ngoại trừ các trường hợp test sử dụng tài khoản dùng một lần.</p>
<p><strong>SMTP</strong></p>
<p>Các máy chủ SMTP hoạt động trên cổng 25 do đó chúng ta có thể sử dụng telnet để truyền thông trực tiếp với chúng qua lệnh sau:</p>
<div align="justify">
<pre>telnet smtp.example.com 25</pre>
</div>
<p align="justify">Lưu ý rằng bạn sẽ không nhận được bất cứ nhắc nhở gì mà thay vào đó là một vài dòng đầu ra, sau đó là một dòng trống đợi khởi tạo kết nối. Đánh:</p>
<div align="justify">
<pre>EHLO example.com</pre>
</div>
<p align="justify">để đăng ký trên máy chủ tên miền example.com. EHLO sẽ khởi tạo kết nối với máy chủ từ xa, cung cấp tên của host, chỉ định host muốn sử dụng giao thức SMTP mở rộng (để sử dụng giao thức SMTP thông thường, sử dụng HELO). Bạn có thể tham khảo thêm tại đây để biết thêm các lệnh máy chủ SMTP.</p>
<p>Lúc này kết nối được thiết lập và bạn có thể thực hiện gửi email trực tiếp.</p>
<div align="justify">
<pre>MAIL From:</pre>
</div>
<div align="justify">
<pre>RCPT To:</pre>
</div>
<div align="justify">
<pre>DATA</pre>
</div>
<p align="justify">Tại đây, bạn có thể đánh vào một tin nhắn. Sau khi viết xong tin nhắn, nhấn return, đánh . và nhấn return lần nữa để gửi tin. Đánh QUIT để thoát khỏi session.</p>
<p>Đây có thể là một cách hữu dụng để kiểm tra những gì đang xảy ra với máy chủ SMTP của bạn. Một số máy chủ SMTP yêu cầu TLS, có nghĩa rằng bạn sẽ không nhận được bất cứ thứ gì khác ngoài việc khởi tạo kết nối. Tuy nhiên tối thiểu ở đây bạn có thể kiểm tra máy chủ và thực hiện các kết nối.</p>
<p><strong>IMAP</strong></p>
<p>Tương tự như vậy, bạn có thể truyền thông trực tiếp với máy chủ IMAP để tìm ra những gì đang diễn ra ở đây:</p>
<div align="justify">
<pre>telnet localhost 143</pre>
</div>
<p align="justify">Khi kết nối được thiết lập, bạn sẽ nhận được các thông tin đầu ra như thể hiện bên dưới:</p>
<div align="justify">
<pre>Connected to imap.example.com.</pre>
</div>
<div align="justify">
<pre>Escape character is '^]'.</pre>
</div>
<div align="justify">
<pre>* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE</pre>
</div>
<div align="justify">
<pre> THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT</pre>
</div>
<div align="justify">
<pre> QUOTA IDLE ACL ACL2=UNION] Courier-IMAP ready.</pre>
</div>
<div align="justify">
<pre>Copyright 1998-2010 Double Precision, Inc.</pre>
</div>
<div align="justify">
<pre>See COPYING for distribution information.</pre>
</div>
<p align="justify">Để đăng nhập, sử dụng cú pháp sau (lưu ý cần có tham số “1” ở đây).</p>
<div align="justify">
<pre>1 LOGIN username password</pre>
</div>
<p align="justify">Lưu ý: Mật khẩu này sẽ được truyền tải dưới dạng văn bản trong sáng! Do đó nếu nhất định muốn thực hiện kết nối này, hãy sử dụng các tài khoản dùng một lần.</p>
<p>Đây là một số lệnh bạn có thể thử:</p>
<p>• 1 SELECT Inbox sẽ chọn thư mục Inbox. Tìm kiếm dòng EXISTS của đầu ra để thông báo cho bạn biết có bao nhiêu email ở đây.</p>
<p>• 4 LIST &#8220;&#8221; &#8220;INBOX&#8221; sẽ liệt kê mỗi các mục trong inbox, với các kiểu thông tin khác nhau của mỗi mục, gồm có ngày gửi, dòng chủ đề, cờ được cắm trên mail.</p>
<p>•1 LOGOUT sẽ đăng xuất bạn khỏi tài khoản.</p>
<p align="justify"><strong>Máy chủ web và IRC</strong></p>
<p>Chúng ta cũng có thể truy cập các máy chủ HTTP thông qua telnet:</p>
<div align="justify">
<pre>telnet www.example.com 80</pre>
</div>
<p align="justify">Thử truy cập đến một trang cụ thể:</p>
<div align="justify">
<pre>GET /index.html HTTP/1.1</pre>
</div>
<div align="justify">
<pre>host: www.example.com</pre>
</div>
<p align="justify">Lưu ý rằng bạn cần nhấn enter hai lần sau dòng host name, chỉ định cả phiên bản giao thức HTTP lẫn hostname.</p>
<p>Nếu trang này tồn tại, bạn sẽ nhận được một số thông tin header, sau đó là một số thông tin nội dung của trang. Nếu nó không tồn tại, bạn sẽ nhận được lỗi “HTTP 404 Not Found” và trang 404 của website. Sử dụng cấu trúc request tương tự để request một trang khác. Nếu bạn muốn trải nghiệm thêm nữa, hãy tìm hiểu thêm các kiến thức tại đây.</p>
<p>Hầu hết các máy chủ IRC đều chạy trên cổng 6667 do đó bạn có thể kết nối đến máy chủ này như sau:</p>
<div align="justify">
<pre>telnet irc.freenode.net 6667</pre>
</div>
<p align="justify">Cú pháp trên sẽ thực hiện kết nối nhưng bạn cần thiết lập nickname của mình (đánh NICK yournickname) và join các kênh bằng lệnh JOIN #thischannel. Khi đó bạn sẽ nhận được rất nhiều thông tin đầu ra, đây là các thông tin rất hữu dụng nếu bạn muốn cải thiện các máy khách IRC.</p>
<p>Ngoài ra bạn cũng có thể test cổng 9 xem máy khách telnet có làm việc hay không. Quá trình thực hiện này sẽ không làm ảnh hưởng đến bất cứ dịch vụ nào khác.</p>
<p><strong>Kết luận</strong></p>
<p>Hiện Telnet không được thực hiện thường xuyên vì nó là kiểu truyền thông dữ liệu dưới dạng không mã hóa. Mặc dù vậy, đây vẫn là một công cụ khá hữu dụng trong gỡ rối, đặc biệt khi khi thiết lập máy chủ, nó giúp bạn có thể dễ dàng test các kết nối.</p>
<p style="text-align: right;"><em>CentOSVN (theo QTM/ Linuxplanet)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://centosvn.com/featured/khac-phuc-su-co-may-chu-linux-bang-telnet.aspx/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

