Tftp error code 2 received 16739

Конфигурирование маршрутизатора фирмы Cisco Systems в роли TFTP сервера

Привет всем читателям. Сегодня мы вместе с вами снова вернемся к протоколу TFTP и поговорим о том как превратить наш с вами маршрутизатор фирмы Cisco в TFTP сервер. Соглашусь с вами, что надобность в этом на практике возникает не очень часто, но все же лучше знать и уметь пользоваться данным функционалом, мало ли в жизни всякое бывает.

Конечно если есть необходимость в постоянном TFTP сервере, то лучше поднять его на отдельной машинке и тихо мирно работать с ним не трогая более важные устройства, такие как маршрутизаторы. Но иногда бывают моменты когда необходимо быстро перебросить всего несколько файлов с одного маршрутизатора на другой,  вот в таких случаях и пригодится умение конфигурировать ваш маршрутизатор в качестве TFTP сервера. Ведь согласитесь, быстрее ввести пару команд на одном маршрутизаторе, сделать его TFTP сервером и скопировать с него файлы с помощью TFTP клиента другого маршрутизатора, чем разворачивать где то в сети TFTP сервер, сначала копировать файлы с первого маршрутизатора на TFTP сервер, а уже потом скачивать с TFTP сервера файлы на другой маршрутизатор. Какая то двойная работа получается.

Разбирать конфигурирование маршрутизаторов фирмы Cisco в качестве TFTP сервера, мы опять же будем на примере, но в этот раз для симуляции сети мы будем использовать GNS3. Соберем в нем следующую простенькую схему, содержащую 3 маршрутизатора, имеющих как минимум по 2 Ethernet  интерфейса (в данном примере использован IOS от Cisco 2691 — c2691-advipservicesk9-mz.124-15.T6.bin):

Данная схема сети должна быть собрана в GNS3
Данная схема сети должна быть собрана в GNS3

Внесем в конфигурации маршрутизаторов следующие команды:

Маршрутизатор R1:

  R1(config)#interface fastEthernet 0/0

  R1(config-if)# ip address 192.168.1.2 255.255.255.252

  R1(config-if)#no shutdown

Маршрутизатор R2:

  R2(config)#interface fastEthernet 0/0

  R2(config-if)#ip address 192.168.1.1 255.255.255.252

  R2(config-if)# no shutdown

  R2(config)#interface fastEthernet 0/1

  R2(config-if)#ip address 192.168.2.1 255.255.255.252

  R2(config-if)#no shutdown

Маршрутизатор R3:

  R3(config)#interface fastEthernet 0/0

  R3(config-if)#ip address 192.168.2.2 255.255.255.252

  R3(config-if)#no shutdown

Как вы уже наверное поняли с помощью данных команды, мы с вами назначили IP адреса интерфейсам маршрутизатора, и как следствие установили связь между ними (проверить это можно с помощью команды ping). Настраивать маршрутизацию нет необходимости так как  в этот раз она нам не пригодится. Далее будем считать что наша заготовка для опытов готова и перейдем непосредственно к настройке TFTP сервера.



В простейшем случае, для того чтобы сконфигурировать ваш маршрутизатор в качестве TFTP сервера необходимо ввести на нем команду вида tftp-server <место от куда брать файл> <имя файла>.

Давайте попробуем настроить маршрутизатор R2 так, чтобы он раздавал файл своей конфигурации, сохраненный во флеш памяти,  по TFTP. Для этого выполним на нем команды:

  R2#copy running-config flash:

  R2(config)#tftp-server flash:r2-confg

Здесь первой командой мы копируем текущую конфигурацию нашего устройства во флеш память. По умолчанию, если согласится со всеми ее параметрами нажав Enter, эта команда очищает флеш  память и создает в ней файл с именем <hostname>-confg (в нашем случае r2-confg). Вторая же команда запускает на маршрутизаторе TFTP сервер, который будет раздавать файл r2-confg, хранящийся во флеш памяти маршрутизатора (полный перечень мест/устройств из которых маршрутизатор может делать файлы доступными по TFTP можно получить с помощью команды tftpserver ?, в зависимости от модели устройства придется использовать разные места). Данная команда не вносит ни каких ограничений, на то кто может скачивать данный файл, поэтому его может скачать любое устройство,  с установленным TFTP клиентом, имеющее связь с маршрутизатором по протоколу IP. Проверим это попробовав скопировать данный файл используя машрутизаторы R1 и R3.

На маршрутизаторе R1:

Копируем файл с TFTP сервера во флеш память:

  R1#copy tftp flash

  Address or name of remote host []? 192.168.1.1

  Source filename []? r2-confg

  Destination filename [r2-confg]?

Accessing tftp://192.168.1.1/r2-confg…

  Erase flash: before copying? [confirm]n

Loading r2-confg from 192.168.1.1 (via FastEthernet0/0): !

[OK — 937 bytes]

Verifying checksum…  OK (0x237E)

937 bytes copied in 0.228 secs (4110 bytes/sec)

Просматриваем содержимое флеш памяти:

  R1#show flash:

System CompactFlash directory:

File  Length   Name/status

  1   937      r2-confg

[1004 bytes used, 16776208 available, 16777212 total]

16384K bytes of ATA System CompactFlash (Read/Write)

Просматриваем содержимое самого файла:

  R1#more flash:r2-confg

На маршрутизаторе R3:

  R3#copy tftp flash

  Address or name of remote host []? 192.168.2.1

  Source filename []? r2-confg

  Destination filename [r2-confg]?

Accessing tftp://192.168.2.1/r2-confg…

  Erase flash: before copying? [confirm]n

