LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-30-2015, 02:00 PM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Getting URL ERROR 9 - Server denied you to change to the given directory for YUM


I have a RHEL home lab, studying for RHCSA.

I have a vsftpd on a server which hosts all of the rpms that I need.

On a client, I have setup a .repo file under /etc/yum/yum.repo.d and when trying to do yum repolist, I continue to get the following:

URL ERROR 9 - "Server denied you to change to the given diretory"

Here is the file under /etc/yum/yum.repo.d titled apacheftp.example.com.repo

[code]
[localyumserver]
name="ApacheFTP.example"
baseurl=ftp://ApacheFTP.example.com/var/ftp/pub/inst
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


I've disabled iptables on FTP server along with running the following commands for SELinux

setsebool -P ftp_home_dir on

I've also ran the following:

chcon -R-t public_content_t /var/ftp/pub/inst/repodata/repomd.xml

and

chcon -R -t public_content_t /var/ftp/pub/inst

I've disabled SELinux on the client and still continue to get the same error.

I'm not sure what I'm doing or what needs to be changed to fix this.

thanks
 
Old 05-30-2015, 02:42 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
baseurl=ftp://ApacheFTP.example.com/var/ftp/pub/inst
i take it this is NOT the real line in this file


make 100 sure that YOUR DIFFERENT line is correct
 
Old 05-30-2015, 06:54 PM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by John VV View Post
i take it this is NOT the real line in this file


make 100 sure that YOUR DIFFERENT line is correct
I don't understand what you are asking.

Yes what I've posted for the baseline url is the real line in the .repo file. I used either ip address or FQDN and still not working.

I don't understand what you mean by the DIFFERENT line?

All the examples I find online are like this:

Code:
[foo]
name=Foo for RHEL/ CentOS $releasever - $basearch
baseurl=http://foo.foo_foo.com/RHELv6_x86_64/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt

Last edited by JockVSJock; 05-30-2015 at 06:58 PM.
 
Old 06-04-2015, 04:41 PM   #4
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
baseurl=ftp://ApacheFTP.example.com/var/ftp/pub/inst

you need to replace ApacheFTP.example.com with the URL or IP address of the server you have hosting the files.
 
Old 06-06-2015, 10:12 AM   #5
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Even with the ip address of the server in the file, I'm still getting the same error:

This is the file under /etc/yum.repos.d

Code:
[localyumserver]
name="ApacheFTP.example" 
baseurl=ftp://192.168.122.254/var/ftp/pub/inst
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
 
Old 06-06-2015, 12:18 PM   #6
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
While I have never built one of these before, I have had experience with local repo servers. It has been a few years though. What caught my eye was you are using specifically RHEL, which is a licensed yum distro rather than an open yum repo. I found some documentation on this but you will need to refer again to the specific version you are using, RHEL 6, RHEL 7 etc.

7.4.6. Creating a Yum Repository
https://access.redhat.com/documentat...epository.html
 
Old 06-06-2015, 01:08 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
http://foo.foo_foo.com/RHELv6_x86_64/$releasever/$basearch/
?? do you REALLY OWN the web site "foo_foo.com"
so you OWN that regestry ?

you HAVE to use a real address

see the above link "Creating a Yum Repository"
 
1 members found this post helpful.
Old 06-08-2015, 07:36 AM   #8
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by John VV View Post
?? do you REALLY OWN the web site "foo_foo.com"
so you OWN that regestry ?
These are VMs that are on a private network, using /etc/hosts to resolve locally, not on the public Internet, so I'm not understanding why you are asking me this?
 
Old 09-20-2020, 06:53 PM   #9
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
I have got this error when in the FTP client i have set the server's directory "/" thinking it will be considered as a FTP root directory, not system root directory. So i guess this eror may appear if is defined for example some wrong - system path to which FTP user has no access/rights (chmod, chown, selinux).
 
Old 09-21-2020, 07:29 AM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by postcd View Post
I have got this error when in the FTP client i have set the server's directory "/" thinking it will be considered as a FTP root directory, not system root directory. So i guess this eror may appear if is defined for example some wrong - system path to which FTP user has no access/rights (chmod, chown, selinux).
Right; that's what was said above. And this thread had been closed for FIVE YEARS before you reopened it, like the other thread you reopened after ten. Also, you didn't appear to read what was posted or why. The OP was trying to build an RHEL repository....not set up an FTP server.
 
  


Reply

Tags
iptables, rhel 6, selinux, yum, yum repository



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installed SASL with Yum, error on run: Cannot open shared object; Per denied mmem700 Linux - Server 1 02-01-2012 07:41 AM
cannot change directory to /home/oracle: Permission denied nbeayni Linux - Newbie 14 11-08-2010 09:38 AM
yum IOError: <urlopen error unknown url type: media> yuanjunliang Linux - Server 2 01-27-2010 07:29 PM
Sound error (permission denied in /dev directory) davidas Debian 9 05-06-2009 12:29 PM
Squid url port 81 access-denied error steve@korehicom.com Linux - Networking 0 10-13-2005 09:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration