AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 505003
Accepted
林果皞
林果皞
Asked: 2019-03-08 12:54:52 +0800 CST2019-03-08 12:54:52 +0800 CST 2019-03-08 12:54:52 +0800 CST

tftp - Código de erro 1: arquivo não encontrado

  • 772

Eu preciso da sintaxe correta do tftp para obter e colocar o arquivo. Meu objetivo final é usar o tftp do busybox (esta deve ser a segunda pergunta), mas falhou mesmo tentando testar com o cliente tftp local do Ubuntu.

Como você pode ver abaixo, ftpnenhum problema, apenas tftptem problema. E este é o ip de loopback, portanto, não deve estar relacionado ao iptables (novamente, ftpsem problemas). Para evitar um possível problema de caminho longo, testo apenas com o diretório inicial.

xb@dnxb:/tmp$ grep anon_root /etc/vsftpd.conf
anon_root=/home/xiaobai/
xb@dnxb:/tmp$ cat /home/xiaobai/haha
7
xb@dnxb:/tmp$ ftp 127.0.0.1
Connected to 127.0.0.1.
220 (vsFTPd 3.0.3)
Name (127.0.0.1:xiaobai): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> get haha
local: haha remote: haha
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for haha (2 bytes).
226 Transfer complete.
2 bytes received in 0.00 secs (6.5541 kB/s)
ftp> 221 Goodbye.
xb@dnxb:/tmp$ tftp 127.0.0.1
tftp> get haha
Error code 1: File not found
tftp> get /home/xiaobai/haha
Error code 1: File not found
tftp> get /home/xiaobai/haha output
Error code 1: File not found
tftp> put /home/xiaobai/haha        
Error code 1: File not found
tftp> put haha
Error code 1: File not found
tftp> xb@dnxb:/tmp$ dpkg-query -W -f='${Description}\n\n${Homepage}\nMaintainer: ${Maintainer}\n\n' tftp
Trivial file transfer protocol client
 Tftp is the user interface to the Internet TFTP (Trivial File Transfer
 Protocol), which allows users to transfer files to and from a remote machine.
 The remote host may be specified on the command line, in which case tftp uses
 host as the default host for future transfers.

http://www.hcs.harvard.edu/~dholland/computers/netkit.html
Maintainer: Ubuntu Developers <[email protected]>

xb@dnxb:/tmp$

Então eu sigo esta resposta :

xb@dnxb:/tmp$ tftp -v 127.0.0.1 -c get haha
usage: tftp host-name [port]
tftp> xb@dnxb:/tmp$ 
xb@dnxb:/tmp$ tftp -v 127.0.0.1 -c get /home/xiaobai/haha
usage: tftp host-name [port]
tftp> xb@dnxb:/tmp$ 
xb@dnxb:/tmp$ tftp -v 127.0.0.1 -c put haha
usage: tftp host-name [port]
tftp> xb@dnxb:/tmp$ tftp -v 127.0.0.1 -c put /home/xiaobai/haha
usage: tftp host-name [port]
tftp> ^F
?Invalid command
tftp> xb@dnxb:/tmp$ 
xb@dnxb:/tmp$ 

E também esta resposta (comente ou não parece não ter efeito, eu fiz service vsftpd restartdepois de editado):

xb@dnxb:/tmp$ grep server_args /etc/xinetd.conf 
# server_args = -c -s /tftpboot
xb@dnxb:/tmp$ 

Poderia ser melhor se alguém pudesse responder sobre o tftp do busybox que tem uma opção diferente:

# busybox tftp                                    
BusyBox v1.22.1 bionic (2017-11-04 12:54 +0800) multi-call binary.

Usage: tftp [OPTIONS] HOST [PORT]

Transfer a file from/to tftp server

        -l FILE Local FILE
        -r FILE Remote FILE
        -g      Get file
        -p      Put file
busybox vsftpd
  • 1 1 respostas
  • 10372 Views

1 respostas

  • Voted
  1. Best Answer
    Fitz
    2019-03-08T18:08:18+08:002019-03-08T18:08:18+08:00

    tftp geralmente é restrito ao diretório /tftpboot, eu não esperaria que funcionasse para obter algo de um diretório inicial do usuário.

    Verifique também as permissões do arquivo. IIRC (já faz um tempo), já que o tftp é não autenticado, os arquivos precisam ser legíveis pelo mundo.

    • 1

relate perguntas

  • Gerenciador de pacotes para Busybox

  • Desde qual versão o busybox ash construído com ASH_BASH_COMPAT inclui suporte a array?

  • Como fazer o mkinitcpio busybox ash para source /etc/profile?

  • Clone um dispositivo de bloco usando 'cat'

  • a reinicialização do busysbox não funciona no script de inicialização

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Possível firmware ausente /lib/firmware/i915/* para o módulo i915

    • 3 respostas
  • Marko Smith

    Falha ao buscar o repositório de backports jessie

    • 4 respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    user12345 Falha ao buscar o repositório de backports jessie 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl Por que a maioria dos exemplos do systemd contém WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST

Hot tag

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve