Error connecting to ftp server denied you to change to the given directory

curl 9 Server denied you to change to the given directory by Nicky Mathew | Feb 1, 2021 curl 9 Server denied you to change to the given directory occurs when we are denied access to the resource given in the URL. As part of our Server Management Services, we assist our customers with […]

Содержание

  1. curl 9 Server denied you to change to the given directory
  2. curl 9 Server denied you to change to the given directory
  3. Solution
  4. Conclusion
  5. PREVENT YOUR SERVER FROM CRASHING!
  6. Server denied you to change to the given directory — withIntermediateDirectories:YES #39
  7. Comments
  8. Русские Блоги
  9. Монтирование FTP-сервера с помощью curlftpfs под Linux и возникшие проблемы
  10. Thread: can’t play video from network drive
  11. can’t play video from network drive
  12. Re: can’t play video from network drive
  13. Yum update
  14. Responses

curl 9 Server denied you to change to the given directory

by Nicky Mathew | Feb 1, 2021

curl 9 Server denied you to change to the given directory occurs when we are denied access to the resource given in the URL.

As part of our Server Management Services, we assist our customers with several such errors.

Today, let us see an effective solution in order to fix this error.

curl 9 Server denied you to change to the given directory

One of our customers came across this error while trying to import some VMs into OVM. On checking the issue we found that this error occurs when we are denied access to the resource given in the URL.

Similarly, if we try to FTP to one of the servers and change the remote directory it could lead us to this error.

Since the error was very explicit ‘Server denied you to change to the given directory,’ it has nothing to do with CURL. It is simply an access issue. Adding a username and password can resolve the issue.

It does not work with curl, as curl uses a standard FTP process, which requires a login before changing the relevant directory. However, since there is no automatic directory redirection it works fine on the browser.

The following is the command we use:

Since the pathname is relative, rather than absolute the directory misunderstands as /root/var/tmp which does not exist.

To give an absolute pathname, we need to provide an extra slash as given below:

We can also try fiddling with curl’s option –ftp-method

The method argument should be one of the following alternatives:

A default but slowest behavior, multicwd curl does a single CWD operation for each path part in the given URL.

The fastest behavior, nocwd curl does no CWD at all. CURL will do SIZE, RETR, STOR, etc, and give a full path to the server for all these commands.

singlecwd curl does one CWD with the full target directory and then operates on the file “normally”. It is somewhat more preferable than ‘nocwd’ but without the full penalty of ‘multicwd’.

Solution

In order to solve the error, we need to check the default landing directory in the vsftpd.conf file and mention the repo path in the /etc/yum.repos.d/ minus the landing directory.

[Stuck with the error? We’d be happy to assist you]

Conclusion

To conclude, this error occurs when we are denied access to the resource given in the URL. today, we saw an effective way our Support Engineers employ in order to fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

Источник

Server denied you to change to the given directory — withIntermediateDirectories:YES #39

I’m using the this code to generate & upload a test file:

The same error is given on 2 different FTP servers:

If I create the blog directory with another FTP Client, the upload will succeed. Any suggestions on how I could approach a fix?

The text was updated successfully, but these errors were encountered:

Hello, can you implement your delegate to gather the full transcript and post that here too, please? That should give some more idea why it’s failing.

Sorry I couldn’t post a cleaner log — is this what you wanted?

