1.修改inetd.conf,將tftp前面的注釋符號(hào)去掉,該行最后一個(gè)參數(shù)/tftpboot即為默認(rèn)的工作目錄,可按需修改
創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè)、做網(wǎng)站、網(wǎng)站頁面設(shè)計(jì)、網(wǎng)站優(yōu)化SEO優(yōu)化為一體的專業(yè)網(wǎng)站制作公司,已為成都等多地近百家企業(yè)提供網(wǎng)站建設(shè)服務(wù)。追求良好的瀏覽體驗(yàn),以探求精品塑造與理念升華,設(shè)計(jì)最適合用戶的網(wǎng)站頁面。 合作只是第一步,服務(wù)才是根本,我們始終堅(jiān)持講誠(chéng)信,負(fù)責(zé)任的原則,為您進(jìn)行細(xì)心、貼心、認(rèn)真的服務(wù),與眾多客戶在蓬勃發(fā)展的市場(chǎng)環(huán)境中,互促共生。vi /etc/inetd.conf
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "@(#)inetd.conf 1.56 04/10/21 SMI"
#
# Legacy configuration file for inetd(1M). See inetd.conf(4).
#
# This file is no longer directly used to configure inetd.
# The Solaris services which were formerly configured using this file
# are now configured in the Service Management Facility (see smf(5))
# using inetadm(1M).
#
# Any records remaining in this file after installation or upgrade,
# or later created by installing additional software, must be converted
# to smf(5) services and imported into the smf repository using
# inetconv(1M), otherwise the service will not be available. Once
# a service has been converted using inetconv, further changes made to
# its entry here are not reflected in the service.
#
#
# CacheFS daemon. Provided only as a basis for conversion by inetconv(1M).
#
100235/1 tli rpc/ticotsord wait root /usr/lib/fs/cachefs/cachefsd cachefsd
# TFTPD - tftp server (primarily used for booting)
tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot
_tgw3_52200 stream tcp nowait root /opt/ericsson/bin/emt_tgw_telnetd emt_tgw_telnetd -h -P /opt/ericsson/bin
# IMH service for FM
#
IMH_com_rec stream tcp nowait nmsadm /etc/opt/ericsson/fm_core/startscript/IMH_com_rec IMH_com_rec
2.把服務(wù)添加到svc的控制列表中
inetconv -i /etc/inet/inetd.conf 1>/dev/null 2>&1
3.創(chuàng)建相關(guān)目錄
# mkdir /tftfboot ; ln -s /tftpboot/. /tftpboot/tftpboot
# chmod -R 777 /tftpboot
# ls -la /tftpboot
total 4
drwxrwxrwx. 2 root root 21 Oct 11 11:43 .
drwxr-xr-x. 19 root root 4096 Oct 11 11:43 ..
lrwxrwxrwx. 1 root root 11 Oct 11 11:43 tftpboot -> /tftpboot/.
4.用svcadm命令開啟服務(wù)
$ svcadm enable svc:/network/tftp/udp6:default
5.檢測(cè)服務(wù)運(yùn)行狀態(tài):
$ svcs -a |grep tftp
online Jan_11 svc:/network/tftp/udp6:default
$ netstat -a |grep tftp
*.tftp Idle
*.tftp Idle
$ lsof -i:69
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
inetd 2298 root 31u IPv6 0x60091ddbd40 0t0 UDP *:tftp
$
//////////////////////////注意
上傳文件時(shí)報(bào)錯(cuò): Error code 2: Access violation 是因?yàn)橄到y(tǒng)安全策略原因,需要在tftp工作目錄中創(chuàng)建了一個(gè)同名文件,并修改文件權(quán)限chmod 777
例如需要上傳文件名為 testfile.txt,服務(wù)端操作步驟如下:
cd /tftpboot
touch testfile.txt
vi testfile.txt ///不需要寫任何內(nèi)容
chmod 777 testfile.txt
另外,因該目錄掛在根目錄,上傳文件前需要注意目錄剩余空間,并及時(shí)清理不需要的文件,或者更改tftp服務(wù)默認(rèn)的工作目錄
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。