Ftp Server Only Uploads to Main Directory
In this tutorial we will learn how to use vsftpd on Linux to brand Ubuntu machine run as ftp server and transfer files over wifi on local network.
On many occasion you lot need to copy and fill-in files locally from ane computer to other. Using concrete disk similar flash drive or external hard bulldoze is not always feasible due to many constraints such large file size, external drive availability.
- Setup
- Install VSFTP demon on Ubuntu
- Configure VSFTPD for uploads (Optional)
- Configure Ubuntu firewall for FTP
- Configure Windows Firewall
- Initiate FTP session using Windows control line
- Initiate FTP connexion using ftp client on windows
- Understanding Security Aspects - Firewall and Services
Setup
We tin take advantage of machines beingness on same network to achieve file transfer.
To follow this guide y'all should have admission to following
- Ubuntu Machine
- Windows Motorcar
- Both machines connected over same network using ethernet or wifi
How to install VFTP on Ubuntu
Open up Terminal to become and install vsftp
demon from official ubuntu repository.
sudo apt-get install vsftpd
Above control will install vsftp
demon which means it will always be running in background upon automobile startup using init
.
Employ post-obit commands to cheque vsftp service
sudo service vsftpd status
If service is running then above command will output condition of service with all spawned vsftp
process ids.
Alternatively you can also bank check vsftp procedure with grep
ps -ef | grep vsftp
How to configure VSFTP for Uploads
This step is optional but if you desire to allow uploads from remote machine to your ubuntu server then follow beneath configuration.
After installation vsftp will create configuration file at path /etc/vsftpd.conf
. This file should be owned past root
and should take default vsftp configuration. By default VSFTP will not allow ftp uploads; to enable it uncomment line write_enable=Aye
# Uncomment this to enable whatsoever form of FTP write control. write_enable=YES
Note that /etc/vsftpd.conf
would be owned past root
, to make any changes in configuration do. sudo vim /etc/vsftpd.conf
or sudo gedit /etc/vsftpd.conf
Restart vsftpd demon once configuration is completed.
sudo service vsftpd restart
Check status after restart.
sudo service vsftpd status
How to configure Ubuntu firewall for FTP
By default ubuntu shall exist running firewall known as uncomplicated firewall (ufw
). Default firewall rules will not allow any exterior connection.
To open ftp port on this firewall use following commands.
Check firewall status using
sudo ufw status
Firewall should exist active and running. If it's non active so enable the same using post-obit command to make your auto secure.
You tin go along information technology disable if you have such requirement, withal it's recommended to go on it on. sudo ufw enable
To open up ftp port 21
apply following command
sudo ufw allow ftp
or sudo ufw allow 21
This will add firewall dominion to have ftp connections from other machine on network. After adding ftp rule you should have following entries in your firewall. sudo ufw status
Status: agile To Activeness From -- ------ ---- 21/tcp ALLOW Anywhere 21/tcp (v6) Let Anywhere (v6)
Configure Windows Firewall
Firewall should permit you to initiate ftp session from windows auto. Search for Windows Firewall in start menu to open firewall configuration window.
Since we are going to use one time ftp we will disable firewall and reenable information technology once ftp is washed. Depending upon which network yous are connected to Dwelling or Public you lot can disable firewall like beneath.
Note that disabling complete firewall is non recommended. If you are going to use ftp server regularly from windows car then please create firewall rules under Windows Firewall with Advanced Security on Port 21
Initiate FTP session using Windows command line
Once we are done with required configurations we can initiate offset ftp connection from windows command line. First get IP address of machine hosting FTP server using command ifconfig
on ubuntu automobile. Apply eth0 inet address
if yous are connected with ethernet cable. For wireless connectedness apply inet
address of wlan0
interface. My ubuntu auto have following local IP 192.168.2.102
.
ifconfig
eth0 Link encap:Ethernet UP BROADCAST MULTICAST MTU:1500 Metric:ane RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:thou RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet inet addr:192.168.two.102 Bcast:192.168.2.255 Mask:255.255.255.0 Up BROADCAST RUNNING MULTICAST MTU:1500 Metric:one RX packets:24006 errors:0 dropped:0 overruns:0 frame:0 TX packets:8312 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:yard RX bytes:12996852 (12.nine MB) TX bytes:1224374 (1.2 MB)
To initiate connection open up command prompt on windows and use following command. ftp 192.168.2.102
It volition enquire for username and password. Username will exist same name as the ubuntu user (techmonger in my example) and countersign will the ubuntu'south organization password of user.
To get file from ubuntu ftp server, navigate to directory and apply get command similar below.
ftp>get filename
To upload file from windows machine to ftp server, put command similar beneath.
ftp>put filename
To end ftp session use bye.
ftp>bye
Initiate FTP connexion usign ftp customer on windows
By now y'all would concur that doing ftp from windows command prompt is bit tiresome. We tin use ftp client such as winscp or filezilla to go GUI for ftp operations.
Use hostname as IP address of ftp server (192.168.ii.102 in my example) and same credentials as those of ubuntu user.
Similar below you tin can initiate connectedness from filezilla. You can employ drag and drib to download and upload files from windows machine.
FTP Security Aspects - Firewall and Services
All ftp connections will be initiated in obviously text. You should only use higher up method if you are in local network and have consummate control over network. For encrypted connections utilize sftp
or ftps
.
-
Remove firewall rule from ubuntu once ftp requirement is over.
-
Enable Winows firewall once ftp requirement is over.
-
End vsftp demon if ftp is no longer needed to save arrangement resources. It volition besides brand your system less vulnerable.
sudo service vsftpd stop
sudo ufw deny ftp
or sudo ufw deny 21
Conclusion : You tin make your ubuntu machine to run as ftp server and can transfer files locally. You lot do non need SMB (server message cake) for file transfer between linux motorcar and windows machine over network.
Source: https://techmonger.github.io/3/linux-windows-ftp/
0 Response to "Ftp Server Only Uploads to Main Directory"
إرسال تعليق