Loading r2-confg from 192.168.2.1 (via FastEthernet0/0): !

[OK — 937 bytes]

Verifying checksum…  OK (0x237E)

937 bytes copied in 0.248 secs (3778 bytes/sec)

Как мы и говорили выше файлы раздаваемые TFTP сервером доступны, со всех устройств имеющих связь с ним. А как обстоят дела с записью? Попробуем записать какой либо файл на наш TFTP  сервер:

  R3#copy running-config flash

  R3#copy flash tftp

  Source filename [r2-confg]? r3-confg

  Address or name of remote host []? 192.168.2.1

  Destination filename [r3-confg]?

TFTP: error code 2 received — 16739

%Error opening tftp://192.168.2.1/r3-confg (Permission denied)

Как легко заметить из приведенного выше вывода — записать файл не получилось. Аналогичный результат будет, если мы попробуем произвести запись с маршрутизатора R1. Из этого можно сделать вывод, что запись на TFTP  сервер, сконфигурированный на маршрутизаторе фирмы Cisco, запрещена, даже в тех случаях, когда любой клиент имеет доступ на чтение.

А можно ли это как то ограничить доступ на чтение? Да можно, но для этого придется сконфигурировать наш TFTP  сервер немного другим образом. Для начала отключим действующий в настоящий момент на маршрутизаторе TFTP сервер, сделаем это с помощью команды (стоит отметить, что данная команда не останавливает TFTP сервер полностью, а лишь отменяет раздачу файла   r2-confg):

  R2(config)#no tftp-server flash:r2-confg

А уже далее сделаем опять тот же самый файл доступным на TFTP сервере, но уже только одному определенному хосту в сети:

  R2(config)#access-list 1 permit 192.168.1.2

  R2(config)#access-list 1 deny any

  R2(config)#tftp-server flash:r2-confg 1

С помощью первых двух команд мы создаем ACL (Список контроля доступа)с номером 1. В первой строке мы разрешаем доступ хосту с IP адресом 192.168.1.2 (маршрутизатор R1). А второй командой мы запрещаем доступ всем другим хостам. В третье строке мы прикрепляем ACL к нашему TFTP серверу (та самая единичка добавленная в конце команды). Если  вам не совсем понятен принцип работы ACL, то не стоит огорчаться, мы рассмотрим эту тему  подробнее в наших следующих статьях.

Теперь давайте попробуем еще раз выполнить копирование файла r2-confg с маршрутизатора R2 на маршрутизаторы R1 и R3:

Маршрутизатор R1:

  R1#copy tftp flash

  Address or name of remote host [192.168.1.1]?

  Source filename [r2-confg]?

  Destination filename [r2-confg]?

Accessing tftp://192.168.1.1/r2-confg…

  Erase flash: before copying? [confirm]n

Loading r2-confg from 192.168.1.1 (via FastEthernet0/0): !

[OK — 937 bytes]

Verifying checksum…  OK (0x237E)

937 bytes copied in 0.224 secs (4183 bytes/sec)

Маршрутизатор R3:

  R3#copy tftp flash:

  Address or name of remote host []? 192.168.2.1

  Source filename []? r2-confg

  Destination filename [r2-confg]?

Accessing tftp://192.168.2.1/r2-confg…

%Error opening tftp://192.168.2.1/r2-confg (No such file or directory)

Как видно из вывода команд, маршрутизатор R1 успешно скопировал файл с TFTP сервера, а маршрутизатор R3 не смог получить доступ к данному файлу. Это говорит о том , что мы все сделали верно, и наш ACL прикрученный к TFTP серверу работает.

На сегодня это все. До новых встреч.

P.S. В этой статье и далее будем считать, что команды раскрашенные синим цветом предназначены для ввода команд  или их параметров в устройство,  а зеленые команды — это реакция маршрутизатора, выводимая на экран.

I personally use a Virtualized Kali Linux in my Windows 7 machine to do a lot of things. Primarily to do IT security analysis and research for the companies I work with. But mostly, I find maintaining a Linux machine in an image comes in handy for a lot of things: I can use the Kali/Linux machine as an tftp/scp server to backup devices;

So suppose you want to copy startup-config files from your Cisco to your laptop running a virtual machine of Kali Linux, (Debian). Let us suppose further that your Cisco router/switch cannot do SSH otherwise, we’ll just use scp which is safer, and does not need any further special configuration for Linux devices.

Check that the tftpd service is installed. do lsof -i and you should see something like this (notice the tftp services listening on particular ports):

You are now ready to use tftp. login to your cisco device telnet . Then from your Cisco device, type copy startup-config tftp: specify the correct answer to all the following questions, then you will be faced with this error!

Address or name of remote host []? 10.48.2.61

TFTP: error code 2 received — 16739

%Error opening tftp://10.48.2.61/maphl2sw04-confg (Permission denied)

That’s because Linux TFTP servers will not allow anyone to write a file to its default location unless the filename exists and has proper permissions. Thus, to resolve this, you need to create the file, and give it permission 666, as per hte below picture.

touch is the command to create the file

After that tftp is successful.

Address or name of remote host []? 10.48.2.61

!! 20645 bytes copied in 0.109 secs (189404 bytes/sec)

Источник

tftp error code 2 нарушение доступа (tftp не работает)

Системная информация:

Использование Ubuntu 14.04.2 LTS.

Я изо всех сил пытаюсь запустить tftp localhost.

Теперь я получаю ошибку:

разрешение файла, который я пытаюсь поместить, является:

Разрешение папки /tftpboot:

Дополнительная информация

Пожалуйста, помогите мне решить эту проблему.

7 ответов

