Oracle linux ftp server

To Install and configure vsftpd server on oracle linux

• FTP stands for file transfer protocol, used for transfer files from a server to the network. • FTP is built on a client–server model architecture. • The initial client-to-server connection on port 21.

Installation steps :

Step 1 : check the OS version by using the below command

[[email protected] ~]# cat /etc/os-release NAME="Oracle Linux Server" VERSION="8.4" ID="ol" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="8.4" PLATFORM_ID="platform:el8" PRETTY_NAME="Oracle Linux Server 8.4" 

Step 2 : Install vsftpd packages by using the below command

 [[email protected] ~]# yum install vsftpd Last metadata expiration check: 20:47:21 ago on Friday 26 November 2021 09:35:06 AM IST. Dependencies resolved. Installing: vsftpd x86_64 3.0.3-34.el8 ol8_appstream 181 k Verifying : vsftpd-3.0.3-34.el8.x86_64 1/1 Installed: vsftpd-3.0.3-34.el8.x86_64 Complete! 

Step 3 : Start the vsftpd service by using the below command

Step 4 : Enable the vsftpd service by using the below command

 [[email protected] ~]# systemctl enable vsftpd Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service. 

Step 5 : Check the status of vsftpd service by using the below command

 [[email protected] ~]# systemctl status vsftpd ● vsftpd.service - Vsftpd ftp daemon Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2021-11-27 06:22:52 IST; 28s ago Main PID: 6863 (vsftpd) Tasks: 1 (limit: 10509) Memory: 648.0K CGroup: /system.slice/vsftpd.service └─6863 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf Nov 27 06:22:52 linuxhelp systemd[1]: Starting Vsftpd ftp daemon. Nov 27 06:22:52 linuxhelp systemd[1]: Started Vsftpd ftp daemon. 

**Step 6 : Create user for ftp by using the below command** «` [[email protected] ~]# useradd ftpuser «` **Step 7 : Set password for the ftpuser by using the below command** «` [[email protected] ~]# passwd ftpuser Changing password for user ftpuser. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully «`

Step 8 : Add the ftpuser into userlist file by using the below command

[[email protected] ~]# vim /etc/vsftpd/user_list # vsftpd userlist # If userlist_deny=NO, only allow users in this file # If userlist_deny=YES (default), never allow users in this file, and # do not even prompt for a password. # Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers # for users that are denied. root bin daemon adm lp sync shutdown halt mail news uucp operator games nobody ftpuser 

step 9 : Edit the configuration file ensure the followings lines are uncomment by using the below command

[[email protected] ~]# vim /etc/vsftpd/vsftpd.conf anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES listen=NO listen_ipv6=YES pam_service_name=vsftpd userlist_enable=YES userlist_deny=NO 

step 10 : Restart the vsftpd service by using the below command

Читайте также:  Linux freeing disk space

Step 11 : create some files in ftpuser home directory by using the below command

Step 12 : check whether the client package is installed by using the below command

[[email protected] ~]# rpm -q ftp package ftp is not installed 

step 13 : Install the ftp package by using the below command

 [[email protected] ~]# yum install ftp Loaded plugins: langpacks, ulninfo Resolving Dependencies --> Running transaction check ---> Package ftp.x86_64 0:0.17-67.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved Installing: ftp x86_64 0.17-67.el7 ol7_latest 60 k Install 1 Package Total download size: 60 k Verifying : ftp-0.17-67.el7.x86_64 1/1 Installed: ftp.x86_64 0:0.17-67.el7 Complete! 

Step 14 : Connect to the ftp server by using the below command

[[email protected] ~]$ ftp 192.168.6.132 Connected to 192.168.6.132 (192.168.6.132). 220 (vsFTPd 3.0.3) Name (192.168.6.132:linux): ftpuser 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. 

Step 15 : List the content by using the below command

ftp> ls 227 Entering Passive Mode (192,168,6,132,246,40). 150 Here comes the directory listing. -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc1 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc10 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc2 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc3 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc4 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc5 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc6 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc7 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc8 -rw-r--r-- 1 0 0 0 Nov 27 01:15 abc9 226 Directory send OK. 

Step 16: Download the contents by using the below command

ftp> get abc1 local: abc1 remote: abc1 227 Entering Passive Mode (192,168,6,132,22,142). 150 Opening BINARY mode data connection for abc1 (0 bytes). 226 Transfer complete. 

Step 17 : Check the downloads by using the below command

ftp> !ls abc1 Desktop Documents Downloads Music Pictures Public Templates test.txt Videos 

step 18 : Exit from the ftp

By this Installation and configuration of vsftpd server on oracle Linux has come to an end.

Источник

Oracle linux ftp server

Install and Configure vsftpd

The vsftpd server is a secure and fast FTP server for UNIX systems. Install and configure vsftpd on the Solaris or Linux host to be used as the FTP server.

ftp://vsftpd.beasts.org/users/cevans/
[BINARY] vsftpd-2.0.5.tar.gz. . . . . . . . . . . [Mar 19 21:26] 149K [FILE] vsftpd-2.0.5.tar.gz.asc. . . . . . . . . [Mar 19 21:26] 189B
# Standalone mode listen=YES max_clients=200 max_per_ip=4 # Access rights anonymous_enable=YES #chroot_local_user=YES #userlist_enable=YES ftp_username=ftp local_enable=YES write_enable=YES anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES chown_uploads=YES chown_username=ftp # Security anon_world_readable_only=NO allow_anon_ssl=YES ssl_enable=YES connect_from_port_20=YES hide_ids=YES pasv_min_port=50000 pasv_max_port=60000 # Features ftpd_banner="Welcome to the FTP Service" xferlog_enable=YES ls_recurse_enable=NO ascii_download_enable=NO async_abor_enable=YES # Performance one_process_model=NO idle_session_timeout=120 data_connection_timeout=300 accept_timeout=60 connect_timeout=60 anon_max_rate=50000

