顯示具有 tftp 標籤的文章。 顯示所有文章
顯示具有 tftp 標籤的文章。 顯示所有文章

2017年6月4日 星期日

[tftp] Open TFTP Server

Download package Open TFTP Server


Edit configuration (opentftp.ini)
[HOME]
#You should specify home directory(s) here
#You can specify one directory as home
#directory, from where files will be served or
#deposited like:-
/home/happy/tftp

#Clients can only create new files if write is
#set to Y, default is N
Write=Y

#Clients can only overwrite existing files if
#overwrite is set to Y, default is N
Overwrite=Y


Start Daemon
sudo ./opentftpd -i opentftp.ini -l a.txt -v


Reference:

2013年12月19日 星期四

[Raspberry Pi][tftpd-hpa] Install tftpd-hpa and settings for working properly


[Raspberry Pi][tftpd-hpa] Install tftpd-hpa and settings for working properly



1. Install tftpd-hpa

sudo apt-get --yes --force-yes install tftp-hpa tftpd-hpa



2. vim /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"

TFTP_DIRECTORY="/srv/tftp"

TFTP_ADDRESS="0.0.0.0:69"

TFTP_OPTIONS="--secure --ipv4 --verbose -l"

RUN_DEAMON="yes"



3. Start the daemon

sudo service tftpd-hpa restart





Reference:



2012年10月9日 星期二

[ubuntu][bash script][tftp][third tried] ubuntu tftp setup bash script - tftp-hpa tftpd-hpa


[ubuntu][bash script][tftp][third tried] ubuntu tftp setup bash script-  tftp-hpa tftpd-hpa



vim tftp-hpa.sh



Copy and paste the bash script like below.



Excute the script, then enviroment will set up.





#!/bin/bash



cd ~

mkdir tftp

sudo chmod 777 -R tftp





if ! test -e ~/tftpd-hpa; then

touch tftpd-hpa

echo "TFTP_USERNAME="tftp"" >> ~/tftpd-hpa

echo "TFTP_DIRECTORY="/home/freeman/tftp"" >> ~/tftpd-hpa

echo "TFTP_ADDRESS="0.0.0.0:69"" >> ~/tftpd-hpa

echo "TFTP_OPTIONS="-l -c -s"" >> ~/tftpd-hpa

fi



sudo cp ~/tftpd-hpa /etc/default/



echo "sudo service tftpd-hpa restart"


 


2012年8月1日 星期三

[ubuntu][tftp][third tried] ubuntu tftp setup -  tftp-hpa tftpd-hpa


1. Install tftp-hpa tftpd-hpa

sudo apt-get install tftp-hpa tftpd-hpa

2. Creat a folder under home of user.

cd ~
mkdir tftp
sudo chmod 777 -R tftp

Method 1:
Modify configuration file.


vim /etc/default/tftpd-hpa

# /etc/default/tftpd-hpa
TFTP_DIRECTORY="/home/freeman/tftp"
TFTP_ADDRESS="0.0.0.0:69"
#TFTP_OPTIONS="--secure"
TFTP_OPTIONS="-l -c -s"

Service start.

sudo service tftpd-hpa restart

Method 2:

Service start.

sudo /usr/sbin/in.tftpd --listen --address 0.0.0.0:69 -l -c -s /home/freeman/tftp/

3. Test enviroment.


Create a file name "download.txt" at tftp folder

A. Download

tftp> get download.txt
tftp> q


B. Upload

tftp> put upload.txt
tftp> q

Question:

Q:  Error code 2: Only absolute filenames allowed
A:  sudo in.tftpd -l /home/happy/tftp(depend on which server folder you place)

Q:  If tftpd can't work
     ps -aux | grep tftpd (can't see the process)
A: In the terminal, please type follow command
/usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 -l -c -s /home/freeman/tftp

Reference:


Bash script
# Configuration tftpd (Bash script)
bash -c 'mkdir ~/tftp'
bash -c 'echo "TFTP_USERNAME="tftp"" >> ~/tftpd-hpa >>  ~/tftpd-hpa'
bash -c 'echo "TFTP_DIRECTORY="/home/freeman/tftp"" >> ~/tftpd-hpa'
bash -c 'echo "TFTP_ADDRESS="0.0.0.0:69"" >> ~/tftpd-hpa'
bash -c 'echo "TFTP_OPTIONS="-l -c -s"" >> ~/tftpd-hpa'
bash -c 'sudo cp ~/tftpd-hpa /etc/default/'
bash -c 'sudo service tftpd-hpa restart'

2012年2月22日 星期三

[ubuntu][tftp] ubuntu tftp setup - xinetd tftpd tftp

1. Install tftpd and related packages.

$ sudo apt-get install xinetd tftpd tftp

2. Create /etc/xinetd.d/tftp and put this entry:

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no

 

service tftp

{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /home/freeman/tftp
disable = no
}
 

3. Make /tftpboot directory

$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot

4. Start tftpd through xinetd

$ sudo /etc/init.d/xinetd start or sudo /etc/init.d/xinetd restart

Reference:

2012年1月10日 星期二

[tftp Question] Received Error Code 2: Access violation


Q: Received Error Code 2: Access violation



Destination: a5f00000



Destination: a5f00000

Starting TFTP of ecram_sto.bin from 192.168.100.20

Getting ecram_sto.bin using octet mode

Received Error Code 2: Access violation

Aborting TFTP session...

 



A:

(1) Privilege of directory (/tftp) or transfer file

So you can change privilege of
directory (/tftp) or transfer file.



Ex :

chmod 777 -R /tftp (Change privilege to all user can use)


 

2011年10月4日 星期二

[ubuntu][tftp] ubuntu tftp setup - openbsd-inetd tftp tftpd




在 Ubuntu 上安裝 tftpd 伺服器是一件非常簡單的事,首先執行以下這個指令安裝需要的套件:




sudo apt-get install tftp tftpd openbsd-inetd




然後再執行以下的指令啟動 openbsd-inetd:




sudo /etc/init.d/openbsd-inetd start




nano /etc/inetd.conf

tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /home/freeman/tftp

(/home/freeman/tftp change what folder you want)



基本上,這樣就可以使用 tftpd 了。不過,由於 Ubuntu 的 openbsd-inetd 預設將 tftpd 的路徑指定為 /srv/tftp,我覺得有點不大方便,因此通常習慣再去修改 /etc/inetd.conf,將 /srv/tftp 修改成 /tmp/tftproot,這樣一來,我也不用再去理會 /srv 這個目錄的權限,只要將要藉由 tftp 傳送的檔案直接複製到 /tmp/tftproot 目錄就行了,更方便許多呢!



Reference :