Файл, который вы хотите поместить через tftp, должен существовать в каталоге назначения и иметь разрешения, позволяющие перезаписывать его. Например, test должен существовать в /tftpboot ,

Вы можете увидеть причину в разделе ошибок на странице руководства tftp.

Я изо всех сил пытаюсь решить, как поместить новый файл через tftp, но все еще не знаю как.

Проверьте syslog и вы увидите, что:

В основном это ошибка, и в вашем случае вам нужно будет переместить все файлы из папки. /tftpboot в /srv/tftp (сделать папку /srv/tftp если не существует) и убедитесь, что вы предоставили 777 разрешений и для всех файлов внутри, перезапустите xinetd и это будет работать!

Как упоминается в leondgarse, вы не можете загружать новые файлы напрямую с вашими настройками. Но вы можете добавить «-c» к server_args, например:

Для подробностей вы можете посмотреть справочную страницу «in.tftpd»:

Это может быть потому, что 14.04 имеет tftp настройка сервера в /etc/inetd.conf :

Вы можете закомментировать эту строку и попробовать еще раз.

В моем случае это (Debian 9.9) я разрешаю это, отредактировав /etc/inetd.conf и изменив строку:

tftp dgram udp никто не ждет / usr / sbin / tcpd /usr/sbin/in.tftpd / srv / tftp

tftp dgram udp никто не ждет / usr / sbin / tcpd /usr/sbin/in.tftpd / tftpboot

Файл «/etc/xinetd.d/tftp» не читается.

Поиск и устранение неисправностей сервера TFTPD в Ubuntu 14.0.4 от Dayanand Ambawade

Шаг 1: Отредактируйте /etc/inetd.conf

tftp dgram udp никто не ждет / usr / sbin / tcpd /usr/sbin/in.tftpd / srv / tftpboot

Шаг 2: Написать скрипт для tftpd

sudo nano /etc/xinetd.d/tftp

Шаг 3: Создайте каталог и установите разрешения

Шаг 4: Запустите сервис

Шаг 5: Тестовый сервер

Надеюсь, это решит проблему. С уважением

Пожалуйста, проверьте биты режима файлов.

В моем случае корневой каталог tftp /opt/tftpboot/

С помощью ls -l Команда, я мог видеть режим файла был 600, поэтому, когда я пытаюсь получить доступ к tftp, чтобы получить этот файл с анонимным, он сообщает о нарушении доступа.

Это может быть причиной этой ошибки. Но может быть и другая причина.

Источник

Thread: tftpd Error code 2: Access violation [PLEASE][HELP]

Thread Tools
Display

tftpd Error code 2: Access violation [PLEASE][HELP]

PLEASE HELP

I am getting tired of Error code 2: Access violation.

I am using tftp for an embedded linux project I am working on. I need to be able to use the put command from the client. I do not know how to set the server options needed to write files to the host. I think I need permissive and create options but I do not know how to set them. Not for lack of trying. I think I wore out xinetd due to excessive restarts. lol

I know. man page says. in.tftpd[options. ] directory.

Do I append /etc/xinetd.d or simply use the command line?

Please give an example with correct syntax.

The directory I want to write to is 777 owner nobody.

Garbage in equals garbage out. I need help to take out the trash.

Thanks in advance,

ADDENDUM 1: I have now realized that on the host, I can simply create an empty file with appropriate file name and wr-wr-wr- and I can write over it from the client. This is a safer way to do it as well. That said, I am still interested in how to set the create and permissive bits to expand my knowledge of what I was doing so wrong. for so many hours. Thanks!

Last edited by mroussin51; December 6th, 2011 at 01:27 PM . Reason: Added content

Error code 2: Access violation

I have spent several days trying to get an tftp service in my machine, but I can use «put» command, however I can’t use «get» command.
Let me repeat all steps I made:

Re: Error code 2: Access violation

How there is no answer, I published a bug at

Please, if you have the same issue, report it there.

Re: Error code 2: Access violation

Thanks for letting me know we are experiencing similar trouble.

mike@ubuntu:/home/TFTP-shared$ ls -l test.txt
-rwxrwxrwx 1 nobody mike 86 2011-12-02 23:20 test.txt

$ tftp localhost
tftp> get test.txt
Received 87 bytes in 0.1 seconds
tftp>

$ ls -l test1.txt
-rwxrwxrwx 1 nobody mike 67 2011-12-08 21:25 test1.txt

tftp> put /home/mike/test1.txt /home/TFTP-shared/test1.txt
Error code 2: Access violation

It appears we have the opposite problem. I can not put a file into my server root directory and you can not get. My initial instinct for yours is that the permissions on «original» are preventing you from reading it. In my case I need to set the create bit on my root directory. I don’t know how to do that. If you set the create option please me know how.

Other thoughts: I think this is not a bug. I read the man page and they did this intentionally to protect us from ourselves.

Re: tftpd Error code 2: Access violation [PLEASE][HELP]

$ in.tftpd -t
mike@ubuntu:

$ in.tftpd -V
mike@ubuntu:

$ in.tftpd -V
mike@ubuntu:

$ in.tftpd -l
mike@ubuntu:

$ in.tftpd -L
mike@ubuntu:

$ in.tftpd -a
mike@ubuntu:

$ in.tftpd -c
mike@ubuntu:

$ in.tftpd -u
mike@ubuntu:

$ in.tftpd -c /tftpboot