Note: Copies of the vsftpd.conf file appear in several locations in the vsftpd-2.0.5 directory structure. If you use one of those files to create the vsftpd.conf file in the /etc directory, ensure that it only includes the parameters and settings described in Step 9.

mkdir /var/ftp useradd -d /var/ftp ftp chown root /var/ftp chmod og-w /var/ftp mkdir /usr/share/empty mkdir /usr/share/ssl mkdir /usr/share/ssl/certs
openssl req -x509 -nodes -newkey rsa:1024 -keyout /usr/share/ssl/certs/vsftpd.pem -out /usr/share/ssl/certs/vsftpd.pem

Источник

Читайте также:  Call bomber kali linux

Linux HTTP and FTP Server Configuration

This article describes the configuration of default HTTP and FTP servers on Linux, with specific reference to the information needed for the RHCSA EX200 certification exam. A separate articles will cover the information required for HTTP server portion of the RHCE EX300 exam.

Remember, the exams are hands-on, so it doesn’t matter which method you use to achieve the result, so long as the end product is correct.

HTTP Server

The requirement for the RHCSA exam is very simple. For a more detailed discussion of the HTTP server read the article here.

Issue the following command to install the HTTP server.

Make sure the «/etc/hosts» file contains references for the loopback address and the hostname.

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.122.89 rhce1.localdomain rhce1

Turn on the HTTP server and make sure it starts automatically on reboot.

# service httpd start # chkconfig httpd on

The HTTP server is now installed and running. The HTTP configuration files are located under the «/etc/httpd» directory, with the main configuration file being the «/etc/httpd/conf/httpd.conf» file. The default document root is «/var/www/html». Any files or directories below this point will be visible using a browser once you configure the firewall.

You need to punch a hole in the firewall for port 80 to make sure the HTTP server can be accessed from the network. There are several ways to do this:

  • The «Firewall Configuration» dialog from the menu (System > Administration > Firewall) or initiated from the command line by running the system-config-firewall command. On the «Trusted Services» section, scroll down the list and check the «WWW (HTTP)» option, then click the «Apply» button.
  • The text-based «Firewall Configuration» utility ( system-config-firewall-tui ). This is the text-based version of the above dialog.
  • Using the iptables service directly, as described here. In this case we could need the following entry.
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

This is all you need to know for the RHCSA exam. The RHCE exam covers the HTTP server in more depth, as described here.

FTP Server

This section covers the File Transport Protocol (FTP) information needed for both the RHCSA and RHCE exams.

FTP Server : Installation

Issue the following command to install the FTP server.

Turn on the FTP server and make sure it starts automatically on reboot.

# service vsftpd start # chkconfig vsftpd on

The FTP server is now installed and running. The FTP configuration files are located under the «/etc/vsftpd» directory, specifically the «/etc/vsftpd/vsftpd.conf» file. The default directory for anonymous connections is «/var/ftp». Changes to the «/etc/vsftpd/vsftpd.conf» file have to be followed by a reload or a restart of the httpd service.

# service vsftpd reload # # OR # service vsftpd restart

FTP Server : Firewall

You need to punch a hole in the firewall for port 21 to make sure the FTP server can be accessed from the network. There are several ways to do this:

  • The «Firewall Configuration» dialog from the menu (System > Administration > Firewall) or initiated from the command line by running the system-config-firewall command. On the «Trusted Services» section, scroll down the list and check the «FTP» option, then click the «Apply» button.
  • The text-based «Firewall Configuration» utility ( system-config-firewall-tui ). This is the text-based version of the above dialog.
  • Using the iptables service directly, as described here. In this case we could need the following entry.
iptables -A INPUT -p tcp --dport 21 -j ACCEPT

FTP Server : SELinux

If you are using SELinux, you will need to consider the following points.

The SELinux booleans associated with the vsftpd service are displayed using the getsebool command.

# getsebool -a | grep ftpd allow_ftpd_anon_write --> off allow_ftpd_full_access --> off allow_ftpd_use_cifs --> off allow_ftpd_use_nfs --> off ftpd_connect_db --> off ftpd_use_passive_mode --> off #

The setsebool command is used to set a specific boolean value.

# setsebool ftpd_use_passive_mode on # setsebool ftpd_use_passive_mode off

The public_content_t context should be assigned to all public content.

# semanage fcontext -a -t public_content_t "/var/ftp(/.*)?" # restorecon -F -R -v /var/ftp

You can check the current context setting on files and directories using the «ls -alZ» command.

More information on SELinux can be found here.

FTP Server : Security

By default the FTP installation allows anonymous access, which is potentially dangerous. This is fine for the RHCSA exam, but on real servers you would probably want to disable anonymous access. To do this, edit the «/etc/vsftpd/vsftpd.conf» file, setting the «anonymous_enable» entry as follows.

anonymous_enable=NO local_enable=YES

The «local_enable» options indicates that local user accounts can be used for authentication.

Restart or reload the FTP service for the changes to take effect.

The RHCE exam has a requirement for configuring an anonymous-only download FTP server. This can be done by setting the following values in the «/etc/vsftpd/vsftpd.conf» file, then restarting the service.

anonymous_enable=YES anon_upload_enable=NO local_enable=NO

Controlling access from specific servers can be done using the Linux firewall, as described here.

Hope this helps. Regards Tim.

Created: 2012-03-24 Updated: 2015-06-27

Источник

Оцените статью
Adblock
detector