<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-17622600</id><updated>2024-10-20T12:03:59.984+08:00</updated><category term="vsftpd 、cmds_allowed、user_config_dir"/><category term="阻檔msn、iptables、linux"/><title type='text'>Study notes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-17622600.post-8365020976841616603</id><published>2012-06-11T12:22:00.000+08:00</published><updated>2012-06-11T12:26:35.275+08:00</updated><title type='text'>Service Levels For MA 系統維護服務的等級</title><content type='html'>&lt;br /&gt;
&lt;div&gt;
&lt;h2&gt;






&lt;span style=&quot;font-family: Tahoma; font-size: large;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Service Levels For MA 系統維護服務的等級&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;這個是網路上找到關於SLA的資料，它通常可以&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;分&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;成&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;四&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;個&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;等&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;級&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;讓我們作為參考&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;，&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;最主要還是要看在簽訂服務合&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;約時的內容為主啦~&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;下圖可以說明日常在維護時的&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;流程。&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXcr0e2ueJHeICNs0i9DuWdx95CLmNyEE8XCltDnvoRDM_SsLxOlUsSLxpAz6MFuWi9RJp-r-EDSUNHbFa82Uzlgb3pb90YA3VxDaeJu7CGseB3maY_jigVvd4bqIvgFcDJiNV/s1600/11.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXcr0e2ueJHeICNs0i9DuWdx95CLmNyEE8XCltDnvoRDM_SsLxOlUsSLxpAz6MFuWi9RJp-r-EDSUNHbFa82Uzlgb3pb90YA3VxDaeJu7CGseB3maY_jigVvd4bqIvgFcDJiNV/s320/11.gif&quot; width=&quot;301&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;border: 0px; color: #555555; font-family: GraublauWebRegular, Calibri, Arial, Helvetica, FreeSans, Luxi-sans, NimbusSansL, sans-serif; font-size: 21px; line-height: 1.2em; margin: 8px 0px 8px -1px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;







&lt;span style=&quot;border-collapse: separate; border-spacing: 0px; color: black; font-family: Tahoma; font-size: small; line-height: normal;&quot;&gt;Critical Plus&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border-collapse: separate; border-spacing: 0px; font-family: Tahoma; font-size: small;&quot;&gt;這個等級適合的&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;系統，其作業環境需要較高的可用性的環境&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;，&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;例&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;如&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;銀&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;行&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;業&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;。&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;所以這個程度的服務等級提供、一周7天&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;小&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;時&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;回應，且4小時到場服務、一年365天的服務&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;。&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;24x7x365&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;border: 0px; color: #555555; font-family: GraublauWebRegular, Calibri, Arial, Helvetica, FreeSans, Luxi-sans, NimbusSansL, sans-serif; font-size: 21px; line-height: 1.2em; margin: 8px 0px 8px -1px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;







&lt;span style=&quot;border-collapse: separate; border-spacing: 0px; color: black; font-family: Tahoma; font-size: small; line-height: normal;&quot;&gt;Critical&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;這個服務等級適合只有部分的系統或營業時間需要高可用性，所以這個等級的服務提供24x5&amp;nbsp;回應及四小時到場，服務的時間限於一周中的星期一~星期五。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;border: 0px; color: #555555; font-family: GraublauWebRegular, Calibri, Arial, Helvetica, FreeSans, Luxi-sans, NimbusSansL, sans-serif; font-size: 21px; line-height: 1.2em; margin: 8px 0px 8px -1px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;







&lt;span style=&quot;border-collapse: separate; border-spacing: 0px; color: black; font-family: Tahoma; font-size: small; line-height: normal;&quot;&gt;Elite&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;border-collapse: separate; border-spacing: 0px; color: black; font-family: Tahoma; font-size: small;&quot;&gt;這個是蠻經濟的選擇，它的服務只提供一般上班時間的八小時及一周中的上班日並排除假日，&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;border-collapse: separate; border-spacing: 0px; color: black; font-family: Tahoma; font-size: small;&quot;&gt;這個等級的服務提供8x5&amp;nbsp;上班的時間回應及四小時到場。&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;b&gt;Shared&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;這個是最省錢&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;的選&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;擇，它的服務提供問題&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;回應及&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;自行服務更換零件。這個等級適合公司本身擁有較有經驗及專業技能員工。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/8365020976841616603/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/8365020976841616603' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/8365020976841616603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/8365020976841616603'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2012/06/service-levels-for-ma.html' title='Service Levels For MA 系統維護服務的等級'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXcr0e2ueJHeICNs0i9DuWdx95CLmNyEE8XCltDnvoRDM_SsLxOlUsSLxpAz6MFuWi9RJp-r-EDSUNHbFa82Uzlgb3pb90YA3VxDaeJu7CGseB3maY_jigVvd4bqIvgFcDJiNV/s72-c/11.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-7580109704094094698</id><published>2012-06-08T18:59:00.000+08:00</published><updated>2012-06-08T19:01:11.944+08:00</updated><title type='text'>Proactive Support 的六個等級</title><content type='html'>Proactive Support 的六個等級&lt;br /&gt;
&lt;br /&gt;
最近在填一個資料時發現Proactive Support這個名詞，剛開始還以為是什麼Support的等級，後來查了這個資訊時發現這它還有六個等級，看了一下還與我工作上息息相關，每次在執行工作的過程中常會思考這些問題。所以儘量在執行工作前先了解客戶的環境、工作流程、作業方式，加上手邊的產品已知的問題(bug)、可能會有的問題，兩個部分加在一起去思考要如何降低執行工作遇到無法解決問題的風險。儘量在問題發生前提供客戶其它的替代的解決方案來解決客戶的問題。&lt;br /&gt;
&lt;br /&gt;
&lt;img height=&quot;340&quot; src=&quot;http://experiencematters.files.wordpress.com/2011/02/1102_6levelsofproactivesupport_2.png?w=504&amp;amp;h=429&quot; width=&quot;400&quot; /&gt;
&lt;br /&gt;
&lt;br /&gt;
Level 1 忽略(Ignore)：當問題發生時不做任何處置，&lt;br /&gt;
Level 2 作出反應(React)：當問題發生且客戶提出抱怨時才作出反應&lt;br /&gt;
Level 3 提出警告(Alert)：當問題發生前先讓客戶知道可能會發生的濳在問題。&lt;br /&gt;
Level 4 Self-heal ：當客戶提出抱怨前，先提供客戶一些替代的解決方案&lt;br /&gt;
Level 5 Pre-empt：在客戶注意到問題前，已經能了解問題所在及提供解決方案。&lt;br /&gt;
Level 6 Avoid：在問題發生前就能了解問題所在且修正問題。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;參考資訊

