3

Network device (embedded Linux) connected to local computer (Windows OS). What is tftp command to copy binary file from network device to local computer? Also, what's command to copy file in the opposite way, from local computer to network device?

EDIT:

I find the BusyBox tftp commands:

BusyBox v0.61.pre (2003.02.04-12:10+0000) multi-call binary

Usage: tftp [OPTIONS] HOST [PORT]

Transfers a file from/to a tftp server

Options:
        -l FILE Local FILE.
        -r FILE Remote FILE.
        -g      Get file.
        -p      Put file.

commands:

tftp -l <local file> -r <remote file> -p <remote ip>
tftp -g -r <remote file> <remote ip>
  • SSH and TFTP are different file transfer protocols. You would normally use a TFTP client to do TFTP transfers. How is SSH involved here? – Kenster Aug 3 '14 at 18:25
  • I mean transfer file from device running Linux(from SSH shell) to local Windows PC that have TFTP server (Tftpd32). – triwo Aug 3 '14 at 20:26
1
tftp 192.168.1.1 -m binary -c put localfile remotefile 
tftp 192.168.1.1 -m binary -c get remotefile localfile

Of course you will have to change the ip address to the address of the computer you are going to access.

tftp defaults to ascii, so the binary mode has to be specified or you will receive a file mismatch error.

| improve this answer | |
  • 2
    I just find busybox tftp commands, so its: tftp -l <local file> -r <remote file> -p <remote ip> and tftp -g -r <remote file> <remote ip> In the first command, is the -r <remote file> a mandatory argument, or it can be omitted? Also, seems there is no binary mode in busybox tftp commands? – triwo Aug 4 '14 at 11:21
  • Should I assign a static IP address to a computer? – triwo Aug 4 '14 at 17:10
0

Use:

tftp -gr filename 192.168.1.1:69

to get the file from the server. You need to setup tftp and enable a firewall exception.

From device to PC you can use:

udpsvd -Ev 192.168.1.1 69 tftpd
| improve this answer | |
  • can you comment last command? What is its purpose? – triwo Feb 27 '18 at 9:29
  • device will became tftp server and other tftp client can get file from this device – Chan Wai Mar 5 '18 at 6:02
  • the busybox implementation on an embedded device have no such commands. It's all device specific. – triwo Mar 6 '18 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.