- Wiki МЕНТОР ЭЛЕКТРОНИКС
- Инструменты пользователя
- Инструменты сайта
- Боковая колонна
- Содержание
- Установка и настройка Linux утилит
- Установка и настройка TFTP-сервера в Fedora Core
- Installing and setting TFTPD in Ubuntu
- Настройка и установка NFS в Fedora Core
- Настройка и установка NFS в Ubuntu
- How To Install, Configure, and Run Linux Tftp Client?
- Install Tftp
- Ubuntu, Debian, Mint, Kali:
- Fedora, CentOS, RedHat:
- tftp Command Syntax
- tftp Command Help
- Connect TFTP Server From Command Line
- TFTP Server Command Line Interactive Shell
- Upload or Put File To The TFTP Server
- Download or Get File From TFTP Server
- Show TFTP Connection Status
- Disconnect From TFTP Server by Exiting From TFTP Shell
- Verbose Mode
- shamil / tftp_fedora.md
- This comment has been minimized.
- berndbausch commented Jun 20, 2018 •
- This comment has been minimized.
- zetaomegagon commented Nov 29, 2018
- How to set up a TFTP server on Fedora
- Contribute at Fedora Linux 35 Upgrade, Virt, Cloud, IoT, and CoreOS test days
- MAKE MORE with Inkscape – Stroke Fonts
- Announcing the release of Fedora Linux 35 Beta
- TFTP server installation
- Making local changes
- Starting the TFTP server
- Client Configuration
- Like this:
- Curt Warfield
- 13 Comments
- Edgar Hoch
- Curt Warfield
Wiki МЕНТОР ЭЛЕКТРОНИКС
Инструменты пользователя
Инструменты сайта
Боковая колонна
Содержание
Установка и настройка Linux утилит
Установка и настройка TFTP-сервера в Fedora Core
Процедура проверена в Fedora Core 9
Для установки у настройки TFTP сервера необходимы права суперпользователя (root), которые лучше получать с помощью команды «sudo». Для этого необходимо установить пакет «sudoers».
1) Установка пакета
2) Настройка конфигурации
3) Добавляем tftp в список служб, автоматически стартуемых при загрузке Linux:
4) Выключаем SELINUX Данная операция может быть потенциально опасной!
В файле »/etc/selinux/config» меняем значение переменной SELINUX на «disabled»:
Также надо обязательно разрешить порт TFTP в iptables (или выключить iptables командой: /etc/rc.d/init.d/iptables stop)
5) Проверка работы TFTP сервера
Этот способ проверки может и не работать. Лучше всего убедится в работоспособности TFTP с помощью команд u-boot.
Если в текущей директории появился файл «test», то TFTP сервер работает корректно
Installing and setting TFTPD in Ubuntu
by David Sudjiman
March 27th, 2006. Filed under: Linux.
Настройка и установка NFS в Fedora Core
1) Установка пакета
2) Настройка конфигурации В этом файле содержится описание директорий, которые будут доступны для монтирования по NFS:
Пример записи в файле »/etc/exports», позволяющий монтировать директорию с файловой системой для Embedded Linux:
rw — возможность чтения и записи содержимого директории
no_root_squash — доступ к файлам с правами суперпользователя (root)
no_all_squash — сохранение uids и gids пользователя файлам
sync — NFS отвечает на запросы лишь после модификации файлов
3) Запуск службы NFS
Должны появится следующие надписи:
В случае, если NFS запускается в первый раз, то вместо «service nfs restart» необходимо написать «service nfs start».
Процедуру «restart» необходимо выполянть каждый раз, когда вы меняете записи в »/etc/exports».
4) Проверка NFS
Чтобы убедиться, что директории экспортированы, надо выполнить команду:
Если какие-либо директории из файла »/etc/exports» отсутствуют, то проверьте конфигурацию в файле.
5) Включение службы NFS
После выполнения этой команды NFS сервер будет стартовать автоматически для уровней выполнения 3, 4 и 5.
Настройка и установка NFS в Ubuntu
Настраиваем, какие именно директории мы хотим открыть для совместного пользования и кому. Все это делается в файле /etc/exports:
В приведенном ниже примере я выделил директорию /data (директория с данными на сервере) в совместное пользование всем компьютерам с правами чтения и записи:
домашняя директория пользователя serhiy стала доступной в режиме только чтение для компьютера с IP 192.168.1.34. Все остальные компьютеры сети к этому разделу доступа не имеют.
ro — права только на чтение. Можно и не указывать, так как она установлена по умолчанию.
rw — дает клиентам право на запись.
no_root_squash — по умолчанию пользователь root на клиентской машине не будет иметь доступа к разделяемой директории сервера. Этой опцией мы снимаем это ограничение. В целях безопасности этого лучше не делать.
noaccess — запрещает доступ к указанной директории. Может быть полезной, если перед этим вы задали доступ всем пользователям сети к определенной директории, и теперь хотите ограничить доступ в поддиректории лишь некоторым пользователям.
Теперь нужно перезапустить nfs-kernel-server:
Если после этого вы захотите поменять что-нибудь в файле /etc/exports, то для того, чтобы изменения вступили в силу, достаточно запустить следующую команду:
Источник
How To Install, Configure, and Run Linux Tftp Client?
Tftp (Trivial File Transfer Protocol) is a very simple client-server protocol used to transfer data and files over the network. Ftp is a very popular protocol but it has a lot of features that may not be needed always. Tftp is a lightweight alternative to Ftp protocol. We can say that Tftp is a featureless protocol because it only downloads and uploads files.
- Tftp has no authentication or authorization mechanism.
- Tftp protocol does not have a file listing feature.
- Tftp is clear text or not encrypted protocol
- Tftp is fast and simple to implement
- TFTP uses generally UDP
Install Tftp
The installation of Tftp tools is as simple as the protocol. As TFTP lightweight there is no dependency for other libraries.
Ubuntu, Debian, Mint, Kali:
We will install tftp for Debian, Mint, Ubuntu and Kali like below.
Fedora, CentOS, RedHat:
We can install tftp with the following command on Fedora, CentOS, RedHat.
tftp Command Syntax
We will use following syntax for tftp command in normal command-line usage.
tftp Command Help
Connect TFTP Server From Command Line
Connecting to the Tftp server is very easy. As stated at the beginning of the post Tftp does not have any authentication and authorization mechanisms. so Just providing the hostname of the server of IP address is enough to connect the Tftp server. In this example, we will connect 192.168.122.239 IP address.
TFTP Server Command Line Interactive Shell
After connection to the Tftp server, we will get an interactive shell. In this shell, we will issue commands to get information about status of the connection, download or get files, upload, or put files to the server. We can list available commands provided by Tftp shell with ? .
Upload or Put File To The TFTP Server
We can upload or put files to the TFTP server with the put command. In the example, we upload a file named body.txt
Download or Get File From TFTP Server
We can also download or get files from the Tftp server to get command. In the example, we get a file named body.txt from the Tftp server.
Show TFTP Connection Status
As TFTP works generally on the UDP protocol there is no session like TCP. But we can query current connection status with the status command. This status command will provide us information about the connected server IP address, current working mode, Rexmt-interval, Max-timeout, etc.
Disconnect From TFTP Server by Exiting From TFTP Shell
In order to quit from the Tftp shell we need to issue the q command.
Verbose Mode
While making transfer we may need more information about the transmission. We can get more information about the transfer with the verbose mode.
Источник
shamil / tftp_fedora.md
TFTP server on Fedora
Here are some quick notes on setting up a TFTP server on Fedora 23. This is used, for example, to send Linux kernel images and other binaries to a bootloader on an embedded system.
First, install the packages:
The tftp itself will allow you to test your configuration by attempting a file transfer. The default directory for TFTP transfers is /var/lib/tftpboot .
The TFTP server works through xinetd so you will need to add a rule that says in.tftpd: ALL to /etc/hosts.allow :
Enable and start the TFTP server:
Tell the firewall to allow TFTP traffic:
You should now be able to transfer files via TFTP.
This comment has been minimized.
Copy link Quote reply
berndbausch commented Jun 20, 2018 •
Very useful, but doesn’t work anymore in this way on Fedora 28. It seems to me that firewall-cmd isn’t aware of a change in Netfilter policies since one of the more recent kernel revisions.
firewall-cmd —add-service tftp results in this kernel message:
nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based firewall rule not found. Use the iptables CT target to attach helpers instead.
When trying to connect, the tftp client then gets an ICMP message «port unreachable».
I also tried firewall-cmd —set-automatic-helpers=yes with little change (the ICMP message becomes «admin prohibited»).
I guess for now I have to use ipfilter to tweak the rules.
This comment has been minimized.
Copy link Quote reply
zetaomegagon commented Nov 29, 2018
firewall-cmd —add-service tftp —permanent is incorrect syntax. It should be firewall-cmd —add-service=tftp —permanent . They missed the = sign.
This has been the syntax since at least F24 (when I started using Fedora).
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
How to set up a TFTP server on Fedora
Contribute at Fedora Linux 35 Upgrade, Virt, Cloud, IoT, and CoreOS test days
MAKE MORE with Inkscape – Stroke Fonts
Announcing the release of Fedora Linux 35 Beta
TFTP, or Trivial File Transfer Protocol, allows users to transfer files between systems using the UDP protocol. By default, it uses UDP port 69. The TFTP protocol is extensively used to support remote booting of diskless devices. So, setting up a TFTP server on your own local network can be an interesting way to do Fedora installations, or other diskless operations.
TFTP can only read and write files to or from a remote system. It doesn’t have the capability to list files or make any changes on the remote server. There are also no provisions for user authentication. Because of security implications and the lack of advanced features, TFTP is generally only used on a local area network (LAN).
TFTP server installation
The first thing you will need to do is install the TFTP client and server packages:
This creates a tftp service and socket file for systemd under /usr/lib/systemd/system.
Next, copy and rename these files to /etc/systemd/system:
Making local changes
You need to edit these files from the new location after you’ve copied and renamed them, to add some additional parameters. Here is what the tftp-server.service file initially looks like:
Make the following changes to the [Unit] section:
Make the following changes to the ExecStart line:
Here are what the options mean:
- The -c option allows new files to be created.
- The -p option is used to have no additional permissions checks performed above the normal system-provided access controls.
- The-s option is recommended for security as well as compatibility with some boot ROMs which cannot be easily made to include a directory name in its request.
The default upload/download location for transferring the files is /var/lib/tftpboot.
Next, make the following changes to the [Install] section:
Don’t forget to save your changes!
Here is the completed /etc/systemd/system/tftp-server.service file:
Starting the TFTP server
Reload the systemd daemon:
Now start and enable the server:
To change the permissions of the TFTP server to allow upload and download functionality, use this command. Note TFTP is an inherently insecure protocol, so this may not be advised on a network you share with other people.
Configure your firewall to allow TFTP traffic:
Client Configuration
Install the TFTP client:
Run the tftp command to connect to the TFTP server. Here is an example that enables the verbose option:
Remember, TFTP does not have the ability to list file names. So you’ll need to know the file name before running the get command to download any files.
Like this:
Curt Warfield
13 Comments
Edgar Hoch
What crazy description for tftp configuration do you release into the world? Why should anyone be allowed to upload any files to the server without any restrictions? What application is there that requires this and you can’t use a more secure method (with authentication and authorization)?
You don’t need this to boot devices over the network. The only thing you need to do, apart from installing the packages, is to enable the socket with “systemctl enable -now tftpd.socket” and place the files needed for booting over the network in /var/lib/tftpboot/ or a subdirectory in it, preferably as owner and group root and only writeable for root and readable for all.
You should NOT make /var/lib/tftpboot/ writeable for all. You should NOT use the -c option. You don’t need to make a copy of tftpd.server and tftpd.socket in /etc/systemd/system/; if you want to make local changes, create a directory /etc/systemd/system/tftpd.server.d/ and create a file in it with the extension “.conf”, where you just enter the change – see “man systemd.unit”. This could be used, for example, to make changes to the options when calling the service:
[Service]
ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpboot
Do NOT enter “WantedBy=multi-user.target”! You also don’t activate the tftpd.service, but tftpd.socket (see above). This has the advantage that the service only runs and occupies resources when it is needed (and after some time of inactivity (default 15 minutes) it stops itself).
Why should someone use the tftp client to download a file like server.logs (as in your example)? Somebody has to put the file there first.
TFTP is only needed for booting devices over the network, usually with PXE – to load a boot kernel, grub, or similar. Everything else the device should do via other services.
People should only use the tftp client to test the connection. Upload or download files to a server should only be done via secure services, e.g. ssh / scp / sftp / rsync via ssh or via network file systems.
Curt Warfield
Thank-you for taking the time to bring up some valid concerns.
The intent of the article was not meant to try to ask anyone to embrace tftp or to even suggest it should be anyone’s first choice. I would not expect any enterprise environments to ever use this in production.
This article was written as more of a way to just show how to configure a legacy application such as this.
It was even noted in the article that it is not a secure method of uploading files:
“There are also no provisions for user authentication. Because of security implications and the lack of advanced features, TFTP is generally only used on a local area network (LAN). ”
“Note TFTP is an inherently insecure protocol, so this may not be advised on a network you share with other people.”
But I have come across occasions where I’ve been asked how to set this up even with my recommendation to use a more secure method.
Источник