Dec 9 04:10:00 ubuntu tftpd[2174]: unknown option -?
Dec 9 04:10:28 ubuntu tftpd[2175]: unknown option -?
Dec 9 04:17:01 ubuntu CRON[2400]: (root) CMD ( cd / && run-parts —report /etc/cron.hourly)
Dec 9 04:17:35 ubuntu tftpd[2402]: unknown option -?
Dec 9 04:17:46 ubuntu tftpd[2403]: unknown option -?
Dec 9 04:18:16 ubuntu tftpd[2404]: unknown option -?
Dec 9 04:18:34 ubuntu tftpd[2405]: unknown option -?
Dec 9 04:18:42 ubuntu tftpd[2406]: unknown option -?
Dec 9 04:18:51 ubuntu tftpd[2407]: unknown option -?
Dec 9 04:19:40 ubuntu tftpd[2408]: unknown option -?

Why doesn’t my in.tftpd recognize any options?

$ in.tftpd -t
mike@ubuntu:

$ in.tftpd -V
mike@ubuntu:

$ in.tftpd -V
mike@ubuntu:

$ in.tftpd -l
mike@ubuntu:

$ in.tftpd -L
mike@ubuntu:

$ in.tftpd -a
mike@ubuntu:

$ in.tftpd -c
mike@ubuntu:

$ in.tftpd -u
mike@ubuntu:

$ in.tftpd -c /tftpboot

Dec 9 04:10:00 ubuntu tftpd[2174]: unknown option -?
Dec 9 04:10:28 ubuntu tftpd[2175]: unknown option -?
Dec 9 04:17:01 ubuntu CRON[2400]: (root) CMD ( cd / && run-parts —report /etc/cron.hourly)
Dec 9 04:17:35 ubuntu tftpd[2402]: unknown option -?
Dec 9 04:17:46 ubuntu tftpd[2403]: unknown option -?
Dec 9 04:18:16 ubuntu tftpd[2404]: unknown option -?
Dec 9 04:18:34 ubuntu tftpd[2405]: unknown option -?
Dec 9 04:18:42 ubuntu tftpd[2406]: unknown option -?
Dec 9 04:18:51 ubuntu tftpd[2407]: unknown option -?
Dec 9 04:19:40 ubuntu tftpd[2408]: unknown option -?

Why doesn’t in.tftpd recognize any options?

I am looking for an option called solved to end this thread. I have realized that the ubuntu tftpd man page and the man tftpd return differt man pages and that is why none of the options worked. Please close this thread. Most forums offer a solved option to the user that generates the thread. I don’t see that on this one.

Solved

As soon as type Ubuntu Forums google auto filled: ubuntu forums how to mark thread as solved. Lots of people looking for the mythical solved option.

Last edited by howefield; January 28th, 2016 at 11:49 PM .

Источник

Installing and Testing TFTP Server in Ubuntu/Debian

Thats it. Our tftp server is working fine.

Like this:

62 thoughts on “ Installing and Testing TFTP Server in Ubuntu/Debian ”

my OS is Debian GNU/Linux 8. get works. but put failed. anyone have same issue?

tftp>get test
after it will show
tftp>………

Thanks !! Working awesome

Hi,
please help me in this
in verify TFTP i am getting this issue
bgl-ads-633:291> tftp 192.168.122.1
tftp> get test
Transfer timed out.

If you need any logs pls ask

Got the same issue. Any workaround here

Thank you…Worked like a charm

can anyone please tell me, How I found last modified time of file I stored on the server. (my file is in zip format)

To me (on Ubuntu 14.04 as server), it looks like the server connects to its directory /src/tftp. This is specified in /etc/inetd.conf. The information about /tftpboot in /etc/xinetd.d/tftp does not seem to be looked at.

Loader:elf Filesys:tftp Dev:eth0 File:192.168.0.113: Options:(null)
Could not load : File not found

please help me to figure out my mistake

Assalamualaikum..i am new with the tftp and i need to finish up this project by the end of this month..i really need someone to help me with this project.. i am using debian 6 for my project and the objective of this project is to send the filename string using the tftp..my problem is i dont know how to display the filename string at the client..someone please help me..thank you

i configured tftp server in my ubuntu system but i cant transfer file to remote system eg: windows xp ; timeout error shows whenever i transfer file to remote system and at the same time i can get the file in remote system-winxp can anyone help me for this problem and post ur answer please…..

tftp is not a secure protocol to transfer file, so most of the host will not allow receiving files over tftp. use ftp instead.

Assalamualaikum.. I am new with tftp..I have set up tftp to transfer file between two linux (using debian) VMware, my laptop as a client and desktop as a server.my laptop is using Wifi,but my desktop is connected with cable
I have installed tftp on both..
but how to transfer files between them? i have done this on client side:

./atftp (server ip address)
tftp > get (filename)

timeout: retrying…
timeout: retrying…
timeout: retrying…
timeout: retrying…
timeout: retrying…

for now, it works fine when i transfer file on local host..
i hope someone can help me..
Thank you.

Did you solve it yet? I am facing same problem now.

Thank you very much this is the guide I needed, simpel and working

Thank you Thalib,
Alhumdulillah. It works fine. really helpfull.

Mashallah, I am Glad that it helped you.

Thank you Thalib,
It was really helpfull..

anyways done.. was doing silly mistake .

I set ->
sudo mkdir /tftpboot
sudo chown nobody.nogroup /tftpboot
sudo chmod 777 /tftpboot

sudo vi /etc/default/tftpd-hpa

RUN_DAEMON=”yes”
OPTIONS=”-l -s /tftpboot”

sudo ifconfig eth0 192.168.1.1
sudo tftp 192.168.1.1

tftp> get test.txt
Transfer time out.

Please what am i missing?

did you get any solution for this

I have completed with Tftp server installation and configuration in my host ubuntu system. Its working fine. But when trying to test it from qemu . i cannot test it. help me to test wthether tftp server working from qemu

that problem is solved for me.

