wget para final de FTP em “conexão recusada”

1

Eu quero copiar um diretório FTP para o meu servidor (Debian) usando o comando wget. Eu tentei:

wget -m --user=user --password=passftp://ftp.domain.com

Eu recebi este erro:

connection... failed : Connection refused

Eu tentei exportar ftp_proxy mas não sei o que devo preencher aqui? O IP do meu servidor? Algo mais ?

Além disso, eu tentei ncftpget, mas eu tenho:

Unknown host
    
por Vincent Decaux 15.04.2016 / 15:12

1 resposta

1

Eu quero copiar um diretório FTP para o meu servidor (Debian) usando wget

wget -m --user=user --password=passftp://ftp.domain.com

Existem vários erros no comando acima.

  1. Você está sem um espaço entre pass e ftp://ftp.domain.com

  2. Você precisa usar opções diferentes ( --ftp-user e --ftp-password ) ao acessar um servidor FTP.

Tente o seguinte comando:

get -m --ftp-user=user --ftp-password=pass ftp://ftp.domain.com

Alternativa (formato de URL):

get -m ftp://user:pass@ipaddress

em que ipaddress é o endereço IP de ftp.domain.com

2.1 Formato de URL

URL is an acronym for Uniform Resource Locator. A uniform resource locator is a compact string representation for a resource available via the Internet. Wget recognizes the URL syntax as per RFC1738. This is the most widely used form (square brackets denote optional parts):

http://host[:port]/directory/file
ftp://host[:port]/directory/file

You can also encode your username and password within a URL:

ftp://user:password@host/path
http://user:password@host/path

Either user or password, or both, may be left out. If you leave out either the HTTP username or password, no authentication will be sent. If you leave out the FTP username, ‘anonymous’ will be used. If you leave out the FTP password, your email address will be supplied as a default password.

Fonte GNU Wget 1.17.1 Manual

2.9 Opções de FTP

--ftp-user=user
--ftp-password=password

Specify the username user and password password on an FTP server.

Without this, or the corresponding startup option, the password defaults to -wget@, normally used for anonymous FTP.

Another way to specify username and password is in the URL itself (see URL Format). Either method reveals your password to anyone who bothers to run ps. To prevent the passwords from being seen, store them in .wgetrc or .netrc, and make sure to protect those files from other users with chmod. If the passwords are really important, do not leave them lying in those files either—edit the files and delete them after Wget has started the download.

Fonte GNU Wget 1.17.1 Manual

    
por 15.04.2016 / 16:09

Tags