How to SCP from Windows to Linux

FTP is no longer considered safe enough to be used for usage on the internet. As a result, I’m trying to demonstrate to you SCP now. SCP is indeed a system that is built on the SSH protocol. As a result, you’ll require a user with SSH right to use the server. SSH keys can be used to make SCP connections, just like they can with SSH. Because some Windows clients may control Linux computers, I’ll additionally guide you to use the free application WinSCP to transmit files from Windows to Ubuntu server using SCP in the body of this tutorial.

Method 01: Using SSH Server

SCP or SSH as just a consumer is included in all Linux systems; therefore, you don’t have to do anything special upon the client end. We may have to deploy the SSH server facility just on the server-side, based on the Linux distribution. We must upgrade our system to the latest edition before beginning any deployment. Just use subsequent command for Debian-based computer systems (including Ubuntu and Kubuntu):

$ sudo apt update

The updation takes a little time. After the system update, let’s install the SSH server on our Ubuntu 20.04 operating system. So, add the stated-below query in the terminal and tap on the “enter” key to proceed with the installation.

$ sudo apt install OpenSSH-server

Between the processing of OpenSSH-server installation, it will be paused to ask you to make it confirmed. The system wants you to re-check if you need to install it on your Ubuntu 20.04 operating system or not. If you need it, press “Y” or tap “n” to halt the process.

Now the installation processing has been resumed, as shown below. When it reaches 100%, this means the processing is complete.

The last few processing lines on the terminal shell to OpenSSH-server are as below.

Join the server through SSH to see whether the configuration was accomplished. Using your Ubuntu or Mac client, launch a console and type the regular expression. Type the code for the SSH key immediately if you’re using one. Alternatively, the host device’s user’s passcode should be supplied. When everything is in order, the external computer’s terminal must now be displayed. Verify your firewall rules if this isn’t the case. Port 22/tcp is required for SSH. You may also verify the SSH server’s configuration to ensure that your client has the proper rights. We can terminate the connection once it has been created successfully. Now you need to enable and allow port 22 of the SSH server in the Firewall. Therefore, we have been utilizing the below query in the shell with sudo rights.

$ sudo ufw allow 22

We need to check the status of an SSH port on our system via the systemctl command. Hence, tried the below command in our console and found that our SSH port is actively running.

$ sudo systemctl status ssh

Now the configurations are set for the SSH port. Open the notepad from the search area of our Windows desktop. Add some data in the notepad text file and save it on the desktop with the “.txt” extension.

Now open the command prompt from the search area of the Windows desktop once again. Add the below command to see the logic and syntax of using the SCP command in it.

SCP

We have seen the SCP configured and how it should be used in the command prompt. Let’s move the notepad test.txt file, which we have just created on our desktop. For this purpose, you have to follows the below general syntax of SCP instruction. The path to a file where it has been saved is mentioned first. This path must contain the name of a file. After that, give the hostname, IP address, and the path where you want to save your file in the Linux system. Make sure the folder must exist in your Linux system where you want to save it.

Path_to_file/filename hostname@hostIP:/path_to_save_the_file_in_host

Tap the Enter key to continue connecting to the host device. After the successful connection establishment, you have to add your user password for the Ubuntu system. This way, your test.txt file will be transferred to the “home” folder of the Ubuntu 20.04 Linux System.

Method 02: Using WinSCP

Another effective and simplest way to transfer your Windows files to the Linux operating system is via WinSCP Tool. So, to use this tool, we must download it first to install it. Open the Google search engine and write WinSCP in it, and press Enter to proceed. Click on the first-ever link that has been displayed on the search engine.

Now, you will be shown the Standard WINSCP tool Download. Tap on the “Download WinSCP” to quickly add it to your downloads.

This will take up to 20 minutes according to the network speed on your system to download it. After the download gets completed, click on the downloaded file to execute it.

Setup Install Mode selection dialogue box will be appeared as in the image beneath. Tap on “Install for all users (recommended)” to start the installation.

Now a new window will have appeared for the Setup of WinSCP. You have to sign the license agreement by clicking on the “Accept” button as presented in the snap below.

Select the check box of Setup Type as “Typical Installation (recommended)” and tap Next to carry on.

You have to wisely choose the User Interface style from the Initial User settings panel. Hit the “Next” key.

Now the Setup for WinSCP is ready to install. Hence tap on the “Install” button to continue and start installing WinSCP.

Now the installation process has been started. As the green line process, it means it is closer to the installation completion. It will be completed in some seconds.

Now the WinSCP installation process has been completed; the following screen will be opened. Checkmark the button of “Launch WinSCP” and “Open Gettings, started page”. Press the Finish button to close the screen and end the process.

After the installation gets completed, the official site of WinSCP will be automatically opened, showing the successful installation completion message.

The WinSCP GUI will be opened automatically as we have checked mark the checkbox button. To start transferring your files from windows to ubuntu, you need to connect Windows and the Ubuntu Operating system. For this purpose, tap on the icon of the computer “New Session,” and a dialogue box will be appeared, named “login”. Select the File Protocol from the drop-down list as SCP first. Add the IP address of Ubuntu within the “Hostname” field. Add user name and password to connect and press Login. After a successful connection, drag the files from the left area to the right side of WinSCP to transfer.

Conclusion

SCP is simple to understand and capable of safely transmitting a huge quantity of data across the Net. You might, for instance, utilize WebDAV as just an option. Throughout this post, I have demonstrated to you how it works. If we operate with a variety of operating systems, we must investigate both methods.



from Linux Hint https://ift.tt/3xiOdRf

Post a Comment

0 Comments