why i try to update image over tftp, getting following error. what is the issue ?

TFTP from server 192.168.1.3; our IP address is 192.168.1.1
Filename ‘xxxxx.img’.
Load address: 0x80800000
Loading: T T T T T T T T T T T

Looks like network issue. Some below if below things..
1. You are setting the IP address of the target as 192.168.1.1, mostly it will be you routers IP (incase you have a router ) choose a IP that is not used by any device on you network
2. Do a quick check if the server is reachable. Just od a ping to see if the host is reachable.

I tried the steps mentioned, got it installed, but the problem arises in the testing part

i execute the tftp connect command on the tftp server itself, just to be sure that am not being blocked by any firewall if i try to connect from other system.
$ tftp 192.168.1.2
tftp> get net.img
After the above command, it doesn’t download anyting from the server and is just struck there

Router#copy disk2:fromtftp.txt tftp:
Address or name of remote host []? 10.10.10.10
Destination filename [fromtftp.txt]?
TFTP: error code 2 received – 16739

%Error opening tftp://10.10.10.10/fromtftp.txt (Permission denied)

How to resolve this!

Thanks for the reply, i figured it out and its already working 😉 I missed a step in the above config 😀

You should create the file prior to the transfer (with the command touch) and set its permissions to 666 (world writable). This is explained in the manpage of tftpd.

Thanks! It worked perfectly

When i’m trying to create file in that directory:
:/etc/xinetd.d$ sudo cat > tftpd
bash: tftpd: Permission denied

i’m using Ubuntu 12.04, i tried this in windows style, both with failure, i am so frustrated ARGHH

try this
sudo cat >> /etc/xinetd.d/tftp

Hi can anyone help me setting up tftp file transfer between two linux PCs?

Pls provide exact steps for the same.
1.should the both systems be connected thro cables?
2.how to install tftp client?
3.how to transfer the files between them?

You can use the above steps in the blog.
1. In both PC’s execute all the above steps
2. Then run to test tftp transfer between the PC’s only execute step 6, but use opposite PC’s IP here.

Answer for your question.
1.should the both systems be connected thro cables?
As long as both the PC’s are in the same net work, or they are able to ping them each other then you can use tftp between them.
You can also use WIFI.

2.how to install tftp client?
If you have folloed the instruction in this blog then you have installed the tftp client,
where tftpd is server and tftp is client. Step 6 shows how to use tftp client

3.how to transfer the files between them?
Normally under all Linux OS due to security reason, You can get files from tftp server, but you can’t put.
So consider using ftp for file transfer between PC’s

i tried the instruction…..also the chmod but it gives me this..

sysadmin@sysadmin:/$ tftp 10.10.10.2
tftp> get test
tftp: test: Permission denied
tftp> exit
?Invalid command
tftp> quit
sysadmin@sysadmin:/$ sudo chmod -R 777 /tftpboot
sysadmin@sysadmin:/$ ls /tftpboot/test -lh
-rwxrwxrwx 1 sysadmin sysadmin 132 2011-12-15 08:46 /tftpboot/test

thank you very much

The current directory where you are is not having write permission for your user. so change to some a directory where you have write permission eg. home path

Now test the tftp, it should work..

you right………after the post i found the solution…..’cause it worked with ” sudo tftp ”
thank you man….and sorry for time wasted

I have the same problem, when i switch to other folder i says
Error code:1 File not found

i followed the instructions here

sudo chown -R nobody /tftpboot

OUPUT: ls -la /
drwxrwxrwx 2 nobody root 4096 Jul 24 10:36 tftpboot

I like this web site very much so much great information.

Thank you for a wonderful info. it worked first time. Wish you can do the same for dhcp-server program. I have tried to follow the instructions but got failure installing it. Also dhcp3-server file was missing.

Appreciate it for all your efforts that you have put in this. very interesting info . “Never trust the advice of a man in difficulties.” by Aesop.

i am using “sudo apt-get install xinetd tftpd tftp” command nut i got
E: Unable to locate package xinetd
E: Unable to locate package tftpd
E: Unable to locate package tftp

I am using Ubuntu 11.04 Ver.
Y? can any one help me?

I am also using Ubuntu 11.04. where I can find the package’s using this command.

$ apt-cache search xinetd
update-inetd – inetd configuration file updater
xinetd – replacement for inetd with many enhancements
globus-gfork-progs – Globus Toolkit – GFork Programs
rlinetd – gruesomely over-featured inetd replacement

Try
$ sudo apt-get update
then install it again.

Please make sure you set the nameservers in /etc/resolv.conf
then ping google.com to see if you have connectivity to internet
Then try the sudo apt-get install xinetd tftpd tftp
Because, when you are trying to install apps using apt-get, it searches for the
repositories online and has to resolve the domain names to reach upto them

Great. Simple and very clear. Congratulations.

Источник

Доброго времени суток!

