# fetch problem



## sappi (Sep 29, 2010)

Hello everybody.
So here im facing a strange problem with fetch. Trying to get the content of the file.
Fetch log:

```
/usr/bin/fetch -q -o- ftp://login:password@ftpIP/directory/file
fetch: ftp://login:password@ftpIP/directory/file: File unavailable (e.g., file not found, no access)
```
File is there. Login and password are correct. Directory permissions 755, file permissions 644.
I installed wget on a server from ports and it works perfectly fine. Fetch on the other hand doesnt want to work.
Wget log:

```
# wget ftp://login:password@ftpIP/directory/file
--2010-11 18:45:28--  ftp://login:password@ftpIP/directory/file
           => `file'
Connecting to IP:21... connected.
Logging in as nurg-5 ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /home/user/directory ... done.
==> SIZE listing ... 11
==> PASV ... done.    ==> RETR listing ... done.
Length: 11 (unauthoritative)

100%[===================================================================================================================>] 11          --.-K/s   in 0s

2010-11 18:45:28 (2.68 MB/s) - `file' saved [11]

root@test [~]# cat file
2010-11
```

Did anyone get into a problem like this before?

Thanks.


----------



## sappi (Sep 29, 2010)

In addition:
While installing software from ports fetch works.


----------



## acheron (Sep 29, 2010)

you have to put your login/passwd in a file named .netrc see fetch(1)


----------



## sappi (Sep 29, 2010)

acheron said:
			
		

> you have to put your login/passwd in a file named .netrc see fetch(1)



Tried it. No luck.


----------



## Beastie (Sep 29, 2010)

Try passive FTP (*-p*).

Setting *FTP_PASSIVE_MODE* to yes/true in your environment may help too if that is the problem.


----------



## sappi (Sep 30, 2010)

Nope. Same thing.


----------



## acheron (Sep 30, 2010)

it works here. You must be doing something wrong.
here is the content of my ~/.netrc file :

```
machine ftp.membres.lycos.fr
login foo
password bar
```

fetch ftp://ftp.membres.lycos.fr/foobar


----------



## sappi (Sep 30, 2010)

This is not the point. I am connecting to the proftpd server running on Debian Linux Lenny.
This one works: 

```
usr/bin/fetch -q -o- tp://login:password@ftpIP[B]/~/[/B]directory/file
```
It's a matter of a problem with changing a directory on a remote server.
So now I need to figure out what needs to be changed on a remote server, so fetch can connect directly to the needed directory.


----------



## sappi (Sep 30, 2010)

Problem solved: Forgot to enable chroot_local_directory in my vsftpd ftp service.


----------

