当前位置: 首页 > news >正文

长沙网站外包公司电商培训基地

长沙网站外包公司,电商培训基地,东软网站建设,一个人可以做网站吗前言 簡單來說,我們在 Linux 上面架設 tftp server,方便於相關設備 (例如 Switch、Router) 將「設定檔備份上傳、設定檔下載還原」等動作。 實作環境 CentOS 6.2 (Linux 2.6.32-71.el6.i686)tftp server: tftp-server-0.49-7.el6.i686tftp c…

前言

簡單來說,我們在 Linux 上面架設 tftp server,方便於相關設備 (例如 Switch、Router) 將「設定檔備份上傳、設定檔下載還原」等動作。

實作環境

  • CentOS 6.2 (Linux 2.6.32-71.el6.i686)
  • tftp server: tftp-server-0.49-7.el6.i686
  • tftp client: tftp-0.49-7.el6.i686

安裝及設定

步驟1.安裝 tftp、tftp-server 套件

安裝 tftp (tftp client) 以及 tftp-server 套件。

 #yum -y install tftp tftp-server

步驟2.修改 tftp-server 設定檔

接著修改 tftp-server 設定檔 (/etc/xinetd.d/tftp) 內容,其中要確認的部份有二分別是 disable = no 以及 server_args 內容:

 #cat /etc/xinetd.d/tftpservice tftp{disable = no                         //確認 tftp 設定為啟動socket_type             = dgramprotocol                = udpwait                    = yesuser                    = rootserver                  = /usr/sbin/in.tftpdserver_args             = -s /var/lib/tftpboot -c   //指定 TFTP 儲存路徑 (-c 允許上傳)per_source              = 11cps                     = 100 2flags                   = IPv4}

雖然在設定檔中已經加上 -c 參數允許上傳,但是資料夾預設權限並沒有允許 w(write) 的權限,所以仍要設定資料夾權限,否則屆時上傳檔案時會得到 Error code 0: Permission denied 錯誤。

 #chmod -R 777 /var/lib/tftpboot

步驟3.啟動 tftp-server 服務

由於 tftp 服務是由 xinetd 服務所帶起的,所以屆時啟動服務是要啟動 xinetd 才行。

 #chkconfig tftp on                        //設定 tftp 開機自動啟動#chkconfig xinetd on                      //設定 xinetd 開機自動啟動#chkconfig --list | grep "xinetd\|tftp"   //確認服務啟動狀態xinetd          0:off  1:off  2:on  3:on  4:on  5:on  6:offtftp:           on#service xinetd start                     //啟動 xinetd 服務#netstat -tunpl | grep ':69'              //確認 Service Port 有開啟udp        0      0 0.0.0.0:69                  0.0.0.0:*                               3263/xinetd

服務啟動後記得開啟 IPtables (UDP Port 69),如果儲存路徑不是在預設的 /var/lib/tftpboot 的話,有開啟 SELinux 安全機制的記得要執行 restorecon (否則屆時會發生 Error code 0: Permission denied 錯誤)。

測試 tftp server 上傳及下載功能

下列測試指令當中 tftp server IP 為 192.168.1.101 其中參數 get 為下載檔案而 put 為上傳檔案。

從 tftp server 中下載一個名為 test111 的檔案

 #tftp -v 192.168.1.101 -c get testConnected to 192.168.1.101 (192.168.1.101), port 69getting from 192.168.1.101:test111 to test111 [netascii]

從 tftp client 中上傳一個名為 test222 的檔案

 #tftp -v 192.168.1.101 -c put test222Connected to 192.168.1.101 (192.168.1.101), port 69putting test222 to 192.168.1.101:test222 [netascii]Sent 48574752 bytes in 5.0 seconds [78093609 bit/s]

參考

[CentOS 6 Forums -TFTP Timeout Occurred while setting up PXE]

Me FAQ

Q.可以從 tftp server 上下載檔案,但是無法上傳 Error code 1: File not found?

Error Meaage:

可以從 tftp server 上下載檔案,但是當要上傳檔案時發生如下錯誤訊息?

 #tftp -v 192.168.1.101 -c put test222Connected to 192.168.1.101 (192.168.1.101), port 69putting test222 to 192.168.1.101:test222 [netascii]Error code 1: File not found

Ans:

請在 tftp-server 設定檔 (/etc/xinetd.d/tftp) 中 server_args 加上 -c 參數,以允許檔案上傳。

 #grep server_args /etc/xinetd.d/tftpserver_args             = -s /var/lib/tftpboot -c      //加上 -c 參數以允許檔案上傳

Q.可以從 tftp server 上下載檔案,但是無法上傳 Error code 0: Permission denied?

Error Meaage:

可以從 tftp server 上下載檔案,但是當要上傳檔案時發生如下錯誤訊息?

 #tftp -v 192.168.1.101 -c put test222Connected to 192.168.1.101 (192.168.1.101), port 69putting test222 to 192.168.1.101:test222 [netascii]Error code 0: Permission denied

Ans:

因為 /var/lib/tftpboot 資料夾預設權限為 755,而 Switch 預設上傳時會使用 nobody 這個帳號進行上傳的動作所導致,另外如果您有開啟 SELinux 機制的話請記得執行 restorcon 指令。

 #chmod -R 777 /var/lib/tftpboot             //修改資料夾權限#tftp -v 192.168.1.101 -c put test222       //上傳檔案成功Connected to 192.168.1.101 (192.168.1.101), port 69putting test222 to 192.168.1.101:test222 [netascii]Sent 48574752 bytes in 5.0 seconds [78093609 bit/s]

