Upload Files to Ubuntu Server From Windows
Previously we accept shown yous how to remotely connect to your Linux auto from a Windows 1 (Click here). Now, what if you need to transfer some files between your Windows and Linux systems?
Well, a USB drive comes handy for simple data transfers. For a large number of files at different times, you need some other efficient method. Transferring your data betwixt Linux and Windows using your local network is the recommended choice. With an easy and quick one time setup, you tin share your files between various machines.
File Sharing between Linux and Windows Systems
In this tutorial, we shall walk you lot through sharing your files between Ubuntu and Windows machines over a local network, and we shall also prove you how to transfer files betwixt Windows and Linux on the aforementioned PC.
Over the Network
Transferring files between Ubuntu and Windows tin can be washed in many ways, but in this tutorial, we are going to discuss the following popular methods:
- Transfer files between Ubuntu and Windows via the SSH.
- Transfer files between Ubuntu and Windows using Samba.
- Transfer files betwixt Ubuntu and Windows using Shared Network Folders.
Method 1: Transfer Files Between Ubuntu And Windows Via SSH
In this method, you demand to install and enable SSH service on Ubuntu. Also, we need an SSH client awarding on Windows. In this tutorial, we shall exist using Putty. Next, we are going to employ the command line to share your files across the network.
Pace 1. Install the SSH package on Ubuntu using the next command.
sudo apt install openssh-server
Step 2. After installation finishes successfully, yous can bank check the SSH service status using the following command.
sudo service ssh status
The output of the command should look like the below screenshot:
If the service is not running, yous tin utilise the following command to start information technology:
sudo service ssh get-go
As well, to enable the SSH service to first every time your system starts up, you tin use the following command:
sudo service ssh enable
Step 3. Install the cyberspace-tools bundle.
sudo apt install internet-tools
Step 4. Execute the next command to become your Ubuntu machine IP.
ifconfig
Footstep 5. From your Windows machine, we demand an SSH client (which is Putty) and a PSCP. PSCP is considered a secure copy tool that is used alongside with Putty to transfer files securely over a network.
Yous can download both (Putty and PSCP) from the Putty official website. (Click here.) Kindly note that Putty volition need to be installed while the PSCP won't. You accept to put the PSCP.exe in the "C:\" drive to be used, every bit yous should run into presently.
Step 6. Now open the file explorer and use the next command to get-go transferring your files from your Windows machine to Ubuntu.
c:\pscp "C:\Ubuntu Tutorials\Windows Shared Folder\Windows Shared Folder.txt" hendadel@192.168.1.eight:windowssharedfile.txt
Footstep 7. Next, you should enter your Ubuntu password.
Step 8. After entering the password successfully, the control shall copy the text file from your Windows motorcar to your Ubuntu habitation. You can bank check your dwelling house directory at present, and you should notice the file at that place.
Pace ix. Now in case y'all need to transfer your files from Ubuntu machine to Windows, open the file explorer from your Windows auto and use the next control. Be conscientious, and practice not forget the dot at the end of the command.
c:\pscp hendadel@192.168.1.8:ubuntushared .
By executing the previous command, y'all should enter the password of your Ubuntu motorcar. Next, the file gets transferred from Ubuntu to the Windows electric current directory.
Method 2: Transfer Files Via Samba
In this method, we are going to install the Samba parcel on Ubuntu. Moreover, use the Windows run application to connect to the Ubuntu shared directories.
Step i. Install the Samba bundle on Ubuntu using the post-obit command.
sudo apt install samba
Step 2. You can set a countersign to the samba share as follows.
sudo smbpasswd -a hendadel
where hendadel is an Ubuntu user that you shall use while accessing the Ubuntu shared directory.
Step 3. Let'due south create a directory that is used for sharing your files.
mkdir /home/hendadel/UbuntuSharedDir
Step 4. Using your favorite text editor, open up the samba configuration file.
sudo vi /etc/samba/smb.conf
Step 5. Add the next lines at the cease of the samba configuration file.
[UbuntuSharedDir] path = /home/hendadel/UbuntuSharedDir bachelor = yeah valid users = hendadel read only = no browsable = yes public = aye writable = yep
The samba configuration file should like the beneath:
Save and go out the samba configuration file.
Step six. Restart the samba service using the following command:
sudo service smbd restart
Step 7. From the Windows auto, open the run application from the Start card and enter the Ubuntu machine IP with the shared directory name equally follows.
\2.168.i.8\UbuntuSharedDir
Press the OK button to go along.
Footstep 8. A Windows Security message will appear, y'all should have to enter your samba username and password. Then press the OK button to continue.
Footstep 9. Now yous should take access to your Ubuntu shared directory, and you tin can transfer files.
Method 3: Shared Network Folders
This is the easiest method amongst all. In this method, nosotros share whatever folder from the Windows machine to be visible in the Ubuntu machine.
Pace one. From the Windows machine, right-click on the network connections icon in the right bottom of the taskbar.
Step two. Choose the "Open Network & Internet Settings."
Stride three. Side by side, choose "Sharing Options."
Footstep 4. Now from your current network profile, choose the post-obit options:
- Turn on network discovery.
- Turn on file and printer sharing.
Don't forget to relieve your changes.
Step 5. Now open your file explorer and go to the directory that you lot need to share. Right-click on the folder then select Properties.
Step 6. Later opening the binder backdrop, let's cull the Sharing tab. Besides, select the Advanced Sharing button.
Step 7. Mark "Share this folder" box.
In instance y'all demand to set permissions on the shared folder similar (Read, Write), yous tin select the permissions button and fix your permissions.
Press the OK button to continue.
Step 8. Now from the Ubuntu machine, open up the file browser.
Step 9. From the left panel, choose "Other Locations."
Step 10. In the lesser bar, enter your Windows auto IP and path to the shared folder as follows:
smb://192.168.1.6/Windows Shared Folder
And so press the Connect button.
Step xi. An authentication message should appear. Enter your username and countersign. Press the Connect push button to continue.
Stride 12. Adjacent, you should be able to meet your Windows shared folder. Now you lot tin can transfer files between the two machines.
Transferring files between Windows and Linux on the same machine
Previously, we looked at how nosotros can share files between a Linux PC and a Windows PC over a network. Some of the utilities used included SSH, Samba, and Shared Network Folders. Here, we will await at a relatively similar situation only that this time around, information technology will be on the aforementioned machine.
Yous might be wondering why tin can't we copy files straight from a Linux partition to a Windows partition and Vice-versa? The elementary respond is that; It will work for one but doesn't work for the other. Allow's look at the reasons behind this.
Why information technology isn't easy
The NTFS sectionalization format used by Windows doesn't support Linux file permissions. Therefore, we tin can't consider installing Linux on an NTFS division other than the Ext4. On the other hand, Windows cannot read the Linux file organization fifty-fifty though Linux systems can read an NTFS segmentation. In most cases, the Linux sectionalisation is not listed in the "This PC" department on Windows in a dual boot. Therefore, y'all can copy a file from the Windows partition on Linux but not the vice-versa.
A simple solution
With the in a higher place information in mind, we need to discover a way to favor both operating systems and wouldn't pose any data corruption issues. For example, if you lot delete or alter any file in the Windows partitioning while accessing information technology with Linux, there is a high probability that Windows might raise some errors on boot.
Since Linux can't run on an NTFS or FAT32 division and Windows can't read a Linux file system, nosotros will need to configure a 3rd partition that can be accessed by both operating systems. This third partition volition contain ordinarily shared files between the ii. Let'southward call it the SharedPartition .
We can use other methods to share files, including external storage like USB or online storage like Google Drive and DropBox. Even so, these are tedious equally i volition require a reboot to switch from one Bone to some other while the other method is dependent on bandwidth.
Create a SharedPartition
Whether you lot have an SSD or Hard bulldoze, we will require at least Four partitions:
- Linux Partition
- Windows Segmentation
- A SWAP infinite
- The SharedPartition (NTFS)
I believe you lot already take the first 3. To create the SharedPartition, you lot can safely check our post on 'Creating or resizing partitions in Linux.' Ensure you format information technology to NTFS. Additionally, you might demand to understand the partition Table used on your Drives. That can be GPT or MBR. Our post on 'Booting Linux or Windows from a USB bulldoze' gives you a comprehensive guide on this. You will also sympathize the advantage of one over the other.
Upwardly to here, we already have a SharedPartition that can be accessed by both Operating Systems. However, we might need to perform some configurations like Automobile-mount on Linux and setting it as the default location for diverse files.
Configure Auto-Mount on Linux
Nosotros volition demand to execute several commands on the control-line. If you are merely getting started with, don't panic. Delight copy and paste the commands as they are below. Our Linux distribution of choice in this post is Ubuntu 20.04 LTS.
Note: Recall to replace the name SharedPartition with the characterization of your new partition in any of the commands.
Step one. Install the ntfs-3g driver, which enables Linux to read and write NTFS partitions.
sudo apt install ntfs-3g
Step ii. Create a directory where we volition mount our new partition.
sudo mkdir /media/SharedPartition
Footstep 3. Get the UUID (universally unique identifier) of the new SharedPartition with the command below.
sudo blkid
You should encounter an output like this.
Re-create the UUID of the SharedPartition. The UUID identifies the partition in the /etc/fstab file.
Step 4. Since we volition exist editing the /etc/fstab file, create a backup with the command below.
sudo cp /etc/fstab /etc/fstab.backup
Step 5. Execute the command below to edit /etc/fstab using the nano editor.
sudo nano /etc/fstab
You should see a window similar the 1 below. Add the following line at the finish but remember to supplant the UUID with yours.
# SharedStorage UUID=66E53AEC54455DB2 /media/SharedPartition/ ntfs-3g machine,user,rw 0 0
Later this step, reboot your PC. Y'all should now come across the SharedPartition mounted under the 'Other Locations' menu.
Configure your Special Folders (Linux)
Special folders in Linux are those present on your Home directory. They include Desktop, Documents, Videos, etc. Execute the below command to edit their paths.
sudo nano .config/user-dirs.dirs
Now, we demand to edit the paths to point to our SharedPartition mounted in /media/SharedPartition. For example, for Downloads, we will add the path "/media/SharedPartition/Downloads" and delete the "$Home/Downloads" path. After applying the changes, you should have something similar to this:
Salve your changes and close the Nano editor.
Configure your Special Folders (Windows)
Step i. Open the File Explorer and type %userprofile% on the accost bar. Hit enter.
Footstep two. Select a binder, say Downloads, that you want to admission in both operating systems. Right-click and select the properties choice.
Footstep iii. On the pop-up window that opens, select the Location tab.
You will see the default path to your Downloads location.
Footstep 4. Click on the Move button. That will open a window where y'all will select your new Downloads path. Navigate to your SharedPartition and choose the Downloads binder already created in Linux. Click on the Select Binder button.
Stride 5. Click on the Utilise button to set the changes.
You volition see a pop-upwards window prompting you to move the content in the old folder to this new location. Click OK.
That's information technology. You can now proceed to do the same for the other Folders. At present, anything y'all salvage on these folders, e.grand., Documents on Windows, will be accessible on Linux in the Documents directory.
Using another partition to share files between the two operating systems is the virtually reliable choice since Windows cannot read the Linux file organisation without using 3rd-political party software. With this method, you don't need to accept duplicate files. Both operating systems tin can read and write on the same segmentation.
Source: https://www.fosslinux.com/19265/how-to-share-and-transfer-files-between-linux-and-windows.htm
0 Response to "Upload Files to Ubuntu Server From Windows"
Post a Comment