Table of Contents
1 tftpをインストールする
tftpパッケージをインストールします。デフォルトで/srv/tftpbootがTFTPサーバのディレクトリとして使われます。
$ sudo zypper -n in tftp$ sudo systemctl enable tftp.socket
ファイアウォールでtftpのサービスを開放します。
$ for t in FW_CONFIGURATIONS_EXT FW_CONFIGURATIONS_DMZ FW_CONFIGURATIONS_INT; do sudo sed -e “s/^${t}=”(.*)”/${t}=”1 tftp”/g” -i /etc/sysconfig/SuSEfirewall2done$ sudo systemctl restart SuSEfirewall2
tftp.socketのために一度再起動します。
$ sudo reboot
2 tftpでファイルをGETする
/srv/tftpbootにファイルを置きます。
$ echo “hello” | sudo tee /srv/tftpboot/hello.txt
TFTPクライアントのtftpでTFTPサーバからファイルをGETします。
$ echo “get hello.txt” | tftp 127.0.0.1tftp> get hello.txttftp>$ cat hello.txthello