Windows upload files to linux

How to upload a file from Windows machine to Linux machine using command lines via PuTTy?

I’m running Windows on my laptop at the moment and I want to upload files from my laptop to my uni’s general purpose server, which runs both Linux and MacOSX. So, I already opened up a connection to that server using PuTTy. But I failed to trying to upload a file from my laptop to that server using the commands guided in this website: http://news.metaparadigma.de/linux-upload-and-download-via-ssh-terminal-226/. Seems like it only works for Linux to Linux machine. It didn’t recognize the Windows path that I entered (i.e. C:\a.txt). How can I do this?

4 Answers 4

Try using SCP on Windows to transfer files, you can download SCP from Putty’s website. Then try running:

pscp.exe filename.extension username@domainname.com:directory/subdirectory 

Don’t worry about it, I don’t freak out about accepting answers right away, also look into using it on Linux too as its a handy tool for moving files around via SSH.

Pscp.exe is painfully slow.

Uploading files using WinSCP is like 10 times faster.

So, to do that from command line, first you got to add the winscp.com file to your %PATH%. It’s not a top-level domain, but an executable .com file, which is located in your WinSCP installation directory.

Then just issue a simple command and your file will be uploaded much faster putty ever could:

WinSCP.com /command "open sftp://username:password@example.com:22" "put your_large_file.zip /var/www/somedirectory/" "exit" 

And make sure your check the synchronize folders feature, which is basically what rsync does, so you won’t ever want to use pscp.exe again.

WinSCP.com /command "help synchronize" 

Источник

How to transfer a file from windows to linux Server? [A Definitive Guide]

Are you looking to move your data from windows to a linux server? This guide will help you to transfer a file from windows to Linux server.

How to transfer a file from windows to linux Server? [A Definitive Guide]

List of content you will read in this article:

If you have a connected, working, and tested Linux Server and you are looking to transfer files from windows to a Linux server. You can do that; however, it is not as simple as you think. It is well known that working with servers, especially those running a command line interface, can be somewhat burdensome.

In this article, we will help you to upload local files from a Windows to a Linux VPS, whereas if you want to transfer data from a Windows pc to a Windows server, you can read this blog post.

Читайте также:  Виртуальные машины centos linux

Steps to Transfer a File From Windows to Linux Server

To understand the concept, The Windows PC you are transferring the files from will be referred to as the source, and the Linux Server you are transferring the files to will be referred to as the destination. For demonstration purposes, we have created a file on the desktop named “test.txt”.

Follow these simple steps to transfer files from a Windows to Linux server:

Step 1: Open “Run” by pressing the Windows key +R on your keyboard simultaneously or by typing run into the search bar.

Step 2: Type cmd in the open run window and press Enter.

Step 3: Enter the file’s directory by typing cd followed by the file path. (In this case, the file is on the desktop, so we write cd desktop).

Step 4: Use the “SCP” command in the same format as shown below to upload the file.

SCP filename.extension username@serveraddress:filepath

  • filename.extension: It is the name of the file and its extension (test.txt in our case)
  • username: It is the username used to connect to VPS (root in our case)
  • serveraddress: It is the IP address of the VPS or server
  • filepath: It is the path where you want the file to be copied to (/etc/ssh in our case)

Step 5: If this is your first time connecting to the server, Windows will ask you to accept the security alert. Please do so.

Step 6: Next, you will have to enter the destination server’s password.

And that’s it! Once the correct password has been entered, your file will be uploaded.

To verify that file is transferred, open putty and connect to the destination server. Use “Nano editor” or “vi” editor to open the file.

As can be seen in the following image, the file has been uploaded and is available on the server.

There is also a popular way to transfer files from windows to Linux server or vice versa with the help of WinSCP software. this is an alternate or easy solutions to complete your job.

Conclusion

Unfortunately, there is no simple way than WCP Software for drag-and-drop that we suggested above to upload/transfer files from a Windows VPS server to a Linux server. To be able to do or manage the virtual private server, you will need to learn how to use the command-line interface. Nevertheless, once you know how to do it, it is not much more complex than using your PC for your typical daily tasks. We hope that with the help of this article, you were able to help with the guideline that you are looking for. If you have any questions or suggestions, please leave them in the comment section listed below.

People Are Also Reading:

Источник

Читайте также:  Добавить пользователя ssh линукс

[SOLVED] Upload file to Linux server from Windows

There are multiple methods of uploading files from Windows server to Linux server. It can be done both from the Windows command line and with applications with a graphical interface. Let’s take a look at «How to upload a file to Linux server from Windows».

How to safely upload file to Linux server from Windows?

