[[サーバ関連]]
目次~
#contents
**概要 [#gc579bfb]
TFTPサービスのインストール手順。
**環境情報 [#l8ae6812]
|BGCOLOR(#CCCCCC):OS|Rocky Linux release 8.9|
|BGCOLOR(#CCCCCC):TFTP|tftp-server-5.2-26.el8.x86_64|
**インストール手順 [#d69027c9]
-パッケージインストール
dnf install -y tftp-server tftp
~
--実行結果
====================================================================================================================================
パッケージ アーキテクチャー バージョン リポジトリー サイズ
====================================================================================================================================
インストール:
tftp x86_64 5.2-26.el8 appstream 41 k
tftp-server x86_64 5.2-26.el8 appstream 49 k
トランザクションの概要
====================================================================================================================================
インストール 2 パッケージ
ダウンロードサイズの合計: 91 k
インストール後のサイズ: 115 k
パッケージのダウンロード:
scriptletの実行中: tftp-server-5.2-26.el8.x86_64 1/2
インストール中 : tftp-5.2-26.el8.x86_64 2/2
scriptletの実行中: tftp-5.2-26.el8.x86_64 2/2
検証 : tftp-5.2-26.el8.x86_64 1/2
検証 : tftp-server-5.2-26.el8.x86_64 2/2
インストール済み:
tftp-5.2-26.el8.x86_64 tftp-server-5.2-26.el8.x86_64
完了しました!
-設定ファイルの作成
cp /usr/lib/systemd/system/tftp.service /etc/systemd/system/tftp-server.service
cp /usr/lib/systemd/system/tftp.socket /etc/systemd/system/tftp-server.socket
-起動設定の投入
tee /etc/systemd/system/tftp-server.service<<EOF
[Unit]
Description=Tftp Server
Requires=tftp-server.socket
Documentation=man:in.tftpd
[Service]
ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
StandardInput=socket
[Install]
WantedBy=multi-user.target
Also=tftp-server.socket
EOF
-サービスの起動
systemctl daemon-reload
systemctl enable --now tftp-server
~
--実行結果
Created symlink /etc/systemd/system/multi-user.target.wants/tftp-server.service → /etc/systemd/system/tftp-server.service.
Created symlink /etc/systemd/system/sockets.target.wants/tftp-server.socket → /etc/systemd/system/tftp-server.socket.
-サービスの動作確認
systemctl status tftp-server
~
--実行結果
● tftp-server.service - Tftp Server
Loaded: loaded (/etc/systemd/system/tftp-server.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2024-01-08 11:39:39 JST; 5s ago
Docs: man:in.tftpd
Main PID: 3992 (in.tftpd)
Tasks: 1 (limit: 23012)
Memory: 180.0K
CGroup: /system.slice/tftp-server.service
└─3992 /usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
1月 08 11:39:39 mgt-sv systemd[1]: Started Tftp Server.
-ディレクトリの権限変更
chmod 777 /var/lib/tftpboot
-Firewallポリシーの追加(必要な場合)
firewall-cmd --add-service=tftp --permanent
firewall-cmd --reload
*操作 [#jaab95ea]
**基本操作 [#l468aa53]
-接続
tftp [SERVER IP]
-ファイルの取得
tftp> get [FILENAME]