您好,登錄后才能下訂單哦!
1. 修改inetd.conf,將tftp前面的注釋符號去掉,該行最后一個參數/tftpboot即為默認的工作目錄,可按需修改
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. 把服務添加到svc的控制列表中
inetconv -i /etc/inet/inetd.conf 1>/dev/null 2>&1
3. 創建相關目錄
# 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命令開啟服務
$ svcadm enable svc:/network/tftp/udp6:default
5. 檢測服務運行狀態:
$ 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
$
//////////////////////////注意
上傳文件時報錯: Error code 2: Access violation 是因為系統安全策略原因,需要在tftp工作目錄中創建了一個同名文件,并修改文件權限chmod 777
例如需要上傳文件名為 testfile.txt,服務端操作步驟如下:
cd /tftpboot
touch testfile.txt
vi testfile.txt ///不需要寫任何內容
chmod 777 testfile.txt
另外,因該目錄掛在根目錄,上傳文件前需要注意目錄剩余空間,并及時清理不需要的文件,或者更改tftp服務默認的工作目錄
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。