To copy files between two servers, they must be on the same network. SCP (Secure Copy) and SFTP(Secure FTP) are used for installation. File transfer is encrypted and secure as SCP and SFTP use SSH. SCP(Secure Copy) and SFTP(Secure FTP) are used for upload. The applications we will give examples below are SSH clients.

Pre-requisites

  • The Windows is reachable to the Linux Server. If the Linux is on your VirtualBox then you can use Bridged Networking or NAT with Port Forwarding to be on the same network as Windows.
  • SSHD service MUST be in running state as the file transfer will happen over OpenSSH protocol. You may also choose to setup vsftpd to use dedicated FTP server for file transfer but that is optional.
  • Firewall on the Linux server must be accepting traffic on Port 22 (default SSHD port) or the port used by Linux server. Execute netstat -ntlp | grep ssh on the Linux server to get this information.

Method-1: Upload with SCP and PSCP using CLI CMD

Press the Windows key and type cmd and open the command line.

SCP command usage : scp example_file target_user@ip_address:/target_file_path

C:\Users\faruk\Downloads>scp Get_Started_With_Smallpdf.pdf foc@192.168.122.177:/tmp foc@192.168.122.177's password: Get_Started_With_Smallpdf.pdf 100% 68KB 67.8KB/s 00:00

The file is uploaded successfully with the SCP command.

PSCP command usage: pscp example_file target_user@ip_address:/target_file_path

C:\Users\faruk\Documents>pscp sample.pdf foc@192.168.122.118:/tmp foc@192.168.122.118's password: sample.pdf | 2 kB | 3.0 kB/s | ETA: 00:00:00 | 100%

The sample.pdf file has been successfully uploaded to the target linux server.

Method-2: Using WinSCP

You can download winscp if it is not installed on your Windows server. It is a free software for download. File upload can be done with both SFTP and SCP in WinSCP.

Using SFTP Protocol

Fill the following fields:

  • File Protocol: SFTP (to perform file transfer securely)
  • Host Name: Linux server IP
  • Port Number: In most cases it is 22 but if you are using a different port number for OpenSSH then connect to Linux server and execute netstat -ntlp | grep ssh to get the port number used by SSHD process
  • User name: Provide the username from Linux server using which you want to connect
  • Password: Password of the respective user

Click on Login to continue.

[SOLVED] Upload file to Linux server from Windows

Windows (Left) and target Linux server (Right) directories are listed. You can change the destination directory of your source and destination accordingly on LEFT or RIGHT side. Next to upload the file you can just drag it to the destination location. Don’t worry it will NOT move the file and instead it will just copy the file to destination Linux server.

Читайте также:  Linux mint iso ftp

[SOLVED] Upload file to Linux server from Windows

The selected file has been successfully uploaded to the Linux server.

[SOLVED] Upload file to Linux server from Windows

Using SCP Protocol

You can also upload by choosing SCP as the protocol in WinSCP.

Fill the following fields:

  • File Protocol: SCP (to perform file transfer securely)
  • Host Name: Linux server IP
  • Port Number: In most cases it is 22 but if you are using a different port number for OpenSSH then connect to Linux server and execute netstat -ntlp | grep ssh to get the port number used by SSHD process
  • User name: Provide the username from Linux server using which you want to connect
  • Password: Password of the respective user

[SOLVED] Upload file to Linux server from Windows

Now you can change your source and destination directory in the WinScp. Next drag the files or directory from LEFT side to the RIGHT side for the upload.

[SOLVED] Upload file to Linux server from Windows

Uploading with SCP was completed successfully.

Method-3: Using Filezilla

FileZilla is another freely available software for windows which we use to upload files to Linux server. You can download FileZilla based on your Windows environment. Fill in the below details:

  • Host: Target Linux server IP
  • Port Number: In most cases it is 22 but if you are using a different port number for OpenSSH then connect to Linux server and execute netstat -ntlp | grep ssh to get the port number used by SSHD process
  • User name: Provide the username from Linux server using which you want to connect
  • Password: Password of the respective user

Then click the Quickconnect button:

[SOLVED] Upload file to Linux server from Windows

Windows server directories are listed on the left, and target Linux server directories are listed on the right. The file to be uploaded to the Linux server is selected from the left screen and right clicked. Then click Upload and the file is sent to the Linux server.

[SOLVED] Upload file to Linux server from Windows

You can also do the same by dragging the file to the right screen. A notification is displayed when the file upload is complete.

[SOLVED] Upload file to Linux server from Windows

You can upload one or more files this way.

Summary

We have explained the most used methods to upload files from Windows to Linux server. You can use different methods by researching it yourself. Finally, you should pay attention to the fact that the user to copy should exist on the target server and the directory she is authorized should be selected as the target directory. Otherwise, you will have access and authorization problems.

You can find the download link of the applications we used above below:

References

Didn’t find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

Источник

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