본문 바로가기

Operating Systems/Linux

[ Linux ] TFTP 서버 설치

1. CentOS7

 

[ TFTP 서버 ]

yum -y install tftp-server xinetd

mkdir -p /app/repo/tftp

chmod 777 /app/repo/tftp

cat <<TFTP_SETTING > /etc/xinetd.d/tftp
service tftp
{
	socket_type             = dgram
	protocol                = udp
	wait                    = yes
	user                    = root
	server                  = /usr/sbin/in.tftpd
	server_args             = -c -v -s /app/repo/tftp
	disable                 = no
	per_source              = 11
	cps                     = 100 2
	flags                   = IPv4
}
TFTP_SETTING

systemctl restart xinetd

systemctl enable xinetd

lsof -P -i udp:69

firewall-cmd --permanent --add-port=69/udp

firewall-cmd --reload

firewall-cmd --list-all

getsebool -a | grep tftp

semanage permissive -a tftpd_t

setsebool -P tftp_anon_write 1

setsebool -P tftp_home_dir 1

echo "This File was created by the TFTP Server" > /app/repo/tftp/file01

chmod 777 /app/repo/tftp/file01

ip route

 

[ 리눅스 클라이언트 ]

yum -y install tftp

TFTP_SERVER_IP=192.168.108.50

mkdir -p /app/tmp

cd /app/tmp

firewall-cmd --direct --permanent --add-rule ipv4 raw OUTPUT 0 -j CT -p udp --helper tftp

firewall-cmd --reload

firewall-cmd --list-all

tftp ${TFTP_SERVER_IP} -c get file01

cat file01

echo -e "\nThis File has been changed in linux client" >> file01

tftp ${TFTP_SERVER_IP} -c put file01

 

[ 윈도우 클라이언트 ]

TFTP 서버 다운로드 요청
성공 메시지 확인
TFTP 서버 다운로드 확인
TFTP 서버 업로드 내역 작성
TFTP 서버 파일 업로드
TFTP 서버 변경 확인

2. Ubuntu20

 

[ TFTP 서버 ]

apt-get install tftpd-hpa xinetd

cat <<TFTP_SETTING > /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/app/repo/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
TFTP_SETTING

mkdir -p /app/repo/tftp

chmod 777 /app/repo/tftp

cat <<TFTP_SETTING > /etc/xinetd.d/tftp
service tftp
{
	socket_type             = dgram
	protocol                = udp
	wait                    = yes 
	user                    = root
	server                  = /usr/sbin/in.tftpd
	server_args             = -c -p -s /app/repo/tftp
	disable                 = no
	per_source              = 11
	cps                     = 100 2
	flags                   = IPv4
}
TFTP_SETTING

systemctl disable tftpd-hpa

systemctl stop tftpd-hpa

systemctl restart xinetd

systemctl enable xinetd

lsof -P -i udp:69

ufw allow 69/udp

ufw status

echo "This File was created by the TFTP Server" > /app/repo/tftp/file01

chmod 777 /app/repo/tftp/file01

 

[ 리눅스 클라이언트 ]

apt-get install tftp-hpa

TFTP_SERVER_IP=192.168.108.20

mkdir -p /app/tmp

cd /app/tmp

iptables -t raw -A OUTPUT -p udp -j CT --helper tftp

ufw reload

tftp ${TFTP_SERVER_IP} -c get file01

cat file01

echo -e "\nThis File has been changed in linux client" >> file01

tftp ${TFTP_SERVER_IP} -c put file01

 

'Operating Systems > Linux' 카테고리의 다른 글

[ Linux ] SAMBA 서버 설치  (0) 2021.10.16
[ Linux ] FTP 서버 설치  (0) 2021.10.15
[ Linux ] Quota 활용  (0) 2021.10.02
[ Linux ] LVM 활용  (0) 2021.10.01
[ Linux ] ORACLE 19c 서버 설치  (0) 2021.09.30