&lt;br /&gt;
&lt;a href=&quot;http://experiencematters.wordpress.com/2011/02/07/the-6-levels-of-proactive-support/&quot;&gt;http://experiencematters.wordpress.com/2011/02/07/the-6-levels-of-proactive-support/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/7580109704094094698/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/7580109704094094698' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/7580109704094094698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/7580109704094094698'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2012/06/proactive-support.html' title='Proactive Support 的六個等級'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-4283228478542890190</id><published>2012-03-20T09:56:00.001+08:00</published><updated>2012-03-20T09:56:11.902+08:00</updated><title type='text'>samba on CentOS 6.2</title><content type='html'>最近幫朋友重裝Linux Server，在重新移轉服務時遇到了一些其它之前沒遇見的問題，就以Samba來說，雖然設定好之後都能使用但在/var/log/messages裡一直跑出惱人的錯誤訊息。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;錯誤訊息1： &lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;o&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;pen_socket_in: Address already in use&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:22:40 smbd[16745]: &amp;nbsp; smbd_open_once_socket: open_socket_in: Address already in use&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:22:40 max smbd[16745]: [2012/03/20 09:22:40.933009, &amp;nbsp;0] smbd/server.c:500(smbd_open_one_socket)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:22:40 max smbd[16745]: &amp;nbsp; smbd_open_once_socket: open_socket_in: Address already in use&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:23:03 max avahi-daemon[1357]: Invalid query packet.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
處理方式：在Google大神的幫助下發現這個是個bug ，處理方式是在smb.conf裡加一條設定後就沒有跑出這個訊息了。&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;background-color: #b6d7a8;&quot;&gt; &amp;nbsp;bind interfaces only = yes &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
錯誤訊息2：&amp;nbsp;&lt;span style=&quot;background-color: #ffe599;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:18:11 max smbd[9426]: [2012/03/20 09:18:11.846538, &amp;nbsp;0] printing/print_cups.c:468(cups_async_callback)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:18:11 max smbd[9426]: &amp;nbsp; failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:18:11 max smbd[9426]: [2012/03/20 09:18:11.846737, &amp;nbsp;0] smbd/server.c:281(remove_child_pid)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;Mar 20 09:18:11 max smbd[9426]: &amp;nbsp; Could not find child 16659 -- ignoring&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
處理方式：&amp;nbsp;因為我沒有裝印表機，每750秒系統會掃描一次，錯誤又會跑出一次，將smb.conf裡加一條設定將這個功能關閉就行了。&lt;span style=&quot;background-color: #ffe599; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;background-color: #b6d7a8;&quot;&gt; &amp;nbsp;printcap cache time = 0 &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
我使用的samba版本是samba-3.5.10-114.el6.i686 ，加上這兩條之後清爽多了~恢復之前平靜的日子~~&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/4283228478542890190/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/4283228478542890190' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/4283228478542890190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/4283228478542890190'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2012/03/samba-on-centos-62.html' title='samba on CentOS 6.2'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-1376566613814660304</id><published>2010-11-01T23:42:00.000+08:00</published><updated>2010-11-01T23:43:10.099+08:00</updated><title type='text'>List of raw FTP commands</title><content type='html'>&lt;h2&gt;List of raw FTP commands&lt;/h2&gt;  &lt;em&gt;(Warning: this is a technical document, not necessary for most FTP use.)&lt;/em&gt;  &lt;p&gt;Note that commands marked with a * are not implemented in a number of FTP servers. &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;h3&gt;Common commands&lt;/h3&gt; &lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#ABOR&quot;&gt;ABOR&lt;/a&gt; - &lt;b&gt;abor&lt;/b&gt;t a file transfer &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#CWD&quot;&gt;CWD&lt;/a&gt; - &lt;b&gt;c&lt;/b&gt;hange &lt;b&gt;w&lt;/b&gt;orking &lt;b&gt;d&lt;/b&gt;irectory &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#DELE&quot;&gt;DELE&lt;/a&gt; - &lt;b&gt;dele&lt;/b&gt;te a remote file &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#LIST&quot;&gt;LIST&lt;/a&gt; - &lt;b&gt;list&lt;/b&gt; remote files &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#MDTM&quot;&gt;MDTM&lt;/a&gt; - return the &lt;b&gt;m&lt;/b&gt;o&lt;b&gt;d&lt;/b&gt;ification &lt;b&gt;t&lt;/b&gt;i&lt;b&gt;m&lt;/b&gt;e of a file &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#MKD&quot;&gt;MKD&lt;/a&gt; - &lt;b&gt;m&lt;/b&gt;a&lt;b&gt;k&lt;/b&gt;e a remote &lt;b&gt;d&lt;/b&gt;irectory &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#NLST&quot;&gt;NLST&lt;/a&gt; - &lt;b&gt;n&lt;/b&gt;ame &lt;b&gt;l&lt;/b&gt;i&lt;b&gt;st&lt;/b&gt; of remote directory &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASS&quot;&gt;PASS&lt;/a&gt; - send &lt;b&gt;pass&lt;/b&gt;word &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; - enter &lt;b&gt;pas&lt;/b&gt;si&lt;b&gt;v&lt;/b&gt;e mode &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; - open a data &lt;b&gt;port&lt;/b&gt; &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PWD&quot;&gt;PWD&lt;/a&gt; - &lt;b&gt;p&lt;/b&gt;rint &lt;b&gt;w&lt;/b&gt;orking &lt;b&gt;d&lt;/b&gt;irectory &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#QUIT&quot;&gt;QUIT&lt;/a&gt; - terminate the connection &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#RETR&quot;&gt;RETR&lt;/a&gt; - &lt;b&gt;retr&lt;/b&gt;ieve a remote file &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#RMD&quot;&gt;RMD&lt;/a&gt; - &lt;b&gt;r&lt;/b&gt;e&lt;b&gt;m&lt;/b&gt;ove a remote &lt;b&gt;d&lt;/b&gt;irectory &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#RNFR&quot;&gt;RNFR&lt;/a&gt; - &lt;b&gt;r&lt;/b&gt;e&lt;b&gt;n&lt;/b&gt;ame &lt;b&gt;fr&lt;/b&gt;om &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#RNTO&quot;&gt;RNTO&lt;/a&gt; - &lt;b&gt;r&lt;/b&gt;e&lt;b&gt;n&lt;/b&gt;ame &lt;b&gt;to&lt;/b&gt; &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#SITE&quot;&gt;SITE&lt;/a&gt; - &lt;b&gt;site&lt;/b&gt;-specific commands &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#SIZE&quot;&gt;SIZE&lt;/a&gt; - return the &lt;b&gt;size&lt;/b&gt; of a file &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#STOR&quot;&gt;STOR&lt;/a&gt; - &lt;b&gt;stor&lt;/b&gt;e a file on the remote host &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#TYPE&quot;&gt;TYPE&lt;/a&gt; - set transfer &lt;b&gt;type&lt;/b&gt; &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#USER&quot;&gt;USER&lt;/a&gt; - send &lt;b&gt;user&lt;/b&gt;name &lt;/li&gt;&lt;/ul&gt;  &lt;h3&gt;Less common commands&lt;/h3&gt; &lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#ACCT&quot;&gt;ACCT&lt;/a&gt;* - send &lt;b&gt;acc&lt;/b&gt;oun&lt;b&gt;t&lt;/b&gt; information &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#APPE&quot;&gt;APPE&lt;/a&gt; - &lt;b&gt;appe&lt;/b&gt;nd to a remote file &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#CDUP&quot;&gt;CDUP&lt;/a&gt; - CWD to the parent of the current directory &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#HELP&quot;&gt;HELP&lt;/a&gt; - return &lt;b&gt;help&lt;/b&gt; on using the server &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#MODE&quot;&gt;MODE&lt;/a&gt; - set transfer &lt;b&gt;mode&lt;/b&gt; &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#NOOP&quot;&gt;NOOP&lt;/a&gt; - do nothing &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#REIN&quot;&gt;REIN&lt;/a&gt;* - &lt;b&gt;rein&lt;/b&gt;itialize the connection &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#STAT&quot;&gt;STAT&lt;/a&gt; - return server &lt;b&gt;stat&lt;/b&gt;us &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#STOU&quot;&gt;STOU&lt;/a&gt; - &lt;b&gt;sto&lt;/b&gt;re a file &lt;b&gt;u&lt;/b&gt;niquely &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#STRU&quot;&gt;STRU&lt;/a&gt; - set file transfer &lt;b&gt;stru&lt;/b&gt;cture &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#SYST&quot;&gt;SYST&lt;/a&gt; - return &lt;b&gt;syst&lt;/b&gt;em type &lt;/li&gt;&lt;/ul&gt;  &lt;hr /&gt;  &lt;a name=&quot;ABOR&quot;&gt;&lt;/a&gt; &lt;h3&gt;ABOR&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;ABOR&lt;/samp&gt; &lt;p&gt; Aborts a file transfer currently in progress. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;ACCT&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;ACCT*&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;ACCT &lt;i&gt;account-info&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; This command is used to send account information on systems that require it.  Typically sent after a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASS&quot;&gt;PASS&lt;/a&gt; command. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;ALLO&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;ALLO&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;ALLO &lt;i&gt;size&lt;/i&gt; [R &lt;i&gt;max-record-size&lt;/i&gt;]&lt;/samp&gt; &lt;p&gt; Allocates sufficient storage space to receive a file.  If the maximum size of a record also needs to be known, that is sent as a second numeric parameter following a space, the capital letter &quot;R&quot;, and another space. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;APPE&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;APPE&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;APPE &lt;i&gt;remote-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Append data to the end of a file on the remote host.  If the file does not already exist, it is created.  This command must be preceded by a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; or &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; command so that the server knows where to receive data from. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;CDUP&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;CDUP&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;CDUP&lt;/samp&gt; &lt;p&gt; Makes the parent of the current directory be the current directory. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;CWD&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;CWD&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;CWD &lt;i&gt;remote-directory&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Makes the given directory be the current directory on the remote host. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;DELE&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;DELE&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;DELE &lt;i&gt;remote-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Deletes the given file on the remote host. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;HELP&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;HELP&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;HELP [&lt;i&gt;command&lt;/i&gt;]&lt;/samp&gt; &lt;p&gt; If a &lt;i&gt;command&lt;/i&gt; is given, returns help on that command; otherwise, returns general help for the FTP server (usually a list of supported commands). &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;LIST&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;LIST&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;LIST [&lt;i&gt;remote-filespec&lt;/i&gt;]&lt;/samp&gt; &lt;p&gt; If &lt;i&gt;remote-filespec&lt;/i&gt; refers to a file, sends information about that file.  If &lt;i&gt;remote-filespec&lt;/i&gt; refers to a directory, sends information about each file in that directory.  &lt;i&gt;remote-filespec&lt;/i&gt; defaults to the current directory.  This command must be preceded by a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; or &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; command. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;MDTM&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;MDTM&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;MDTM &lt;i&gt;remote-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Returns the last-modified time of the given file on the remote host in the format &quot;&lt;samp&gt;YYYYMMDDhhmmss&lt;/samp&gt;&quot;: &lt;samp&gt;YYYY&lt;/samp&gt; is the four-digit year, &lt;samp&gt;MM&lt;/samp&gt; is the month from 01 to 12, &lt;samp&gt;DD&lt;/samp&gt; is the day of the month from 01 to 31, &lt;samp&gt;hh&lt;/samp&gt; is the hour from 00 to 23, &lt;samp&gt;mm&lt;/samp&gt; is the minute from 00 to 59, and &lt;samp&gt;ss&lt;/samp&gt; is the second from 00 to 59. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;MKD&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;MKD&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;MKD &lt;i&gt;remote-directory&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Creates the named directory on the remote host. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;MODE&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;MODE&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;MODE &lt;i&gt;mode-character&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Sets the transfer mode to one of: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;S - Stream &lt;/li&gt;&lt;li&gt;B - Block &lt;/li&gt;&lt;li&gt;C - Compressed &lt;/li&gt;&lt;/ul&gt; The default mode is Stream. &lt;p&gt; &lt;a name=&quot;NLST&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;NLST&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;NLST [&lt;i&gt;remote-directory&lt;/i&gt;]&lt;/samp&gt; &lt;p&gt; Returns a list of filenames in the given directory (defaulting to the current directory), with no other information.  Must be preceded by a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; or &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; command. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;NOOP&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;NOOP&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;NOOP&lt;/samp&gt; &lt;p&gt; Does nothing except return a response. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;PASS&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;PASS&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;PASS &lt;i&gt;password&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; After sending the &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#USER&quot;&gt;USER&lt;/a&gt; command, send this command to complete the login process.  (Note, however, that an &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#ACCT&quot;&gt;ACCT&lt;/a&gt; command may have to be used on some systems.) &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;PASV&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;PASV&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;PASV&lt;/samp&gt; &lt;p&gt; Tells the server to enter &quot;passive mode&quot;.  In passive mode, the server will wait for the client to establish a connection with it rather than attempting to connect to a client-specified port.  The server will respond with the address of the port it is listening on, with a message like:&lt;br /&gt;&lt;samp&gt;227 Entering Passive Mode  (&lt;i&gt;a1&lt;/i&gt;,&lt;i&gt;a2&lt;/i&gt;,&lt;i&gt;a3&lt;/i&gt;,&lt;i&gt;a4&lt;/i&gt;,&lt;i&gt;p1&lt;/i&gt;,&lt;i&gt;p2&lt;/i&gt;)&lt;/samp&gt;&lt;br /&gt;where &lt;i&gt;a1&lt;/i&gt;.&lt;i&gt;a2&lt;/i&gt;.&lt;i&gt;a3&lt;/i&gt;.&lt;i&gt;a4&lt;/i&gt; is the IP address and &lt;i&gt;p1&lt;/i&gt;*256+&lt;i&gt;p2&lt;/i&gt; is the port number. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;PORT&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;PORT&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;PORT  &lt;i&gt;a1&lt;/i&gt;,&lt;i&gt;a2&lt;/i&gt;,&lt;i&gt;a3&lt;/i&gt;,&lt;i&gt;a4&lt;/i&gt;,&lt;i&gt;p1&lt;/i&gt;,&lt;i&gt;p2&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Specifies the host and port to which the server should connect for the next file transfer.  This is interpreted as IP address &lt;i&gt;a1&lt;/i&gt;.&lt;i&gt;a2&lt;/i&gt;.&lt;i&gt;a3&lt;/i&gt;.&lt;i&gt;a4&lt;/i&gt;, port &lt;i&gt;p1&lt;/i&gt;*256+&lt;i&gt;p2&lt;/i&gt;. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;PWD&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;PWD&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;PWD&lt;/samp&gt; &lt;p&gt; Returns the name of the current directory on the remote host. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;QUIT&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;QUIT&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;QUIT&lt;/samp&gt; &lt;p&gt; Terminates the command connection. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;REIN&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;REIN*&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;REIN&lt;/samp&gt; &lt;p&gt; Reinitializes the command connection - cancels the current user/password/account information.  Should be followed by a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#USER&quot;&gt;USER&lt;/a&gt; command for another login. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;REST&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;REST&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;REST &lt;i&gt;position&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Sets the point at which a file transfer should start; useful for resuming interrupted transfers.  For nonstructured files, this is simply a decimal number.  This command must immediately precede a data transfer command (&lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#RETR&quot;&gt;RETR&lt;/a&gt; or &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#STOR&quot;&gt;STOR&lt;/a&gt; only); i.e. it must come after any &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; or &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; command. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;RETR&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;RETR&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt; RETR &lt;i&gt;remote-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Begins transmission of a file from the remote host.  Must be preceded by either a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; command or a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; command to indicate where the server should send data. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;RMD&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;RMD&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;RMD &lt;i&gt;remote-directory&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Deletes the named directory on the remote host. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;RNFR&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;RNFR&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt; RNFR &lt;i&gt;from-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Used when renaming a file.  Use this command to specify the file to be renamed; follow it with an &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#RNTO&quot;&gt;RNTO&lt;/a&gt; command to specify the new name for the file. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;RNTO&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;RNTO&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt; RNTO &lt;i&gt;to-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Used when renaming a file.  After sending an &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#RNFR&quot;&gt;RNFR&lt;/a&gt; command to specify the file to rename, send this command to specify the new name for the file. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;SITE&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;SITE*&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;SITE &lt;i&gt;site-specific-command&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Executes a site-specific command. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;SIZE&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;SIZE&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;SIZE &lt;i&gt;remote-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Returns the size of the remote file as a decimal number. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;STAT&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;STAT&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;STAT [&lt;i&gt;remote-filespec&lt;/i&gt;]&lt;/samp&gt; &lt;p&gt; If invoked without parameters, returns general status information about the FTP server process.  If a parameter is given, acts like the &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#LIST&quot;&gt;LIST&lt;/a&gt; command, except that data is sent over the control connection (no &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; or &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; command is required). &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;STOR&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;STOR&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;STOR &lt;i&gt;remote-filename&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Begins transmission of a file to the remote site.  Must be preceded by either a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PORT&quot;&gt;PORT&lt;/a&gt; command or a &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#PASV&quot;&gt;PASV&lt;/a&gt; command so the server knows where to accept data from. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;STOU&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;STOU&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;STOU&lt;/samp&gt; &lt;p&gt; Begins transmission of a file to the remote site; the remote filename will be unique in the current directory.  The response from the server will include the filename. &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;STRU&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;STRU&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;STRU &lt;i&gt;structure-character&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Sets the file structure for transfer to one of: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;F - File (no structure) &lt;/li&gt;&lt;li&gt;R - Record structure &lt;/li&gt;&lt;li&gt;P - Page structure &lt;/li&gt;&lt;/ul&gt; The default structure is File. &lt;p&gt; &lt;a name=&quot;SYST&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;SYST&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;SYST&lt;/samp&gt; &lt;p&gt; Returns a word identifying the system, the word &quot;Type:&quot;, and the default transfer type (as would be set by the &lt;a href=&quot;http://www.nsftools.com/tips/RawFTP.htm#TYPE&quot;&gt;TYPE&lt;/a&gt; command). For example: &lt;samp&gt;UNIX Type: L8&lt;/samp&gt; &lt;/p&gt;&lt;p&gt; &lt;a name=&quot;TYPE&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;TYPE&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt;TYPE  &lt;i&gt;type-character&lt;/i&gt; [&lt;i&gt;second-type-character&lt;/i&gt;]&lt;/samp&gt; &lt;p&gt; Sets the type of file to be transferred.  &lt;i&gt;type-character&lt;/i&gt; can be any of: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;A - ASCII text &lt;/li&gt;&lt;li&gt;E - EBCDIC text &lt;/li&gt;&lt;li&gt;I - image (binary data) &lt;/li&gt;&lt;li&gt;L - local format &lt;/li&gt;&lt;/ul&gt; For A and E, the &lt;i&gt;second-type-character&lt;/i&gt; specifies how the text should be interpreted.  It can be: &lt;ul&gt;&lt;li&gt;N - Non-print (not destined for printing).  This is the default if  &lt;i&gt;second-type-character&lt;/i&gt; is omitted. &lt;/li&gt;&lt;li&gt;T - Telnet format control (&lt;samp&gt;&lt;cr&gt;&lt;/samp&gt;,  &lt;samp&gt;&lt;ff&gt;&lt;/samp&gt;, etc.) &lt;/li&gt;&lt;li&gt;C - ASA Carriage Control &lt;/li&gt;&lt;/ul&gt; For L, the &lt;i&gt;second-type-character&lt;/i&gt; specifies the number of bits per byte on the local system, and may not be omitted. &lt;p&gt; &lt;a name=&quot;USER&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;h3&gt;USER&lt;/h3&gt; &lt;i&gt;Syntax:&lt;/i&gt; &lt;samp&gt; USER &lt;i&gt;username&lt;/i&gt;&lt;/samp&gt; &lt;p&gt; Send this command to begin the login process.  &lt;i&gt;username&lt;/i&gt; should be a valid username on the system, or &quot;anonymous&quot; to initiate an anonymous login. &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/1376566613814660304/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/1376566613814660304' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/1376566613814660304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/1376566613814660304'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2010/11/list-of-raw-ftp-commands.html' title='List of raw FTP commands'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-7556977553603657444</id><published>2007-06-27T10:13:00.000+08:00</published><updated>2007-06-27T10:54:54.414+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vsftpd 、cmds_allowed、user_config_dir"/><title type='text'>幫朋友設定VSFTPD--取消ftp用戶的刪除權限</title><content type='html'>最近朋友在設定vsftpd時有個需求，就是讓所有user只能上傳，但是不能刪除檔案，後來我加入這樣的設定：&lt;br /&gt;chown_uploads=YES&lt;br /&gt;chown_username=ftp&lt;br /&gt;guest_enable=yes&lt;br /&gt;guest_username=test&lt;br /&gt;但這樣所以的user都被對映到anonymous，且所有的使用者都會對映到test這個帳號的家目錄，也可以滿足讓所有user只能上傳不能刪檔的需求，但他要的是每個user要不同目錄，所以只要想其它的方式了。&lt;br /&gt;&lt;br /&gt;後來只好用man vsftpd.conf 見到一個參數cmds_allowed之後開始有了一線生機。這個參數是說讓vsftp server能夠接受那些指令。就是將指定可用的ftp指令加到等號後面就行了(指令之間以逗號分隔)。&lt;br /&gt;cmds_allowed=PASV,RETR,QUIT,REST,TYPE,USER,PASS,&lt;br /&gt;LIST,CWD,CDUP,STOR,SIZE,PWD,MKD&lt;br /&gt;&lt;br /&gt;上面是我觀查出一般ftp client會用到的指令，我們要的是讓user不能刪檔，DELE這個指令不要加上去就好了。這樣就可以達到我朋友的要求了!!&lt;br /&gt;&lt;br /&gt;另外我想到cmds_allowed=是site wide的，但如果我某些user要能有全部的權限，有些不能刪檔怎麼辨，可以利用user_config_dir 來專為特定的使用者設定不同的設定。&lt;br /&gt;以下是man vsftpd.conf 中cmds_allowed及user_config_dir 的原文：&lt;br /&gt;&lt;strong&gt;cmds_allowed&lt;br /&gt;&lt;/strong&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;This options specifies a comma separated list of allowed FTP commands (post login. USER, PASS and QUIT are always allowed pre-login). Other commands are rejected. This is a powerful method of really locking down an FTP server. Example: cmds_allowed=PASV,RETR,QUIT&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;user_config_dir&lt;br /&gt;&lt;/strong&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;This powerful option allows the override of any config option specified in the manual page, on a per-user basis. Usage is simple, and is best illustrated with an example. If you set user_config_dir to be /etc/vsftpd_user_conf and then log on as the user &quot;chris&quot;, then vsftpd will apply the settings in the file /etc/vsftpd_user_conf/chris for the duration of the session. The format of this file is as detailed in this manual page! PLEASE NOTE that not all settings are effective on a per-user basis. For example, many settings only prior to the user&#39;s session being started. Examples of settings which will not affect any behviour on a per-user basis include listen_address, banner_file, max_per_ip, max_clients, xferlog_file, etc. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/7556977553603657444/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/7556977553603657444' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/7556977553603657444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/7556977553603657444'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2007/06/vsftpd.html' title='幫朋友設定VSFTPD--取消ftp用戶的刪除權限'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-18604178393349800</id><published>2007-05-10T18:51:00.000+08:00</published><updated>2007-05-10T20:25:15.072+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="阻檔msn、iptables、linux"/><title type='text'>如何使用iptables來阻檔msn</title><content type='html'>最近受到朋友請託，要我讓他們公司的員工不能上msn，他們公司使用msn的情形已經到影響到工作了。剛好他們有台linux伺服器是當他們上網的gateway加上email伺服器。下面是他們公司的網路概圖：&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX7yU8NcfpAMUAV44RoH-firXFZmH4XBhupM0r7DL-bWR1vEULW7392C3CNRCbTS8NETCO4TRSgdfqO9xZaXKeL620jp6D0E-55eg1mLl_pqlQ0163TQqcLyyPyFDsRSzS24hw/s1600-h/%E7%B9%AA%E5%9C%961.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX7yU8NcfpAMUAV44RoH-firXFZmH4XBhupM0r7DL-bWR1vEULW7392C3CNRCbTS8NETCO4TRSgdfqO9xZaXKeL620jp6D0E-55eg1mLl_pqlQ0163TQqcLyyPyFDsRSzS24hw/s320/%E7%B9%AA%E5%9C%961.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5062886680150979442&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;      基本上他們已經在使用iptables來做防火牆和NAT來保護伺服器以及讓所以電腦上網。我利用netstat&lt;br /&gt;來找出來msn登入時所需要的伺服器位置及埠號，msn登入所需要的埠號是80，443，1863三個的其中一個，但不管怎麼樣檔，總不能把80埠給擋掉吧!如果擋了80埠搞得大家不能上網也是不行的，但開了80埠msn 還是可以登入的，那怎麼辨呢？所以我加入阻擋msn 伺服器的位置，另外還有一個就是web msn 現在也有很多web msn的站台，也要去阻擋那些網站。基本上只要加入在防火牆FORWARD Chain就行了，下面是我iptables的規則：&lt;br /&gt;&lt;br /&gt;# 讓那些client可以使用msn，這裡是使用ip 也可以加入-m mac --mac-source 00:90:cc:26:a5:57 去鎖定網卡&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.201 -d login.passport.net -j ACCEPT&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.201 -d login.passport.com -j ACCEPT&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.201 -d login.live.com -j ACCEPT&lt;br /&gt;&lt;br /&gt;# allow msn port 1863&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.201 --dport 1863 -j ACCEPT&lt;br /&gt;&lt;br /&gt;# allow msn http server&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.201 -d 207.46.0.0/16 -j ACCEPT&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.202 -d 207.46.0.0/16 -j ACCEPT&lt;br /&gt;&lt;br /&gt;##其它的人一律阻擋&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.0/24 -d 207.46.0.0/16 -j DROP&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.0/24 --dport 1863 -j DROP&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.0/24 -d login.passport.net -j DROP&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.0/24 -d login.passport.com -j DROP&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.0/24 -d webmessenger.msn.com -j DROP&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.0/24 -d login.live.com -j DROP&lt;br /&gt;&lt;br /&gt;#other web msn server 這個部分可以去知識家找找還有那些免費的web msn&lt;br /&gt;#I love IM&lt;br /&gt;iptables -A FORWARD -p tcp -s 192.168.0.0/24 -d www.iloveim.com -j DROP&lt;br /&gt;&lt;br /&gt;其中270.46.0.0這個網段有很多msn登入的伺服器，我是抱著寧可錯殺也不可放過的心態去設定的，如果可以的話也可以用nslookup 一一去找出來，一一阻擋。其中login.live.com 有很多微軟的服務都會使用他們登入，以前是使用login.passport.net， 所以阻擋這些後相關的服務都無法使用喔。&lt;br /&gt;&lt;br /&gt;另外yahoo messager 相關的規則如下：&lt;br /&gt;&lt;br /&gt;iptables -A FORWARD -p tcp -i eth1 --dport 5050 -j DROP&lt;br /&gt;iptables -A FORWARD -p tcp -i eth1 --dport 5101 -j DROP&lt;br /&gt;iptables -A FORWARD -p all -i eth1 -d &lt;strong&gt;cs9.msg.dcn.yahoo.com &lt;/strong&gt;-j DROP&lt;br /&gt;&lt;br /&gt;記得要阻檔相關的登入的伺服器他們的主機名稱如下：&lt;br /&gt;cs1.msg.dcn.yahoo.com&lt;br /&gt;cs2.msg.dcn.yahoo.com&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;中間略過&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;cs50.msg.dcn.yahoo.com  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;結論：&lt;br /&gt;&lt;br /&gt;這裡是用一些現成的工具像是netstat 及 nslookup 去觀察msn及yahoo messager的運作狀態，再加以使用iptables來阻擋。如果想要更進階的資訊可以去下列網站找到相關的資料：&lt;br /&gt;http://tw.messenger.yahoo.com/index.php&lt;br /&gt;http://www.microsoft.com</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/18604178393349800/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/18604178393349800' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/18604178393349800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/18604178393349800'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2007/05/iptablesmsn.html' title='如何使用iptables來阻檔msn'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX7yU8NcfpAMUAV44RoH-firXFZmH4XBhupM0r7DL-bWR1vEULW7392C3CNRCbTS8NETCO4TRSgdfqO9xZaXKeL620jp6D0E-55eg1mLl_pqlQ0163TQqcLyyPyFDsRSzS24hw/s72-c/%E7%B9%AA%E5%9C%961.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-113818463331746902</id><published>2006-01-25T17:13:00.000+08:00</published><updated>2006-01-26T10:29:13.550+08:00</updated><title type='text'>設定Backup MX for postfix</title><content type='html'>&lt;div align=&quot;left&quot;&gt;好久沒上來了，我花了近三個月的時間準備LPIC level 1&amp;2 ，最後終於讓我考完了，一切順利。&lt;br /&gt;&lt;br /&gt;今天發生家裡的網路斷線，這已經不是第一次了，通常不是我妹沒去繳adsl的錢，要不然就是ip分享器的問題例如，插頭被拔了…。想說發生這樣的事，我家裡的mail server 不是就中斷了跟外面的連線嗎，外面的信就無法送到我的mail server了。但我又不想少收到信，後來就去www.postfix.org找到了一些資料。還滿簡單的。&lt;br /&gt;&lt;br /&gt;更改的地方有&lt;br /&gt;1.dns 要多設定一組mx record 是backup mail server 用的。&lt;br /&gt;2.備援主機上postfix的main.cf ，postfix的版本 要2.0以上。&lt;br /&gt;&lt;br /&gt;設定dns&lt;br /&gt;&lt;br /&gt;在dns中 abc.com.tw的zone裡頭多設定一組mx 記錄，偏好值設大一點，&lt;br /&gt;&lt;br /&gt;例如&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;@&lt;/td&gt;&lt;td&gt;IN&lt;/td&gt;&lt;td&gt;NS&lt;/td&gt;&lt;td&gt;test.abc.com.tw.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;test&lt;/td&gt;&lt;td&gt;IN&lt;/td&gt;&lt;td&gt;A&lt;/td&gt;&lt;td&gt;11.22.33.44&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;mail&lt;/td&gt;&lt;td&gt;IN&lt;/td&gt;&lt;td&gt;A&lt;/td&gt;&lt;td&gt;22.33.44.55&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;mail2&lt;/td&gt;&lt;td&gt;IN&lt;/td&gt;&lt;td&gt;A&lt;/td&gt;&lt;td&gt;33.44.55.66 &lt;td&gt;&lt;/td&gt;&lt;tr&gt;&lt;td&gt;@&lt;/td&gt;&lt;td&gt;IN&lt;/td&gt;&lt;td&gt;MX 10&lt;/td&gt;&lt;td&gt;mail&lt;/td&gt;&lt;strong&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;@&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;IN&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;MX 50&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;mail2&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;;BACKUP MX&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/strong&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;所以當mail.abc.com.tw 離線的時候，所以abc.com.tw的信就會轉到mail2去。&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;設定postfix的main.cf&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;在main.cf裡的要設定relay_domains 、permit_mx_backup_networks &lt;/div&gt;&lt;div align=&quot;left&quot;&gt;及permit_mx_backup。&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;div align=&quot;left&quot;&gt;relay_domains -- 它的預設值是$mydestination，在後面加入你要的收那個domain的信，例如 abc.com.tw &lt;strong&gt;relay_domains = $mydestination abc.com.tw&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align=&quot;left&quot;&gt;permit_mx_backup_networks -- 預設值是空白的，加入你要備援的主機的domain，&lt;strong&gt;permit_mx_backup_networks = abc.com.tw&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align=&quot;left&quot;&gt;在smtpd_recipient_restrictions、smtpd_client_restrictions中加入permit_mx_backup，&lt;strong&gt;例如：smtpd_recipient_restrictions=permit_mynetworks permit_mx_backup&lt;/strong&gt;設定好之後，重新啟動name及postfix就完成了。&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/113818463331746902/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/113818463331746902' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/113818463331746902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/113818463331746902'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2006/01/backup-mx-for-postfix.html' title='設定Backup MX for postfix'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-112928561535220301</id><published>2005-10-14T17:04:00.000+08:00</published><updated>2005-10-14T23:09:05.800+08:00</updated><title type='text'>RedHat Enterprise Linux 4 DVD 制作</title><content type='html'>這兩天心血來潮跟同事借了RHEL 4 ES來玩，在安裝的過程中發現一直在換片子，換的有點煩，然後就參考網路上一些同好們的文章就自製了DVD的版本。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;準備工具：&lt;br /&gt;&lt;/strong&gt;Redhat Enterprise Linux 的光碟(4 CD)&lt;br /&gt;與光碟相同版本之環境也就是RHEL 4 ES&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;需要安裝的套件：&lt;/strong&gt;&lt;br /&gt;anaconda-runtime&lt;br /&gt;anaconda&lt;br /&gt;mkisofs&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;複製檔案：&lt;/strong&gt;&lt;br /&gt;將CD片的內容Copy 到硬碟裡：&lt;br /&gt;複製CD1&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# mkdir /tmp/dvd&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# mount /dev/hdc /mnt/cdrom&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]#cp -rf /mnt/cdrom/* /tmp/dvd&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# umount /dev/hdc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;複製CD2&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# mount /dev/hdc /mnt/cdrom&lt;br /&gt;[root@localhost]#cp -rf /mnt/cdrom/RedHat/RPMS/* /tmp/dvd/RedHat/RPMS&lt;br /&gt;[root@localhost]# umount /dev/hdc&lt;/span&gt;&lt;br /&gt;CD3、CD4 都跟CD2一樣的過程。&lt;br /&gt;&lt;br /&gt;如果原本的cd片你已經轉成iso檔的話，可以用mount -o loop 來掛載ISO映像檔。&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]#mount -o loop rhelcd1.iso /mnt/cdrom&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;複製全部的CD到硬碟後，就進行下面的步驟：&lt;br /&gt;&lt;strong&gt;刪除 TRANS.TBL&lt;br /&gt;&lt;/strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# find /tmp/dvd/ -name TRANS.TBL xargs rm -f &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;刪除boot.cat　&lt;/strong&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;這個是開機導引檔，要記得刪除，不然安裝的時候會有問題。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# rm -f /tmp/dvd/isolinux/boot.cat&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;修改.discinfo&lt;br /&gt;&lt;/strong&gt;修改 /tmp/dvd/.discinfo　如果沒有這個檔請在CD1裡有，copy到/tmp/dvd下&lt;br /&gt;　&lt;span style=&quot;color:#009900;&quot;&gt;1105116601.310480&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;　Red Hat Enterprise Linux 4&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;　i386&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;　1,2,3,4　&lt;/span&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;-----&gt;原本只有1 要修改成1,2,3,4&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;　RedHat/base&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;　RedHat/RPMS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;　RedHat/pixmaps&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;複製開機資訊：&lt;/strong&gt;&lt;br /&gt;我們需要這片 DVD 能夠直接安裝, 所以需要使用到 isolinux 目錄下的 isolinux.bin 和 boot.cat 檔, copy 出來待會會使用到。&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# mount /dev/hdc /mnt/cdrom&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]# cp /mnt/cdrom/isolinux /tmp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;製作iso映像檔：&lt;br /&gt;&lt;/strong&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost]#cd /tmp&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost tmp]# mkisofs -J -R -v -T -o rhel4dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 8 -boot-info-table dvd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;建立md5sum：&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;[root@localhost tmp]# /usr/lib/anaconda-runtime/implantisomd5 --force rhel4dvd.iso&lt;/span&gt;&lt;br /&gt;出現下面的訊息就代表好了…&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;Inserting md5sum into iso image...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;md5 = ec3c8e7c6b86587093a2f33bfdca9b64&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#009900;&quot;&gt;Setting supported flag to 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;最後在/tmp 下就會有個rhel4dvd.iso的映像檔，可以用來燒成DVD了!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;參考資料：&lt;br /&gt;&lt;/strong&gt;&lt;a href=&quot;http://ms.ntcb.edu.tw/~steven/article/install_dvd.htm&quot;&gt;http://ms.ntcb.edu.tw/~steven/article/install_dvd.htm&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;ftp://people.redhat.com/ckloiber/mkdvdiso.sh&quot;&gt;ftp://people.redhat.com/ckloiber/mkdvdiso.sh&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/112928561535220301/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/112928561535220301' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/112928561535220301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/112928561535220301'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2005/10/redhat-enterprise-linux-4-dvd.html' title='RedHat Enterprise Linux 4 DVD 制作'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17622600.post-112879574202118746</id><published>2005-10-09T02:21:00.000+08:00</published><updated>2005-10-10T02:23:43.093+08:00</updated><title type='text'>使用Trustix 3.0 架設郵件伺服器(Postfix + SASL SMTP認證 + MYSQL+Courier-imapd)</title><content type='html'>一、前言：&lt;br /&gt;這份文件是在說明如何去使用Trustix 3.0 來架設一個Mail Server ，其中使用者的帳號及密碼是放在MySQL的資料庫裡，而不是本機的使用者，跟系統的帳號是分開的，也使用了Cyrus-SASL來提供SMTP的認證機制，發信的使用者必需要認證後才能發信，這樣可以避免一樣不必要的安全及管理上的問題。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;二、事前準備：&lt;/strong&gt;&lt;br /&gt;1、本篇是Trustix 3.0 裡的套件來架設的，所使用的套件有：&lt;br /&gt;postfix-2.2.5-3tr&lt;br /&gt;postfix-mysql-2.2.5-3tr&lt;br /&gt;cyrus-sasl-2.1.20-14tr&lt;br /&gt;cyrus-sasl-plain-2.1.20-14tr&lt;br /&gt;courier-imap-4.0.4-1tr&lt;br /&gt;courier-authlib-0.57-2tr&lt;br /&gt;courier-authlib-mysql-0.57-2tr&lt;br /&gt;mysql-4.1.14-1tr&lt;br /&gt;所以要確認要先安裝以上這些套件。&lt;br /&gt;&lt;br /&gt;2、DNS的設定及Postfix的domain設定要先設定好，能夠正常發信，然後進行下面的步驟。&lt;br /&gt;三、設定：&lt;br /&gt;設定MySQL：這裡是的設定是用來設定使用者的mailbox、網域名稱…。&lt;br /&gt;&lt;br /&gt;建立資料庫：在命令列下照以下輸入：&lt;br /&gt;&lt;span style=&quot;color:#006600;&quot;&gt;# mysql -p&lt;br /&gt;Enter password: &lt;span style=&quot;color:#ff9900;&quot;&gt;&lt;在此輸入root的密碼，預設是空白&gt;&lt;br /&gt;&lt;/span&gt;mysql&gt; CREATE DATABASE postfix; &lt;span style=&quot;color:#ff9900;&quot;&gt;建立一個名叫postfix的資料庫&lt;br /&gt;&lt;/span&gt;mysql&gt; GRANT SELECT, INSERT, DELETE, UPDATE, USAGE ON postfix.* TO postfix@localhost IDENTIFIED BY &#39;password&#39;; &lt;span style=&quot;color:#ff9900;&quot;&gt;設定資料庫的權限及密碼password&lt;/span&gt;&lt;br /&gt;mysql&gt; FLUSH PRIVILEGES;&lt;/span&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;套用設定 &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;建立三個table，alias、domain、mailbox：&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;mysql&gt; \u postfix&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;CREATE TABLE alias (&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;address varchar(255) NOT NULL default &#39;&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;goto text NOT NULL, domain varchar(255) NOT NULL default &#39;&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;created datetime NOT NULL default &#39;0000-00-00 00:00:00&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;modified datetime NOT NULL default &#39;0000-00-00 00:00:00&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;active tinyint(4) NOT NULL default &#39;1&#39;, PRIMARY KEY (address),&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;KEY address (address)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;) TYPE=MyISAM COMMENT=&#39;Virtual Aliases&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;CREATE TABLE domain (&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;domain varchar(255) NOT NULL default &#39;&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;description varchar(255) NOT NULL default &#39;&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;aliases int(10) NOT NULL default &#39;-1&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;mailboxes int(10) NOT NULL default &#39;-1&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;maxquota int(10) NOT NULL default &#39;-1&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;created datetime NOT NULL default &#39;0000-00-00 00:00:00&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;modified datetime NOT NULL default &#39;0000-00-00 00:00:00&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;active tinyint(4) NOT NULL default &#39;1&#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;PRIMARY KEY (domain), &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;KEY domain (domain)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;) TYPE=MyISAM COMMENT=&#39; Virtual Domains&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;CREATE TABLE mailbox (&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;username varchar(255) NOT NULL default &#39;&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;password varchar(255) NOT NULL default &#39;&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;name varchar(255) NOT NULL default &#39;&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;maildir varchar(255) NOT NULL default &#39;&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;quota int(10) NOT NULL default &#39;-1&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;domain varchar(255) NOT NULL default &#39;&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;created datetime NOT NULL default &#39;0000-00-00 00:00:00&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;modified datetime NOT NULL default &#39;0000-00-00 00:00:00&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;active tinyint(4) NOT NULL default &#39;1&#39;, &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;PRIMARY KEY (username), &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;KEY username (username)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;) TYPE=MyISAM COMMENT=&#39;Virtual Mailboxes&#39;;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;好了之後，可以增加一些資料以供測試。&lt;br /&gt;&lt;span style=&quot;color:#33ff33;&quot;&gt;INSERT INTO domain (domain,description) VALUES (&#39;domain.tld&#39;,&#39;Test Domain&#39;);INSERT INTO alias (address,goto) VALUES (&#39;alias@domain.tld&#39;, &#39;user@domain.tld&#39;);INSERT INTO mailbox (username,password,name,maildir) VALUES(&#39;user@domain.tld&#39;,&#39; JKvrm8/WaOc0U &#39;,&#39;Mailbox User&#39;,&#39;user@domain.tld/&#39;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;(password 是 &quot;123456&quot;) &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;&lt;/span&gt;&lt;br /&gt;如果要新增使用者或更改密碼就必需要使用MySQL的encrypt的功能，如果要變更user@domain.tld的密碼，可以使用下列的方法。&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;mysql&gt; update mailbox set password=encrypt(&#39;7890123&#39;) where username=&#39;user@domain.tld&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;使用者的帳號可以加入網域的名稱，例如：&#39;user@domain.tld 或 直接使用帳號不加網域名稱，例如 user， 這關於是否有架設多重網域的考量。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;設定postfix&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;建立mailbox的資料夾，及設定權限。&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;mkdir /var/mail&lt;br /&gt;chown postfix.postfix /var/mail&lt;br /&gt;chmod 700 /var/mail&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;在./etc/postfix/main.cf 裡加入下列的設定：這是要讓postfix能夠知道mysql裡的使用者資料，而將信送到正確的位置。&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf&lt;br /&gt;virtual_gid_maps = static:102&lt;br /&gt;virtual_mailbox_base = /var/mail&lt;br /&gt;virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf&lt;br /&gt;virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf&lt;br /&gt;virtual_mailbox_limit = 51200000&lt;br /&gt;virtual_minimum_uid = 102&lt;br /&gt;virtual_transport = virtual&lt;br /&gt;virtual_uid_maps = static:102&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;在/etc/postfix/ 下建立這三個檔案，是讓postfix存取MySQL時的一些必要資訊，如MySQL Server的位置，MySQL的帳號、密碼及要存取那些tables。&lt;br /&gt;mysql_virtual_alias_maps.cf&lt;br /&gt;mysql_virtual_domains_maps.cf&lt;br /&gt;mysql_virtual_mailbox_maps.cf&lt;br /&gt;&lt;br /&gt;以下是三個檔的內容：&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;mysql_virtual_alias_maps.cf &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;user = postfix&lt;br /&gt;password = password&lt;br /&gt;hosts = localhost&lt;br /&gt;dbname = postfix&lt;br /&gt;query = SELECT goto FROM alias WHERE address=&#39;%s&#39; AND active = 1&lt;br /&gt;&lt;/span&gt;如果是postfix2.2版之前就修改成下列的設定&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;user = postfix&lt;br /&gt;password = password&lt;br /&gt;hosts = localhost&lt;br /&gt;dbname = postfix&lt;br /&gt;table = alias&lt;br /&gt;select_field = goto&lt;br /&gt;where_field = address&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;mysql_virtual_domains_maps.cf&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;user = postfix&lt;br /&gt;password = password&lt;br /&gt;hosts = localhost&lt;br /&gt;dbname = postfix&lt;br /&gt;query = SELECT domain FROM domain WHERE domain=&#39;%s&#39;&lt;br /&gt;&lt;/span&gt;如果是postfix2.2版之前就修改成下列的設定&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;user = postfix&lt;br /&gt;password = password&lt;br /&gt;hosts = localhost&lt;br /&gt;dbname = postfix&lt;br /&gt;table = domain&lt;br /&gt;select_field = domain&lt;br /&gt;where_field = domain&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;mysql_virtual_mailbox_maps.cf&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;user = postfix&lt;br /&gt;password = password&lt;br /&gt;hosts = localhost&lt;br /&gt;dbname = postfix&lt;br /&gt;query = SELECT maildir FROM mailbox WHERE username=&#39;%s&#39; AND active = 1&lt;br /&gt;&lt;/span&gt;如果是postfix2.2版之前就修改成下列的設定&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;user = postfix&lt;br /&gt;password = postfix&lt;br /&gt;hosts = localhost&lt;br /&gt;dbname = postfix&lt;br /&gt;table = mailbox&lt;br /&gt;select_field = maildir&lt;br /&gt;where_field = username&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;設定couier-imapd使用MySQL&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;在trustix3.0裡所使用的courier-imap是4.04版，還必需要安裝courier-authlib及courier-authlib-mysql這兩個套件，如果你是用之前的courier-imap 3.xx版，courier-authlib是內建在裡面的。&lt;br /&gt;&lt;br /&gt;編輯/etc/authlib/authmysqlrc ，將檔案的內容改成下面這樣。要注意的是每行後面不要多的空白，不然會有問題。&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;MYSQL_SERVER localhost&lt;br /&gt;MYSQL_USERNAME postfix&lt;br /&gt;MYSQL_PASSWORD 123456&lt;br /&gt;MYSQL_OPT 0&lt;br /&gt;MYSQL_DATABASE postfix&lt;br /&gt;MYSQL_USER_TABLE mailbox&lt;br /&gt;MYSQL_CRYPT_PWFIELD password&lt;br /&gt;MYSQL_UID_FIELD &#39;102&#39;&lt;br /&gt;MYSQL_GID_FIELD &#39;102&#39;&lt;br /&gt;MYSQL_LOGIN_FIELD username&lt;br /&gt;MYSQL_HOME_FIELD &#39;/var/mail&#39;&lt;br /&gt;MYSQL_NAME_FIELD name&lt;br /&gt;MYSQL_MAILDIR_FIELD maildir&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;再編緝/etc/authlib/authdaemonrc 改成下列的設定。&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;authmodulelist=&quot;authmysql authpam&quot;&lt;br /&gt;version=&quot;authdaemond.mysql&quot;&lt;/span&gt;&lt;br /&gt;更改好了之後重新啟動courier-imapd、courier-authd，如果要使用pop3就啟動courier-pop3d。&lt;br /&gt;&lt;br /&gt;使用telnet來測試。&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;root@tsl3 ~# telnet 127.0.0.1 110&lt;br /&gt;+OK Hello there.&lt;br /&gt;user user@test.com.tw &lt;span style=&quot;color:#ff9900;&quot;&gt;輸入帳號&lt;/span&gt;&lt;br /&gt;+OK Password required.&lt;br /&gt;pass 123456 &lt;span style=&quot;color:#ff9900;&quot;&gt;輸入密碼&lt;br /&gt;&lt;/span&gt;+OK logged in. &lt;/span&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;看到OK logged in. 就代表成功了!!&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;設定SMTP AUTH 的部分&lt;/strong&gt;&lt;br /&gt;在/etc/postfix/main.cf 內加入下列設定以啟動SASL&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;smtpd_recipient_restrictions = permit_mynetworks&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;permit_sasl_authenticated&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;在smtpd_recipient_restrictions 插入permit_sasl_authenticated 這項&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;smtpd_sasl_auth_enable = yes&lt;br /&gt;broken_sasl_auth_clients = yes&lt;br /&gt;smtpd_sasl_security_options = noanonymous&lt;br /&gt;smtpd_sasl_local_domain = $myhostname&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;在/etc/sasl/postfix.conf修改成&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;pwcheck_method: saslauthd&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;及/etc/sysconfig/saslauthd&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;SASL_AUTHMECH=rimap&lt;br /&gt;SASL_RIMAP_HOSTNAME=localhost&lt;/span&gt; &lt;span style=&quot;color:#ff9900;&quot;&gt;這裡是用localhost 因為imapd server 是在本機&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;&lt;/span&gt;&lt;br /&gt;通常有兩種設定一種是讓sasl直接去存取資料庫，另一個是用rimp的認證，這裡是用rimp的認證方式，讓sasl使用imapd 伺服器來做認証的伺服器。&lt;br /&gt;你可以使用saslauthd –v 來看看你的sasl是否有rimap的模組。&lt;br /&gt;重新啟動postfix 及 saslauthd 之後就可以測試看看是否有類似下列的訊息：&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;root@tsl3 ~# telnet 127.0.0.1 25&lt;br /&gt;Trying 127.0.0.1...&lt;br /&gt;Connected to 127.0.0.1.&lt;br /&gt;Escape character is &#39;^]&#39;.&lt;br /&gt;220 tsl3.test.com.tw ESMTP Postfix (Trustix)&lt;br /&gt;ehlo test.com&lt;br /&gt;250-tsl3.test..com.tw&lt;br /&gt;250-PIPELINING&lt;br /&gt;250-SIZE 10240000&lt;br /&gt;250-VRFY&lt;br /&gt;250-ETRN&lt;br /&gt;250-&lt;span style=&quot;color:#ff0000;&quot;&gt;AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5&lt;/span&gt;&lt;br /&gt;250-&lt;span style=&quot;color:#ff0000;&quot;&gt;AUTH=PLAIN LOGIN DIGEST-MD5 CRAM-MD5&lt;/span&gt; &lt;span style=&quot;color:#ff9900;&quot;&gt;看看是否有這兩行，有的話代表有在運作了&lt;br /&gt;&lt;/span&gt;250 8BITMIME &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;&lt;/span&gt;&lt;br /&gt;下一步可以用AUTH指令來來測試，可用下這個perl 寫的程式去產生出認證用的字串。(下面的測試的部分要待couier-impad 設定好之後才會有作用)&lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;use strict;&lt;br /&gt;use MIME::Base64;&lt;br /&gt;if ( $#ARGV != 1 ) {&lt;br /&gt;die &quot;Usage: encode_sasl_plain.pl &lt;username&gt;&lt;password&gt;\n&quot;;&lt;br /&gt;}&lt;br /&gt;print encode_base64(&quot;$ARGV[0]\0$ARGV[0]\0$ARGV[1]&quot;);&lt;br /&gt;exit 0;&lt;br /&gt;&lt;br /&gt;這裡用帳號test 密碼做示範&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;root@tsl3a ~# ./encode.pl test 123456&lt;br /&gt;dGVzdAB0ZXN0ADEyMzQ1Ng==&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;&lt;/span&gt;&lt;br /&gt;用auth 命令再貼上認證用的字串，出現Authentication successful 就代表成功了。&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#33cc00;&quot;&gt;root@tsl3 ~# telnet 127.0.0.1 25&lt;br /&gt;220 tsl3.test.com.tw ESMTP Postfix (Trustix)&lt;br /&gt;ehlo test.com&lt;br /&gt;250-tsl3.test..com.tw&lt;br /&gt;250-PIPELINING&lt;br /&gt;250-SIZE 10240000&lt;br /&gt;250-VRFY&lt;br /&gt;250-ETRN&lt;br /&gt;250-AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5&lt;br /&gt;250-AUTH=PLAIN LOGIN DIGEST-MD5 CRAM-MD5&lt;br /&gt;250 8BITMIME&lt;br /&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;AUTH PLAIN dGVzdAB0ZXN0ADEyMzQ1Ng== &lt;/span&gt;&lt;br /&gt;235 Authentication successful &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;如果你有所使用的帳號是有含網域名稱的例如 user@domain.tld，在做smtp 認證的時候會有問題，rimap模組是不支援多重網域的，他會把帳號的domain.tld 當作realm所以會發生下面的無法認證成功錯誤。&lt;br /&gt;Oct 3 03:47:38 tsl3 saslauthd[1560]: do_auth : auth failure: [user=test] [service=postfix] [realm= domain.tld] [mech=rimap] [reason=remote server rejected your credentials]&lt;br /&gt;我試著將smtp認證的帳號改為user@domain.tld@domain.tld就可以通過了，所以如果使用者是用outlook express寄信的話，smtp伺服器驗證的帳號就不能跟pop3的一樣了。&lt;br /&gt;&lt;br /&gt;參考資料:&lt;br /&gt;http://www.trustix.org/wiki/index.php/Main_Page#Mail_Services&lt;br /&gt;http://www.postfix.org/docs.html&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:0;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size:0;&quot;&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://biegoplay.blogspot.com/feeds/112879574202118746/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/17622600/112879574202118746' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/112879574202118746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17622600/posts/default/112879574202118746'/><link rel='alternate' type='text/html' href='http://biegoplay.blogspot.com/2005/10/trustix-30-postfix-sasl-smtp.html' title='使用Trustix 3.0 架設郵件伺服器(Postfix + SASL SMTP認證 + MYSQL+Courier-imapd)'/><author><name>bie</name><uri>http://www.blogger.com/profile/17584944644598935164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>