Специалисты, помогите слоупоку(

Был собран стенд GNS3 — VMWare (Windows XP SP2), топология выглядит где-то так (циски 7200):

Topology.jpeg.jpg

Конфиг R0:

Current configuration : 1481 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname R0
!
boot-start-marker
boot-end-marker
!
no aaa new-model
!
ip cef
interface FastEthernet0/0
ip address 192.168.1.20 255.255.255.0
duplex full
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.252
serial restart-delay 0
!
!
router eigrp 1
redistribute static
network 12.0.0.0
network 192.168.1.0
no auto-summary
!
ip route 0.0.0.0 0.0.0.0 12.1.1.2
!
no ip http server
no ip http secure-server
!
control-plane
!
gatekeeper
shutdown
!
!
line con 0
password 7 110A1016141D
login
stopbits 1
line aux 0
stopbits 1
line vty 0 4
password 7 05080F1C2243
login
!
!
end

Пинги между Варей и Р0 проходят.

Задача следующая была: сгенерировать ключи RSA и экспортировать их на TFTP сервер.

Сделать это ну никак не выходит. При попытке сохранить ключ на ТФТП:

R0(config)#crypto key export rsa test_keys_rsa pem url tftp: 3des 123456789

, получаю ошибку:

% Key name: test_keys_rsa
  Usage: General Purpose Key
Exporting public key...
Address or name of remote host []? 192.168.1.29
Destination filename [test_keys_rsa.pub]?
TFTP: error code 2 received - 16739
% Error: failed to open file.
% Error: failed to export key.

При создании ключей, добавлял параметр «exportable».

R0#show crypto key mypubkey rsa
% Key pair was generated at: 09:04:35 UTC Jul 28 2011
Key name: test_keys_rsa
Usage: General Purpose Key
Key is exportable.
Key Data:
 305C300D 06092A86 4886F70D 01010105 00034B00 30480241 00C4B29D CDB14B5C
 18BC1B94 A4D2E75D 467A5FA4 7A1EAB70 31F81D41 1B840642 8DA1904A 59F4426A
 7D3FB33D 43DD6D29 132A5A34 95FBAAC2 8FB14734 D6A6884B 9F020301 0001
% Key pair was generated at: 09:52:36 UTC Jul 29 2011

также присутствует другая проблемка — не могу копировать файл конфигурации на ТФТП:

R0#copy running-config tftp:
Address or name of remote host []? 192.168.1.29
Destination filename [r0-confg]?
TFTP: error code 2 received - 16739

%Error opening tftp://192.168.1.29/r0-confg (Permission denied)

Службу ТФТП в Винде вручную ставил, руководствуясь данным гайдом: http://www.panvasoft.com/rus/blog/144/

Фаервол погасил.

Сразу извиняюсь, если понаписывал (-ваю) глупостей — я в цисках новичек.

Заранее спасибо)

//заранее прошу прощение, если подобная тема уже обсуждалась, но поиск мне в этом деле не помог)

//надеюсь тема в правильном разделе.


Изменено 29 июля, 2011 пользователем Former_Human

\если тема похожая была — я извиняюсь за кривизну рук при поиске
Доброго времени суток!

