0

Please help me to understand where I was wrong, because I've read a lot of articles also I've seen lot's of Youtube videos, but all the time in the end I've got the same error result.

So, on my Server machine (192.168.25.146) I've install from the rpms: ftp, vsftpd, createrepo and dnf-utils packages. Then, I've moved inside OS iso directory (/run/media/dmitriy/RHEL-8-0-0-BaseOS-x86_64/) and copied all it's content to the /var/ftp/pub directory.

Next, I've moved to the vsftpd config file and changed next:

anonymous_enable=YES

anon_upload_enable=YES

chown_uploads=YES

chown_username=daemon

After that,I've addede port 21/tcp and service to the firewalld:

public (active)
target: default
icmp-block-inversion: no
interfaces: ens160
sources: 
services: cockpit dhcpv6-client ftp ssh
ports: 21/tcp 22/tcp
protocols: 
masquerade: no
forward-ports: 
source-ports: 
icmp-blocks: 
rich rules:

Then, I've configured my local repo file (/etc/yum.repos.d/server.repo):

[server]
name=server
baseurl=ftp://192.168.25.146/pub
enabled=1
gpgcheck=0

Then, I've enabled booleans:

getsebool -a | grep ftp
ftpd_full_access --> on

After that I,ve performed createrepo /var/ftp/pub

Finally, I've restarted vsftpd and the command yum repolist displayed me that everything on server machine nice:

[root@control ~]# yum repolist 
Updating Subscription Management repositories.
Last metadata expiration check: 0:27:12 ago on Sat 04 Jul 2020 12:15:21 AM EEST.
repo id                                             repo name                                                                 status
server                                              server                                                                 6,328
ansible-2.8-for-rhel-8-x86_64-rpms                  Red Hat Ansible Engine 2.8 for RHEL 8 x86_64 (RPMs)                           13
rhel-8-for-x86_64-appstream-rpms                    Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                  10,766
rhel-8-for-x86_64-baseos-rpms                       Red Hat Enterprise Linux 8 for x86_64 - BaseOS ( RPMs)                      4,834

Also, see the ftp connection to the localhost:

[root@control ~]# ftp localhost
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.3)
Name (localhost:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||17555|)
150 Here comes the directory listing.
drwxr-xr-x    3 0        0          380928 Jul 03 19:33 pub
226 Directory send OK.
ftp> 

Now, I went to my Client machine I configured my repo file in ** /etc/yum.repos.d/client.repo

[root@ansible1 ~]# cat /etc/yum.repos.d/client.repo 
[client]
name = client
baseurl = ftp://192.168.24.146/pub
gpgcheck = 0
enabled = 1

I've enabled booleans, made the same changes in /etc/vsftpd/vsftpd.conf, installed ftp, vsftpd, but when I logged to the ftp I do not see my packages.

I also don't do all these things on client machine, but just configured repo file, but result the same, when I perform yum repolist I've got:

[root@ansible1 ansible]# yum repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
client                                   0.0  B/s |   0  B     00:21    
Failed to synchronize cache for repo 'client', ignoring this repo.

FTP connection from client to server:

[root@ansible1 ~]# ftp 192.168.25.146
Connected to 192.168.25.146 (192.168.25.146).
220 (vsFTPd 3.0.3)
Name (192.168.25.146:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,25,146,121,86).
ftp: connect: No route to host
ftp

I've also added

#/etc/vsftpd/vsftpd.conf
 pasv_max_port=40000
 pasv_min_port=

Firewall

[root@control ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens160
  sources: 
  services: cockpit dhcpv6-client ftp ssh
  ports: 21/tcp 22/tcp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
   rich rules: 

Please help me to understand where I was wrong!!!

d1masta94
  • 1
  • 1
  • 4
  • You should try to FTP from the actual client machine to the actual server, not from localhost. – Michael Hampton Jul 03 '20 at 19:08
  • When I type `ftp` and double TAB I see just localhosts proposed addresses, when i typed server' ip, I obtained an error: 500 OOPS: vsftpd: cannot locate user specified in 'chown_username':deamon Even after i commented field **chown_username=deamon** – d1masta94 Jul 03 '20 at 19:44
  • Do you have a user by that name? – Michael Hampton Jul 03 '20 at 20:04
  • Why did you specify that username if it does not exist? – Michael Hampton Jul 03 '20 at 20:08
  • Added main text, olease see it, I've logged in but have such a message: **ftp: connect: No route to host** howor where to write this route ? – d1masta94 Jul 03 '20 at 20:12
  • Anybody have some ideas? – d1masta94 Jul 03 '20 at 20:53
  • I don't see anywhere in your post where you explain why you have added `chown_username=daemon`. I already asked about this but you did not respond. Can you point me to this reason? – Michael Hampton Jul 03 '20 at 20:57
  • I've deleted this row and now I am able to connect, but see the message **No route** when I'm trying to enter **ls** or other commands. Why? If its so important - mistakenly, because as I mentioned previously I'm new and try to do as mentioned in articles or videos that I've read/seen.Are you able to help me to understand how or where to write this route? – d1masta94 Jul 04 '20 at 08:41

0 Answers0