2013-05-09 00:45:00.446 Orbitink[2061:780b] STATE: INIT => CONNECT handle 0x1015d8390; line 1001 (connection #-5000)
2013-05-09 00:45:00.446 Orbitink[2061:4503] About to connect() to 192.168.100.178 port 21 (#0)
2013-05-09 00:45:00.446 Orbitink[2061:1803] Trying 192.168.100.178.
2013-05-09 00:45:00.446 Orbitink[2061:5807] Adding handle: conn: 0x1020df200
2013-05-09 00:45:00.447 Orbitink[2061:780b] Adding handle: send: 0
2013-05-09 00:45:00.447 Orbitink[2061:4503] Adding handle: recv: 0
2013-05-09 00:45:00.447 Orbitink[2061:1803] Curl_addHandleToPipeline: length: 1
2013-05-09 00:45:00.447 Orbitink[2061:5807] 0x100927600 is at send pipe head!
2013-05-09 00:45:00.447 Orbitink[2061:780b] — Conn 0 (0x1020df200) send_pipe: 1, recv_pipe: 0
2013-05-09 00:45:00.448 Orbitink[2061:4503] STATE: CONNECT => WAITCONNECT handle 0x1015d8390; line 1048 (connection #0)
2013-05-09 00:45:00.520 Orbitink[2061:780b] Connected to 192.168.100.178 (192.168.100.178) port 21 (#0)
2013-05-09 00:45:00.520 Orbitink[2061:1803] STATE: WAITCONNECT => PROTOCONNECT handle 0x1015d8390; line 1161 (connection #0)
2013-05-09 00:45:00.520 Orbitink[2061:4503] FTP 0x1020df710 (line 3260) state change from STOP to WAIT220
2013-05-09 00:45:00.595 Orbitink[2061:780b] 220 (vsFTPd 2.3.5)

2013-05-09 00:45:00.595 Orbitink[2061:4503] USER ftpuser

2013-05-09 00:45:00.595 Orbitink[2061:1803] FTP 0x1020df710 (line 843) state change from WAIT220 to USER
2013-05-09 00:45:00.667 Orbitink[2061:780b] 331 Please specify the password.

2013-05-09 00:45:00.667 Orbitink[2061:4503] PASS ####
2013-05-09 00:45:00.667 Orbitink[2061:1803] FTP 0x1020df710 (line 2635) state change from USER to PASS
2013-05-09 00:45:00.773 Orbitink[2061:780b] 230 Login successful.

2013-05-09 00:45:00.773 Orbitink[2061:4503] PWD

2013-05-09 00:45:00.773 Orbitink[2061:1803] FTP 0x1020df710 (line 855) state change from PASS to PWD
2013-05-09 00:45:00.842 Orbitink[2061:780b] 257 «/var/www»

2013-05-09 00:45:00.842 Orbitink[2061:4503] Entry path is ‘/var/www’
2013-05-09 00:45:00.842 Orbitink[2061:1803] FTP 0x1020df710 (line 2952) state change from PWD to STOP
2013-05-09 00:45:00.843 Orbitink[2061:5807] protocol connect phase DONE
2013-05-09 00:45:00.843 Orbitink[2061:780b] STATE: PROTOCONNECT => DO handle 0x1015d8390; line 1180 (connection #0)
2013-05-09 00:45:00.843 Orbitink[2061:4503] DO phase starts
2013-05-09 00:45:00.843 Orbitink[2061:1803] CWD ..

2013-05-09 00:45:00.843 Orbitink[2061:5807] FTP 0x1020df710 (line 942) state change from STOP to CWD
2013-05-09 00:45:00.844 Orbitink[2061:780b] STATE: DO => DOING handle 0x1015d8390; line 1240 (connection #0)
2013-05-09 00:45:00.912 Orbitink[2061:4503] CWD orbitink

2013-05-09 00:45:00.912 Orbitink[2061:780b] 250 Directory successfully changed.

2013-05-09 00:45:00.983 Orbitink[2061:4503] CWD blog

2013-05-09 00:45:00.983 Orbitink[2061:780b] 250 Directory successfully changed.

2013-05-09 00:45:01.052 Orbitink[2061:4503] Server denied you to change to the given directory
2013-05-09 00:45:01.052 Orbitink[2061:780b] 550 Failed to change directory.

2013-05-09 00:45:01.052 Orbitink[2061:1803] DO phase failed

Источник

Русские Блоги

Монтирование FTP-сервера с помощью curlftpfs под Linux и возникшие проблемы

Смонтируйте FTP сервер с curlftpfs под Linux

1. Установите curlftpfs

1.1 Установить DAGrepository

Поскольку система CentOS не может напрямую использовать yum install curlftpfs для установки curlftpfs, сначала необходимо установить репозиторий DAG

rpm -Uhv http://apt.sw.be/RedHat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Или сначала выполните поиск rpmforge-release в Интернете, чтобы:http://www.rpmfind.net/linux/rpm2html/search.php?query=rpmforge-release, Загрузите rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm, после загрузки загрузите на сервер AS6 64, выполните rpm -Uhv rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm Установить

1.2 Установите curlftpfs: yum install curlftpfs

2. Смонтируйте ftp сервер

[Известно: здесь ftp-сервер — 192.168.201.1, где ftp-пользователь — ftp_test, пароль — 123, доступный каталог — / home / ftp_test, а также есть система b, в системе b существует каталог / home / b / doc2]

2.1 Эффект:/ home / ftp_test на ftp-сервере отображается в каталог / home / b / doc2 системы b

2.2 Ошибка:

Выполните следующую команду в системе b, предложив «сервер отказал вам в переходе в данный каталог»

curlftpfs -o rw,uid=500,gid=500,allow_other,codepage=utf8 ftp://ftp_test:[email protected]/home/ftp_test /home/b/doc2

Причина ошибки:

Неправильный путь пользователя ftp_test на ftp-сервере: выполните команду cat / etc / passwd на ftp-сервере, вы можете видеть, что по умолчанию путь пользователя ftp_test равен / home / ftp_test, поэтому путь пользователя ftp_test становится / home / в предыдущей команде ftp_test / home / ftp_test

Исправление:

Повторно введите следующую команду в системе b, монтирование прошло успешно

curlftpfs -o rw,uid=500,gid=500,allow_other,codepage=utf8 ftp://ftp_test:[email protected]/ /home/b/doc2

Эффект:

В каталоге / home / b / doc2 системы b вы можете увидеть файлы в каталоге ftp server / home / ftp_test

2.3 Подробные параметры команды:

curlftpfs -o codepage=utf8 ftp://username:[email protected] /ftp

кодовая страница: кодировка

имя пользователя: имя пользователя FTP

пароль: пароль FTP
192.168.1.111: адрес FTP
/ ftp: путь для подключения к

Открытый доступ

Чтобы другие пользователи могли читать и писать, uid и gid изменились на ваш собственный идентификатор

sudo curlftpfs –o rw,allow_other,uid=0,gid=0 ftp:// username: password @192.168.1.111 /ftp

Среди них: Следующие команды могут быть использованы для просмотра uid и gid:

Вы можете определить свой uid и gid, просмотрев файл / etc / passwd

Два числа после x — это uid и gid, где uid — 500, а gid — 500.

2.4 Авто монтирование при загрузке

Добавьте в конец файла / etc / fstab системы xb:

  • rw: права на чтение и запись, вы можете оставить только права на чтение (ro)

2.5 Снять крепление

В системе b: выполните следующую команду

Метод 1: ps -ef | grep ftp, затем используйте kill, чтобы остановить процесс монтирования

Источник

Thread: can’t play video from network drive

Thread Tools
Display

can’t play video from network drive

My network consists of a wireless router, a wired XP machine, a wired IOMega Home Network Hard Drive, and Intrepid on an older machine running wireless. The only way I’ve been able to connect to the nas from the Intrepid machine is to make it an FPT connection. I setup a bookmark, so I can just select from the Places pull down and I get a folder icon on my desktop that I can browse. I can open pictures, do slideshows, and I can even play music (mp3) by double-clicking and the movie player opens them and plays them. I was running the System Monitor and see that after I select a song it downloads a good bit of it first before it starts playing, and then after it starts playing about every 10 seconds it will request and get more of the file.

This doesn’t work with video files. After it downloads a good bit of the file and its about to play I get an error message «An error occurred. Could not read from resource.» I can play the files if I copy them to the local drive. I’ve installed Gstreamer and it doesn’t help, if I right-click on the file and select open with Movie Player(Gstreamer), same error message. After doing some research I installed VLC media player. It doesn’t work either. If I right click the file and select open with VLC media play, VLC will open, I’ll see in System Monitor that the file starts to download, but VLC will start to play a couple of frames of the video and then the application will close with no error message. Again, VLC will play a file fine if I copy down to the local drive first. To see if it might be something with the way the network drive is configured I tried to play the same media files from the XP machine with WMP and they work fine, even super huge DVD files. I’m only trying to do little digital camera generated mpgs on the Intrepid machine.

Anybody know what could be the problem? I’ve tried mounting the network drive so I can see it as a local folder but that doesn’t seem to work with this drive. I’ve checked around and alot of other people have a problem accessing this drive with Ubuntu. I don’t think thats my problem here with video since the applications start to pull down the files.

Re: can’t play video from network drive

If FTP works, and what you want is a mounted device, there is a way to have an FTP connection «pretend» to be a mounted device. It’s called FTPfs. I don’t know whether the perforamce will be good, but there shouldn’t be any more filesystme problems.

If this doesn’t work, then I do have a more complex suggestion or two.

Источник

Yum update

Hello! I have a big problem with update.

This is the answer from the server when i write this command (of course as root!):

yum repolist all
ftp://ftp.redhat.com/pub/redhat/linux/beta/6Workstation/en/os/SRPMS/repodata/repomd.xml: [Errno 14] PYCURL ERROR 9 — «Server denied you to change to the given directory»
Trying other mirror.
repo id repo name status
rhel-source Red Hat Enterprise Linux 6Workstation — i386 — So enabled: 2639
rhel-source-beta Red Hat Enterprise Linux 6Workstation Beta — i386 enabled: 0
virtualbox RHEL/CentOS-6Workstation / i386 — VirtualBox enabled: 0

And when i do yum update..

yum update
ftp://ftp.redhat.com/pub/redhat/linux/beta/6Workstation/en/os/SRPMS/repodata/repomd.xml: [Errno 14] PYCURL ERROR 9 — «Server denied you to change to the given directory»
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-source-beta. Please verify its path and try again

I think my repolist on /etc/yum.repos.d/ is corrupt or/and perhaps are wrong the keys on /etc/pki/rpm-gpg.

Someone can help me?

Responses

Try yum after disabling the source repos.

Change all «enbaled=1» to «enabled=0»

# yum repolist all

I get timeouts when connecting to the xmlrpc.redhat.com/XMLRPC

telnet xmlrpc.redhat.com 443 fails

telnet xmlrpc.redhat.com 80 works

So I wonder if something is work at the Red Hat sites.

Jan Gerrit Kootstra

The hostname you specified is not correct. The correct one is xmlrpc.rhn.redhat.com.

Just in case that was a typo in your post, we’ve checked to see if there were any outages or other connectivity problems with RHN recently, and none have been reported or detected. We’ve also been unable to reproduce any sort of issues when telnet’ing to these ports on the correct hostname from external sites.

Let us know if using that hostname doesn’t resolve your issue. If that’s the case, provide us with the error you are seeing.

John Ruemker, RHCA

Red Hat Technical Account Manager

Online User Groups Moderator

Hello, thanl you for yuor answer but i have already try it.

Now this is the my situation:

yum repolist all
virtualbox | 951 B 00:00
virtualbox/primary | 3.1 kB 00:00
virtualbox 8/8
repo id repo name status
rhel-source Red Hat Enterprise Linux 6Workstation — i386 — Sourc disabled
rhel-source-beta Red Hat Enterprise Linux 6Workstation Beta — i386 — disabled
virtualbox RHEL/CentOS-6Workstation / i386 — VirtualBox enabled: 8
repolist: 8
Now i haven’t error. of course, because the rhel repo are disabled. But, of course, no download update. I can update only irtualbox not my Rhel 6.

>> of course, because the rhel repo are disabled. But, of course, no download update.

If you are planning to update RHEL, then you need to register the system with RHN. The outputs do not show RHEL base channel repository active. Note that source Repo only provides source files of the packages coming with RHEL. It cannot provide system updates.

Regarding the source repo error, are you able to access those repositories mentioned in rhel-source.repo file?

I have already re-enabled packages and my rhel6 is correct active on rhn.

The problem is beta package.

I report coomand yum repolist all:

yum repolist all
ftp://ftp.redhat.com/pub/redhat/linux/beta/6Workstation/en/os/SRPMS/repodata/repomd.xml: [Errno 14] PYCURL ERROR 9 — «Server denied you to change to the given directory»
Trying other mirror.
repo id repo name status
rhel-source Red Hat Enterprise Linux 6Workstation — i386 — Source enabled: 2645
rhel-source-beta Red Hat Enterprise Linux 6Workstation Beta — i386 — Source enabled: 0
virtualbox RHEL/CentOS-6Workstation / i386 — VirtualBox enabled: 0
repolist: 2645

and the response when i do yum update:

yum update
ftp://ftp.redhat.com/pub/redhat/linux/beta/6Workstation/en/os/SRPMS/repodata/repomd.xml: [Errno 14] PYCURL ERROR 9 — «Server denied you to change to the given directory»
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-source-beta. Please verify its path and try again

Packages beta 0. itry disabled beta packages only but nothnig to do!

Thank you for your time.

I am sorry, it was a typo.

this is the serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC from /etc/sysconfig/rhn/up2date

LANG=C;yum -y update
Loaded plugins: aliases, auto-update-debuginfo, changelog, downloadonly, fastestmirror, filter-data, fs-snapshot, kabi, keys, list-data, local, merge-conf, post-transaction-actions, presto, priorities, product-id, protectbase, ps,
: refresh-packagekit, remove-with-leaves, rhnplugin, rpm-warm-cache, security, show-leaves, subscription-manager, tmprepo, tsflags, upgrade-helper, verify, versionlock
Updating Red Hat repositories.
Loading support for Red Hat kernel ABI
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:
Connection timed out
Loading mirror speeds from cached hostfile
Skipping filters plugin, no data
0 packages excluded due to repository protections
Setting up Update Process
No Packages marked for Update

Connected to xmlrpc.rhn.redhat.com.
Escape character is ‘^]’.
^]

telnet> quit
Connection closed.

time telnet xmlrpc.rhn.redhat.com 443
Trying 209.132.183.44.
telnet: connect to address 209.132.183.44: Connection timed out

real 0m21.005s
user 0m0.000s
sys 0m0.005s

source host: www.kootstra.org.uk

Jan Gerrit Kootstra

Are you behind a web proxy or a firewall that could be interfering with your connection?

John Ruemker, RHCA

Red Hat Technical Account Manager

Online User Groups Moderator

This has work in the past.

Whether iptables is active or off does not matter.

I do not have a proxy, and have direct access to my providers network.

I had to re-register using the noSSL serverUrl, now it works.

Jan Gerrit Kootstra

It looks like you are using a beta repo. (Hopefully not one that has recently gone to production, like 6.1.) Which version of RHEL beta are you running?

Hello Phil Jensen, this is my version (from command cat /etc/redhat-release):

Red Hat Enterprise Linux Workstation release 6.1 Beta (Santiago)

Any suggestion? I imagine the problem is the download of beta packages fron RHN.

This is my rhel-source.repo file:

[rhel-source]
name=Red Hat Enterprise Linux $releasever — $basearch — Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta — $basearch — Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta

I can’t find on RHN this file to download to do diff commmand beetween files..

If i disabled rhel-source-beta i havent error but nothing file on repository.. so no update.

yum repolist all
ftp://ftp.redhat.com/pub/redhat/linux/beta/6Workstation/en/os/SRPMS/repodata/repomd.xml: [Errno 14] PYCURL ERROR 9 — «Server denied you to change to the given directory»
Trying other mirror.
repo id repo name status
rhel-source Red Hat Enterprise Linux 6Workstation — i386 — Source enabled: 2647
rhel-source-beta Red Hat Enterprise Linux 6Workstation Beta — i386 — Source enabled: 0
virtualbox RHEL/CentOS-6Workstation / i386 — VirtualBox enabled: 0
repolist: 2647

but error yum upodate.

yum update
ftp://ftp.redhat.com/pub/redhat/linux/beta/6Workstation/en/os/SRPMS/repodata/repomd.xml: [Errno 14] PYCURL ERROR 9 — «Server denied you to change to the given directory»
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-source-beta. Please verify its path and try again

Thank you for your time.

i have also no idea whats going on with rhel6.1 and package updates. i have also done the several steps described but can’t downwnload any packages from RHN with yum like before.

I have no idea if this will be solved by redhat or if there wil be a usefulk description how to get yum runing for installing package from RHN again.

Источник

I am using curl php API to access FTP links. On a particular site, it gives error code 9 (access denied). However the link is accessible from IE and Firefox.

Then I run curl command line and it gave the same «access deinied» results.

> d:>curl -v ftp://ftp1.example.com/outgoing/EHF/dbex10win_en.zip
> * About to connect() to ftp1.example.com port 21 (#0)
> *   Trying 204.50.113.145...
> * connected
> * Connected to ftp1.example.com (204.50.113.145) port 21 (#0) < 220 Microsoft FTP Service
> > USER anonymous < 331 Anonymous access allowed, send identity (e-mail name) as password.
> > PASS ftp@example.com < 230-Welcome to Example FTP site! < 230 Anonymous user logged in.
> > PWD < 257 "/" is current directory.
> * Entry path is '/'
> > CWD outgoing < 550 outgoing: Access is denied.
> * Server denied you to change to the given directory
> * Connection #0 to host ftp1.example.com left intact curl: (9) Server denied you to change to the given directory
> > QUIT < 221
> * Closing connection #0

But the link works fine in Firefox. What is wrong with cUrl here? Thanks

tcole's user avatar

tcole

9476 silver badges14 bronze badges

asked Apr 10, 2012 at 17:23

cuteCAT's user avatar

2

Try fiddling with curl’s option —ftp-method

   --ftp-method [method]
          (FTP) Control what method curl should use to reach a file on  a
          FTP(S) server. The method argument should be one of the follow‐
          ing alternatives:

          multicwd
                 curl does a single CWD operation for each path  part  in
                 the given URL. For deep hierarchies this means very many
                 commands. This is how RFC 1738 says it should  be  done.
                 This is the default but the slowest behavior.

          nocwd  curl  does  no CWD at all. curl will do SIZE, RETR, STOR
                 etc and give a full path to the  server  for  all  these
                 commands. This is the fastest behavior.

          singlecwd
                 curl  does  one  CWD  with the full target directory and
                 then operates on the file "normally" (like in the multi‐
                 cwd  case).  This  is  somewhat more standards compliant
                 than 'nocwd' but without the full penalty of 'multicwd'.

answered Apr 17, 2012 at 22:45

Daniel Stenberg's user avatar

Daniel StenbergDaniel Stenberg

51.9k14 gold badges141 silver badges211 bronze badges

0

That means the specified directory does not exist in the remote/ftp server, hence the message «Server denied you to change to the given directory».

That message has got nothing to do with the local machine you are trying to download files into.

Login to ftp datacenter.myserver.com and see if the source directory exists.

answered Jan 11, 2019 at 15:31

Netsanet Gebremedhin's user avatar

it has nothing to do with CURL the error was very explicit Server denied you to change to the given directory … Its simply an access issue …

Adding username and password simply resolves the issue …

Why it works on browser … There is no automatic directory redirection .. why is it not working on curl ??? curl would use standard ftp process which would involve login before you change to relevant directory

You can what to use it directly via php …. fopen or file_get_content is a cheat i use … works as if your are accessing it via browser

Example

 set_time_limit(0);
 file_put_contents("out.zip", file_get_contents('ftp://204.50.113.145/outgoing/EHF/dbex10win_en.zip'));

works like charm

leek's user avatar

leek

11.7k8 gold badges44 silver badges61 bronze badges

answered Apr 10, 2012 at 23:02

Baba's user avatar

BabaBaba

93.2k28 gold badges165 silver badges215 bronze badges

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”

I am trying to get a better understanding of selinux and configuring a local ftp repository on Centos7.

I installed vsftpd on my host.

I created a repository on my host:

/var/ftp/pub/centos7
  EFI
  EULA
  GPL
  images
  isolinux
  LiveOS
  Packages
  repodata
  RPM-GPG-KEY-CentOS-7
  RPM-GPG-KEY-CentOS-Testing-7
  TRANS.TBL

When I try to list my available repository I get an error on my guest vm:

# yum repolist
Loaded plugins: fastestmirror
ftp://X.X.X.X/pub/centos7/repodata/repomd.xml: [Errno] FTP Error 550 - Server denied you to change to the given directory
Trying other mirror/
ftp://X.X.X.X/pub/centos7/repodata/repomd.xml: [Errno] FTP Error 550 - Server denied you to change to the given directory
Trying other mirror/

repo id     repo name            status
local-repo  Centos7 Repository   0
repolist: 0

However if I setenforce 0 or setsebool ftpd_full_access 1 my repository works.

repo id     repo name            status
local-repo  Centos7 Repository   3,723
repolist: 3,723

Obviously leaving setenforce to 0 is not advised but is leaving setsebool ftpd_full_access set to 1 the correct way to configure a local ftp repository? What am asking is, is there a correct way to configure an ftp repository with selinux running?

If anyone can point me in the right direction it will be greatly appreciated.

Sorry I couldn’t post a cleaner log — is this what you wanted?

2013-05-09 00:45:00.446 Orbitink[2061:780b] STATE: INIT => CONNECT handle 0x1015d8390; line 1001 (connection #-5000)
2013-05-09 00:45:00.446 Orbitink[2061:4503] About to connect() to 192.168.100.178 port 21 (#0)
2013-05-09 00:45:00.446 Orbitink[2061:1803] Trying 192.168.100.178…
2013-05-09 00:45:00.446 Orbitink[2061:5807] Adding handle: conn: 0x1020df200
2013-05-09 00:45:00.447 Orbitink[2061:780b] Adding handle: send: 0
2013-05-09 00:45:00.447 Orbitink[2061:4503] Adding handle: recv: 0
2013-05-09 00:45:00.447 Orbitink[2061:1803] Curl_addHandleToPipeline: length: 1
2013-05-09 00:45:00.447 Orbitink[2061:5807] 0x100927600 is at send pipe head!
2013-05-09 00:45:00.447 Orbitink[2061:780b] — Conn 0 (0x1020df200) send_pipe: 1, recv_pipe: 0
2013-05-09 00:45:00.448 Orbitink[2061:4503] STATE: CONNECT => WAITCONNECT handle 0x1015d8390; line 1048 (connection #0)
2013-05-09 00:45:00.520 Orbitink[2061:780b] Connected to 192.168.100.178 (192.168.100.178) port 21 (#0)
2013-05-09 00:45:00.520 Orbitink[2061:1803] STATE: WAITCONNECT => PROTOCONNECT handle 0x1015d8390; line 1161 (connection #0)
2013-05-09 00:45:00.520 Orbitink[2061:4503] FTP 0x1020df710 (line 3260) state change from STOP to WAIT220
2013-05-09 00:45:00.595 Orbitink[2061:780b] 220 (vsFTPd 2.3.5)

2013-05-09 00:45:00.595 Orbitink[2061:4503] USER ftpuser

2013-05-09 00:45:00.595 Orbitink[2061:1803] FTP 0x1020df710 (line 843) state change from WAIT220 to USER
2013-05-09 00:45:00.667 Orbitink[2061:780b] 331 Please specify the password.

2013-05-09 00:45:00.667 Orbitink[2061:4503] PASS ####
2013-05-09 00:45:00.667 Orbitink[2061:1803] FTP 0x1020df710 (line 2635) state change from USER to PASS
2013-05-09 00:45:00.773 Orbitink[2061:780b] 230 Login successful.

2013-05-09 00:45:00.773 Orbitink[2061:4503] PWD

2013-05-09 00:45:00.773 Orbitink[2061:1803] FTP 0x1020df710 (line 855) state change from PASS to PWD
2013-05-09 00:45:00.842 Orbitink[2061:780b] 257 «/var/www»

2013-05-09 00:45:00.842 Orbitink[2061:4503] Entry path is ‘/var/www’
2013-05-09 00:45:00.842 Orbitink[2061:1803] FTP 0x1020df710 (line 2952) state change from PWD to STOP
2013-05-09 00:45:00.843 Orbitink[2061:5807] protocol connect phase DONE
2013-05-09 00:45:00.843 Orbitink[2061:780b] STATE: PROTOCONNECT => DO handle 0x1015d8390; line 1180 (connection #0)
2013-05-09 00:45:00.843 Orbitink[2061:4503] DO phase starts
2013-05-09 00:45:00.843 Orbitink[2061:1803] CWD ..

2013-05-09 00:45:00.843 Orbitink[2061:5807] FTP 0x1020df710 (line 942) state change from STOP to CWD
2013-05-09 00:45:00.844 Orbitink[2061:780b] STATE: DO => DOING handle 0x1015d8390; line 1240 (connection #0)
2013-05-09 00:45:00.912 Orbitink[2061:4503] CWD orbitink

2013-05-09 00:45:00.912 Orbitink[2061:780b] 250 Directory successfully changed.

2013-05-09 00:45:00.983 Orbitink[2061:4503] CWD blog

2013-05-09 00:45:00.983 Orbitink[2061:780b] 250 Directory successfully changed.

2013-05-09 00:45:01.052 Orbitink[2061:4503] Server denied you to change to the given directory
2013-05-09 00:45:01.052 Orbitink[2061:780b] 550 Failed to change directory.

2013-05-09 00:45:01.052 Orbitink[2061:1803] DO phase failed

Понравилась статья? Поделить с друзьями:
  • Error constructing cesiumwidget
  • Error connecting to ftp access denied 530
  • Error connecting to device st link v2 error 0x21
  • Error connecting to database zabbix postgresql ubuntu
  • Error connecting to database postgres zabbix