CURL – curl: (9) Server denied you to change to the given directory

I hit this error trying to import some VMs into OVM

To get more detail I tried the command from the ocmmand line

curl -v "ftp://root:blahroot@192.168.8.192/var/tmp/taxud-disk1.vmdk"
* About to connect() to 192.168.8.192 port 21
* Trying 192.168.8.192... connected
* Connected to 192.168.8.192 (192.168.8.192) port 21
< 220 (vsFTPd 2.0.5) > USER root
< 331 Please specify the password. > PASS blahroot
< 230 Login successful. > PWD
< 257 "/root" * Entry path is '/root' > CWD var
< 550 Failed to change directory. * Server denied you to change to the given directory * Connection #0 to host 192.168.8.192 left intact curl: (9) Server denied you to change to the given directory > QUIT
< 221 Goodbye.

This is because the pathname I have given is relative, rather than absolute, so I was unknowingly trying to change directory to /root/var/tmp which did not exist.

To give an absolute pathname, you need an extra slash

curl “ftp://root:blahroot@192.168.8.192//var/tmp/taxud-disk1.vmdk”

Advertisements

8 thoughts on “CURL – curl: (9) Server denied you to change to the given directory

  1. Thank you for posting this!! Even the Oracle VM user guide is missing the extra slash! :-\ Banged my head for a while trying to import an iso via ftp.

  2. I get the following error when i run curl command:

    # curl “ftp://root:sonu@10.192.6.62//var/ftp/repo/centos/64/x86_64/repodata/repomd.xml”
    curl: (67) Access denied: 530

    Any help would be appreciated.

    1. Hello Jaideep,
      The ‘Access denied: 530’ message has been returned from the ftp server – this can mean that the user is not enabled for ftp (see the ftpusers on the server) or that the user account has been blocked for another reason. I would test this by trying to ftp as the user directly and see if you receive the same message.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s