Господа, специалисты, помогите слоупоку(

Был собран корявый стенд GNS3 — VMWare (Windows XP SP2), топология выглядит где-то так (циски 7200):

Конфиг R0:

Код

Current configuration : 1481 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname R0
!
boot-start-marker
boot-end-marker
!
no aaa new-model
!
ip cef
interface FastEthernet0/0
 ip address 192.168.1.20 255.255.255.0
 duplex full
!
interface Serial1/0
 ip address 12.1.1.1 255.255.255.252
 serial restart-delay 0
!
!
router eigrp 1
 redistribute static
 network 12.0.0.0
 network 192.168.1.0
 no auto-summary
!
ip route 0.0.0.0 0.0.0.0 12.1.1.2
!
no ip http server
no ip http secure-server
!
control-plane
!
gatekeeper
 shutdown
!
!
line con 0
 password 7 110A1016141D
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 password 7 05080F1C2243
 login
!
!
end

Пинги между Варей и Р0 проходят.
Задача следующая была: сгенерировать ключи RSA и экспортировать их на TFTP сервер.
Сделать это ну никак не выходит. При попытке сохранить ключ на ТФТП:

Код

R0(config)#crypto key export rsa test_keys_rsa pem url tftp: 3des 123456789

, получаю ошибку:

Код

% Key name: test_keys_rsa
   Usage: General Purpose Key
Exporting public key...
Address or name of remote host []? 192.168.1.29
Destination filename [test_keys_rsa.pub]?
TFTP: error code 2 received - 16739
% Error: failed to open file.
% Error: failed to export key.

При создании ключей, добавлял параметр «exportable».

Код

R0#show crypto key mypubkey rsa
% Key pair was generated at: 09:04:35 UTC Jul 28 2011
Key name: test_keys_rsa
 Usage: General Purpose Key
 Key is exportable.
 Key Data:
  305C300D 06092A86 4886F70D 01010105 00034B00 30480241 00C4B29D CDB14B5C
  18BC1B94 A4D2E75D 467A5FA4 7A1EAB70 31F81D41 1B840642 8DA1904A 59F4426A
  7D3FB33D 43DD6D29 132A5A34 95FBAAC2 8FB14734 D6A6884B 9F020301 0001
% Key pair was generated at: 09:52:36 UTC Jul 29 2011

также присутствует другая борода — не могу копировать файл конфигурации на ТФТП:

Код

R0#copy running-config tftp:
Address or name of remote host []? 192.168.1.29
Destination filename [r0-confg]?
TFTP: error code 2 received - 16739
 
%Error opening tftp://192.168.1.29/r0-confg (Permission denied)

Службу ТФТП в Винде вручную ставил, руководствуясь данным гайдом: http://www.panvasoft.com/rus/blog/144/
Фаервол погасил.
Сразу извиняюсь, если понаписывал (-ваю) глупостей — я в цисках нуб.
Помогите-спасите. Заранее спасибо)

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

  1. tftpd Error code 2: Access violation [PLEASE][HELP]

    Hi,

    PLEASE HELP

    I am getting tired of Error code 2: Access violation.

    I am using tftp for an embedded linux project I am working on. I need to be able to use the put command from the client. I do not know how to set the server options needed to write files to the host. I think I need permissive and create options but I do not know how to set them. Not for lack of trying. I think I wore out xinetd due to excessive restarts. lol

    I know…man page says… in.tftpd[options…] directory…

    Do I append /etc/xinetd.d or simply use the command line?

    Please give an example with correct syntax.

    The directory I want to write to is 777 owner nobody.

    Garbage in equals garbage out. I need help to take out the trash.

    Thanks in advance,

    Mike

    ADDENDUM 1: I have now realized that on the host, I can simply create an empty file with appropriate file name and wr-wr-wr- and I can write over it from the client. This is a safer way to do it as well. That said, I am still interested in how to set the create and permissive bits to expand my knowledge of what I was doing so wrong…for so many hours. Thanks!

    Last edited by mroussin51; December 6th, 2011 at 01:27 PM.

    Reason: Added content


  2. Error code 2: Access violation

    I have spent several days trying to get an tftp service in my machine, but I can use «put» command, however I can’t use «get» command.
    Let me repeat all steps I made:

    Code:

    elder@elder-PC:~$ cat /etc/issue
    Ubuntu 11.10 n l
    
    elder@elder-PC:~$ sudo apt-get install tftp tftpd
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      tftp tftpd
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/33.0 kB of archives.
    After this operation, 168 kB of additional disk space will be used.
    Selecting previously deselected package tftp.
    (Reading database ... 178833 files and directories currently installed.)
    Unpacking tftp (from .../tftp_0.17-18ubuntu2_amd64.deb) ...
    Selecting previously deselected package tftpd.
    Unpacking tftpd (from .../tftpd_0.17-18ubuntu2_amd64.deb) ...
    Processing triggers for man-db ...
    Setting up tftp (0.17-18ubuntu2) ...
    Setting up tftpd (0.17-18ubuntu2) ...
    Note: xinetd currently is not fully supported by update-inetd.
          Please consult /usr/share/doc/xinetd/README.Debian and itox(8).
    elder@elder-PC:~$ sudo joe /etc/xinetd.d/tftp
    
    service tftp
    {
    protocol        = udp
    port            = 69
    socket_type     = dgram
    wait            = yes
    user            = nobody
    server          = /usr/sbin/in.tftpd
    server_args     = -s /tftpboot
    disable         = no
    }
    
    elder@elder-PC:~$ sudo mkdir /tftpboot
    elder@elder-PC:~$ sudo chmod -R 777 /tftpboot
    elder@elder-PC:~$ sudo chown -R nobody /tftpboot
    elder@elder-PC:~$ sudo service xinetd reload
    elder@elder-PC:~$ touch original
    elder@elder-PC:~$ tftp localhost
    tftp> put original
    tftp> get original
    Error code 2: Access violation
    tftp> quit
    elder@elder-PC:~$ less /var/log/syslog
    
    
    Dec  6 16:02:09 elder-PC xinetd[13864]: Started working: 0 available services
    Dec  6 16:06:29 elder-PC xinetd[13864]: Starting reconfiguration
    Dec  6 16:06:29 elder-PC xinetd[13864]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.conf] [line=14]
    Dec  6 16:06:29 elder-PC xinetd[13864]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=28]
    Dec  6 16:06:29 elder-PC xinetd[13864]: Reading included configuration file: /etc/xinetd.d/discard [file=/etc/xinetd.d/discard] [line=26]
    Dec  6 16:06:29 elder-PC xinetd[13864]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=25]
    Dec  6 16:06:29 elder-PC xinetd[13864]: Reading included configuration file: /etc/xinetd.d/tftp [file=/etc/xinetd.d/tftp] [line=26]
    Dec  6 16:06:29 elder-PC xinetd[13864]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=11]
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing chargen
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing chargen
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing daytime
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing daytime
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing discard
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing discard
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing echo
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing echo
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing time
    Dec  6 16:06:29 elder-PC xinetd[13864]: removing time
    Dec  6 16:06:29 elder-PC xinetd[13864]: Swapping defaults
    Dec  6 16:06:29 elder-PC xinetd[13864]: Reconfigured: new=1 old=0 dropped=0 (services)
    Dec  6 16:08:16 elder-PC tftpd[13920]: tftpd: trying to get file: original
    Dec  6 16:08:16 elder-PC tftpd[13920]: tftpd: serving file from /tftpboot
    Dec  6 16:08:20 elder-PC tftpd[13922]: tftpd: trying to get file: original
    Dec  6 16:08:20 elder-PC tftpd[13922]: tftpd: serving file from /tftpboot


  3. Re: Error code 2: Access violation

    How there is no answer, I published a bug at

    https://bugs.launchpad.net/ubuntu/+s…tp/+bug/901273

    Please, if you have the same issue, report it there.


  4. Re: Error code 2: Access violation

    Thanks for letting me know we are experiencing similar trouble.

    FYI:

    mike@ubuntu:/home/TFTP-shared$ ls -l test.txt
    -rwxrwxrwx 1 nobody mike 86 2011-12-02 23:20 test.txt

    mike@ubuntu:~$ tftp localhost
    tftp> get test.txt
    Received 87 bytes in 0.1 seconds
    tftp>

    Next:

    mike@ubuntu:~$ ls -l test1.txt
    -rwxrwxrwx 1 nobody mike 67 2011-12-08 21:25 test1.txt

    tftp> put /home/mike/test1.txt /home/TFTP-shared/test1.txt
    Error code 2: Access violation

    It appears we have the opposite problem. I can not put a file into my server root directory and you can not get. My initial instinct for yours is that the permissions on «original» are preventing you from reading it. In my case I need to set the create bit on my root directory. I don’t know how to do that. If you set the create option please me know how.

    http://ubuntuforums.org/showthread.p…6#post11516876

    Other thoughts: I think this is not a bug. I read the man page and they did this intentionally to protect us from ourselves.


  5. Re: tftpd Error code 2: Access violation [PLEASE][HELP]

    Please:

    mike@ubuntu:~$ in.tftpd -t
    mike@ubuntu:~$ in.tftpd -V
    mike@ubuntu:~$ in.tftpd -V
    mike@ubuntu:~$ in.tftpd -l
    mike@ubuntu:~$ in.tftpd -L
    mike@ubuntu:~$ in.tftpd -a
    mike@ubuntu:~$ in.tftpd -c
    mike@ubuntu:~$ in.tftpd -u
    mike@ubuntu:~$ in.tftpd -c /tftpboot

    Dec 9 04:10:00 ubuntu tftpd[2174]: unknown option -?
    Dec 9 04:10:28 ubuntu tftpd[2175]: unknown option -?
    Dec 9 04:17:01 ubuntu CRON[2400]: (root) CMD ( cd / && run-parts —report /etc/cron.hourly)
    Dec 9 04:17:35 ubuntu tftpd[2402]: unknown option -?
    Dec 9 04:17:46 ubuntu tftpd[2403]: unknown option -?
    Dec 9 04:18:16 ubuntu tftpd[2404]: unknown option -?
    Dec 9 04:18:34 ubuntu tftpd[2405]: unknown option -?
    Dec 9 04:18:42 ubuntu tftpd[2406]: unknown option -?
    Dec 9 04:18:51 ubuntu tftpd[2407]: unknown option -?
    Dec 9 04:19:40 ubuntu tftpd[2408]: unknown option -?

    Why doesn’t my in.tftpd recognize any options?

    Please:

    mike@ubuntu:~$ in.tftpd -t
    mike@ubuntu:~$ in.tftpd -V
    mike@ubuntu:~$ in.tftpd -V
    mike@ubuntu:~$ in.tftpd -l
    mike@ubuntu:~$ in.tftpd -L
    mike@ubuntu:~$ in.tftpd -a
    mike@ubuntu:~$ in.tftpd -c
    mike@ubuntu:~$ in.tftpd -u
    mike@ubuntu:~$ in.tftpd -c /tftpboot

    Dec 9 04:10:00 ubuntu tftpd[2174]: unknown option -?
    Dec 9 04:10:28 ubuntu tftpd[2175]: unknown option -?
    Dec 9 04:17:01 ubuntu CRON[2400]: (root) CMD ( cd / && run-parts —report /etc/cron.hourly)
    Dec 9 04:17:35 ubuntu tftpd[2402]: unknown option -?
    Dec 9 04:17:46 ubuntu tftpd[2403]: unknown option -?
    Dec 9 04:18:16 ubuntu tftpd[2404]: unknown option -?
    Dec 9 04:18:34 ubuntu tftpd[2405]: unknown option -?
    Dec 9 04:18:42 ubuntu tftpd[2406]: unknown option -?
    Dec 9 04:18:51 ubuntu tftpd[2407]: unknown option -?
    Dec 9 04:19:40 ubuntu tftpd[2408]: unknown option -?

    Why doesn’t in.tftpd recognize any options?

    I am looking for an option called solved to end this thread. I have realized that the ubuntu tftpd man page and the man tftpd return differt man pages and that is why none of the options worked. Please close this thread. Most forums offer a solved option to the user that generates the thread. I don’t see that on this one.

    Solved

    http://http://ubuntuforums.org/showthread.php?t=767621

    As soon as type Ubuntu Forums google auto filled: ubuntu forums how to mark thread as solved. Lots of people looking for the mythical solved option.

    Last edited by howefield; January 28th, 2016 at 11:49 PM.


  6. Re: Error code 2: Access violation

    tftp server is designed without security concern.
    It must be able to write and read whatever the clients wants.
    I am trying to use tftpd for almost a hundred voip phones.
    Voip phones need to read and writes config files and log files.
    Net admin don’t have to be changed permissions very time that a phone write a new file. It will be crazy!
    Please, suppport the bug open, clicking on «This bug affects you»

    using this link
    https://bugs.launchpad.net/ubuntu/+s…tp/+bug/901273


  7. Re: Error code 2: Access violation

    Solution or atleast a work around….

    Not sure if this is something with the design of TFTP but when doing a put it does not let you create a file.

    Solution:

    Create the file before hand and give 777 rights. Run transfer again and it should work. See Below:

    SW1#copy run tftp://192.168.31.1/SW1-Full-LAB26-TE.cfg
    Address or name of remote host [192.168.31.1]?
    Destination filename [SW1-Full-LAB26-TE.cfg]?
    TFTP: error code 2 received — 16739

    %Error opening tftp://192.168.31.1/SW1-Full-LAB26-TE.cfg (Permission denied)

    root@ubuntu:/tftpboot# touch SW1-Full-LAB26-TE.cfg
    root@ubuntu:/tftpboot# chmod 777 SW1-Full-LAB26-TE.cfg

    SW1#copy run tftp://192.168.31.1/SW1-Full-LAB26-TE.cfg
    Address or name of remote host [192.168.31.1]?
    Destination filename [SW1-Full-LAB26-TE.cfg]?
    !!
    4456 bytes copied in 1.065 secs (4184 bytes/sec)
    SW1#

    I hope this helps!!!!!


Понравилась статья? Поделить с друзьями:
  • Terraria error system argumentexception
  • Terraria error microsoft xna framework как исправить
  • Terminating program now dump and log have been written to risen как исправить
  • Terraria error microsoft xna framework content contentloadexception
  • Terraria error lonic zip