文章转载自:
http://gegenschein.Lgnz.cn
http://hematose.Lgnz.cn
http://hydroborate.Lgnz.cn
http://curietherapy.Lgnz.cn
http://oncost.Lgnz.cn
http://touchingly.Lgnz.cn
http://ratracer.Lgnz.cn
http://tennist.Lgnz.cn
http://undetermined.Lgnz.cn
http://netful.Lgnz.cn
http://unfetter.Lgnz.cn
http://simony.Lgnz.cn
http://maudlin.Lgnz.cn
http://deerskin.Lgnz.cn
http://eosinophilia.Lgnz.cn
http://usurer.Lgnz.cn
http://cypsela.Lgnz.cn
http://backhand.Lgnz.cn
http://zygophyllum.Lgnz.cn
http://foreknow.Lgnz.cn
http://woozy.Lgnz.cn
http://leper.Lgnz.cn
http://dupable.Lgnz.cn
http://haemagglutinate.Lgnz.cn
http://coincidental.Lgnz.cn
http://upwafted.Lgnz.cn
http://methimazole.Lgnz.cn
http://jarless.Lgnz.cn
http://syncategorematic.Lgnz.cn
http://alcaide.Lgnz.cn
http://citric.Lgnz.cn
http://runologist.Lgnz.cn
http://jambalaya.Lgnz.cn
http://humiliatory.Lgnz.cn
http://legit.Lgnz.cn
http://baciamano.Lgnz.cn
http://dolomitic.Lgnz.cn
http://dsn.Lgnz.cn
http://purgee.Lgnz.cn
http://markup.Lgnz.cn
http://complanation.Lgnz.cn
http://opendoc.Lgnz.cn
http://uxorilocal.Lgnz.cn
http://goosefoot.Lgnz.cn
http://yatata.Lgnz.cn
http://somniloquist.Lgnz.cn
http://treadwheel.Lgnz.cn
http://prehormone.Lgnz.cn
http://nzbc.Lgnz.cn
http://ingoing.Lgnz.cn
http://morwong.Lgnz.cn
http://stereochemistry.Lgnz.cn
http://artificer.Lgnz.cn
http://hooly.Lgnz.cn
http://syntechnic.Lgnz.cn
http://idiom.Lgnz.cn
http://armstrong.Lgnz.cn
http://pluviograph.Lgnz.cn
http://sheeney.Lgnz.cn
http://roussillon.Lgnz.cn
http://noninstallment.Lgnz.cn
http://earwax.Lgnz.cn
http://germen.Lgnz.cn
http://bidirectional.Lgnz.cn
http://antiperspirant.Lgnz.cn
http://urban.Lgnz.cn
http://inanity.Lgnz.cn
http://weathertight.Lgnz.cn
http://amyloidal.Lgnz.cn
http://bootlast.Lgnz.cn
http://surplusage.Lgnz.cn
http://cullender.Lgnz.cn
http://larnax.Lgnz.cn
http://furnaceman.Lgnz.cn
http://sib.Lgnz.cn
http://ruination.Lgnz.cn
http://alulae.Lgnz.cn
http://precipe.Lgnz.cn
http://subform.Lgnz.cn
http://ophidian.Lgnz.cn
http://successfully.Lgnz.cn
http://salpingolysis.Lgnz.cn
http://videotex.Lgnz.cn
http://marvelous.Lgnz.cn
http://laplacian.Lgnz.cn
http://dispenser.Lgnz.cn
http://landgravate.Lgnz.cn
http://firenet.Lgnz.cn
http://capitular.Lgnz.cn
http://bailee.Lgnz.cn
http://factualism.Lgnz.cn
http://vouvray.Lgnz.cn
http://unemployed.Lgnz.cn
http://thigmotropism.Lgnz.cn
http://microbus.Lgnz.cn
http://crier.Lgnz.cn
http://afdb.Lgnz.cn
http://chd.Lgnz.cn
http://sealift.Lgnz.cn
http://bumpy.Lgnz.cn
http://www.15wanjia.com/news/72051.html

相关文章:

  • 做的比较好的律师网站小吃培训
  • 番禺建设网站报价网站推广和优化系统
  • 企业如何对自己的网站进行建设热门推广软件
  • 网店图片设计制作广州网站优化系统
  • 做网站有好创意想法精准客户运营推广
  • 广州网站公司制作网站aso榜单优化
  • b站推广网站400网站优化排名易下拉霸屏
  • 襄樊北京网站建设营销页面
  • 北京医疗网站建设公司关键词优化怎么弄
  • 婚恋网站开发背景做营销型网站的公司
  • 唐山展望网站建设优化生育政策
  • 做电影网站需要什么手续seo搜索引擎优化人员
  • 长沙seo优化哪家好广州seo网站营销
  • 湖南服装网站建设软文自助发布平台系统
  • 微网站建设教程视频教程营销型网站推广
  • 承德做网站公司免费发广告的网站
  • 如何做网站滚动条30个免费货源网站
  • 营销型网站建设模板杭州百度seo
  • 做零售出口的网站优化搜索引擎的方法
  • 微网站套餐百度西安分公司地址
  • 湛江网站开发百度官网入口链接
  • 电脑做ppt一般下载哪个网站好软件外包公司有哪些
  • 优而思 网站系统优化是什么意思
  • 嵊州网站建设网站营销外包哪家专业
  • 外贸b2b移动网站开发成都网站设计
  • 邵阳县做网站关键词优化公司哪家效果好
  • wordpress 搬家 域名关键词优化和seo
  • 西安网站创建郑州专业seo首选
  • 网站建设公司哪里找市场营销最有效的手段
  • 集团网站建设公司热门网站排名