Перенос файлов из windows в linux

A great many people are confused about how to transfer files from Windows to Linux. If you are also trying to figure it out, this post of MiniTool is worth reading. It introduces 5 feasible ways for copying files from Windows to Linux.

Have you ever made a switch between different operating systems like Windows to Linux? If the answer is yes, you may wonder how to transfer files from Windows to Linux. Copying files from Windows to Linux or back again won’t be difficult via the following 5 ways. Here you can try them in order or choose one that works best for you.

# 1. Transfer Files from Windows to Linux via SSH

SSH (Secure Shell) is a remote administration protocol that allows you to control and modify your servers over the internet. It’s also a cryptographic network protocol that enables you to use network services safely even through an unsecured network.

With SSH enabled on your computers, you can transfer file from Windows to Linux via the command line. Here’s how to do that:

Step 1. Update the Linux OS on your computer.

1. On your Linux device, open a terminal window/command line by using the Ctrl + Alt + T or Ctrl + Alt + F2 key combinations.

2. In the terminal window, execute the following command to update your local repositories.

sudo apt-get update

update Linux OS

Step 2. Install the OpenSSH server.

1. You can install the SSH server via the OpenSSH server, which can eliminate all potential threats to your data. Run the following command in the terminal window to install the OpenSSH server.

sudo apt install openssh-server

install OpenSSH server on Linux

2. Wait for the installation to complete. Then you can run the following command to check if the OpenSSH server is installed properly.

sudo service ssh status

Step 3. Install an SSH client like PuTTY on Windows.

PuTTY is an SSH client that can help you copy a file from Linux to Windows freely between different networks. To run alongside PuTTY, you need to get the PSCP (secure copy client) tool on Windows.

Tips:

You just need to manually install PuTTY on Windows., but he PSCP doesn’t have to install and you can save the downloaded pscp.exe file on the C drive.

1. Click here to open the PuTTY download page, select a version according to your system and click on the blue link to download it.

download PuTTY

2. Double-click the PuTTY install to run it and click on Next, save the exe file in the root of the Windows C: drive and click on Next.

save PuTTY to C drive

3. Click on Install to start installing PuTTY on your Windows PC.

install PuTTY on Windows

Step 4. Start copying files from Windows to Linux.

  1. Confirm the IP address of your Linux device by running the hostname -I command in the terminal window.
  2. Make sure you have a connection established. Then you can copy files from Windows to Linux using the following code.

Tips:

Make sure to replace remoteIP: with the IP address of your Linux device.

c:pscp c:

omepathtoafile.txt user@remoteIP:homeuser

omepath

ewname.txt

  1. Before the transfer, you need to input your Linux computer password for copying files from Windows to Linux.
  2. If you want to copy a specific file like file.txt in Windows to a directory like temp in Linux, you can run the following command.

C:Program FilesPuTTY>pscp Usersuserfile.txt user@IP:/temp

  1. If you want to copy file from Linux to Windows, you can reverse the command.

C:Program FilesPuTTY>pscp user@IP:/temp/file.txt Usersuser

# 2. Transfer Files from Windows to Linux via FTP

FTP (File Transfer Protocol) is a standard network protocol designed to transfer computer files between clients and servers on a computer network. This tool can help you transfer a file from Windows to Linux without typing any commands.

Before you do, you need to install an SFTP-supported app on Windows like FileZilla and make sure your Linux server is running for this method. Then you can follow the steps below to copy Windows files to Linux.

Step 1. Launch the FileZilla app on Windows, and then select File > Site Manager from the upper left corner.

click Site Manager on FileZilla

Step 2. Select the site folder and click on New Site and change the Protocol to SFTP.

Step 3. Input the target IP address of your Linux server next to the Host box.

Step 4. Add your username and password, and change the Logon Type to Normal.

Step 5. Once done, click on Connect.

the process of connecting to a site via FileZilla

Now, you can use the FTP app for transferring files from Windows to Linux back using drag and drop.

# 3. Transfer Files from Windows to Linux via Virtual Machine

If you are running Linux in a VM on Windows or vice versa, you can transfer file from Windows to Linux by running one of your systems on the VM. The program can be used to create a virtual shared directory for data syncing.

To do this work, you need to have a VM app like Oracle VM VirtualBox installed on your PC. Here’s how to transfer files to Linux from Windows via the VM.

Step 1. Launch the VM VirtualBox app on your PC, and then select Start > Headless Start.

select Headless Start on VirtualBox

Step 2. When the app is running, right-click the VM and select Settings > Shared Folder > Machine Folders.

Step 3. Click on the “+” icon at the upper right corner and select Add Shared Folder.

Step 4. Select the Folder Path and locate the directory that you want to transfer.

Step 5. Set the Folder Name if necessary, and tick the checkbox next to Auto-mount to ensure the shared folder is available when you run the VM.

Step 6. Click on OK to save the change and exit.

set Shared Folders on VirtualBox

Step 7. Restart your Virtual Machine and the shared folder will be ready to transfer data between your host PC and the Guest OS. Then you can copy a file from Linux to Windows or vice versa.

# 4. Transfer Files from Windows to Linux via Sync Software

You can consider using a Sync software app like Resilio and SyncThing for transferring files from Windows to Linux. This tool can be used to manage the connection between two operating systems or devices with an encrypted key.

With the Sync software, all thing you need to do is install the app on the first PC, choose a sync folder, and create the encrypted key. Then set up this app on the second PC and your data can be synced between Windows and Linux.

In addition, you can create a shared network folder on one or both systems and then copy Windows files to Linux or vice versa across a network. That’s to say, this method will allow you to share the same files/folders in both Windows and Linux simultaneously. Well, the operation may fail if your network is unreliable, but it’s having a try.

Step 1. On Windows, right-click the network connection icon from the system tray and select Open Network & Internet Settings > Network and Sharing Center.

select Network and Sharing Center

Step 2. Select Change advanced sharing settings and enable the following 2 options, and click on Save Changes.

  • Turn on network discovery
  • Turn on file and printer sharing

turn on network discovery

Step 3. Navigate to the target that you want to transfer a file from Windows to Linux, right-click the folder, and select Properties.

Step 4. In the Properties window, go to the Sharing tab and click on Advanced Sharing, and select the checkbox for Share this folder. Also, you can click on Permissions to manage the permissions.

Step 5. Click on Apply and then on OK to save the changes.

click Advanced Sharing

Step 6. To copy files from Windows to Linux, simply open the file explorer of your Linux device and select Network. Then locate the Windows-hosted folder and start copying files from Windows to Linux.

If you want to transfer a folder from Linux to Windows, you can use a tool that can emulate the Windows protocols in Linux, allowing you to share files with Windows.

Further Reading: Do you want to manage your partition and disk on Windows effectively? MiniTool Partition Wizard is a good choice that can help you extend/resize/delete partition, convert a disk to MBR/GPT, migrate OS, etc.

Sometimes you need to transfer files over a network. There are lots of file sharing services out there, but most require that you send your file to the Internet. This seems like a long way to go (not to mention the privacy concerns) when two computers are right beside each other, or at least in the same building. The open source WinSCP utility makes it quick and easy to transfer a file or a folder of files over the network from your Windows computer to your Linux computer.

IP address

Before you can make the transfer, you must know the IP address or fully-qualified domain name of the destination computer. Assuming it’s a computer on your same network, and that you’re not running a DNS server to resolve computer names, you can find the destination IP address using the ip command on the Linux machine:

[linux]$ ip addr show | grep 'inet '  
inet 127.0.0.1/8 scope host lo  
inet 192.168.1.23/24 brd 10.0.1.255 scope global noprefixroute eth0  

In all cases, 127.0.0.1 is a loopback address that the computer uses only to talk to itself, so in this example the correct address is 192.168.1.23. On your system, the IP address is likely to be different. If you’re not sure which is which, you can try each one in succession until you get the right one (and then write it down somewhere!)

Alternatively, you can look in your router’s settings, which list all addresses assigned over DHCP.

Firewalls and servers

The WinSCP command uses the OpenSSH protocol, so your Linux computer must be running the OpenSSH server software, and its firewall must allow SSH traffic.

If you’re not sure whether your Linux machine is running SSH, then run this command on the Linux machine:

[linux]$ sudo systemctl enable --now sshd

To ensure your firewall allows SSH traffic, run this command:

[linux]$ sudo firewall-cmd --add-service ssh --permanent

For more information on firewalls on Linux, read Make Linux stronger with firewalls.

Using WinSCP

WinSCP is an open source SSH file transfer application for Microsoft Windows. To use it, you first must download and install it.

Once you’re installed it, open WinSCP and select the SCP option in the File Protocol field.

Add the IP address or DNS name of your Linux computer in the Host name field, and enter 22 in the Port number field. Enter you user name and password for the Linux computer, and then click the Login button at the bottom of the WinSCP window.

Image of the WinSCP login window.

Image by:

(Paul Laubscher, CC BY-SA 4.0)

Verify that you are authenticated to the Linux computer. Upon success, your Linux computer’s IP address or DNS name appears at the top of the window.

Image of a WinSCP window showing where IP adress is located.

Image by:

(Paul Laubscher, CC BY-SA 4.0)

Now you can drag and drop a file (I used winscp-test.txt as an example) from the left Windows pane to the destination Linux computer pane on the right, and the file transfers.

Image of drag and drop window in WinSCP.

Image by:

(Paul Laubscher, CC BY-SA 4.0)

Alternatively, you can right-click on a file in the left pane and upload it to the remote destination in the right pane.

Image of a right click option to upload files in WinSCP.

Image by:

(Paul Laubscher, CC BY-SA 4.0)

Verify the copy

Open a Linux terminal and use the ls command to view the transferred winscp-test.txt file. In my example, it appears in my home directory, /_home_/sysadmin.

$ ls
Desktop
Documents
Downloads
Music
Pictures
pscp-test.txt
[...]

You’ve successfully transferred a file from a Windows computer to a Linux computer over the network!

Of course, you can use the same technique as above to transfer files and folders from a Linux computer to a Windows computer.

Remote copying

With the power of the open source WinSCP application, you have access to any computer in your house or workplace, to servers you have accounts on, and even mobile, edge, and Internet of Things devices. Use this great tool to transfer files as easily as you would copy a file from one local directory to another!

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.

Как копировать и передавать файлы по SSH

В статье мы расскажем, как передать файлы через SSH на разных операционных системах — Windows и Linux.

  1. Что нужно для подключения
  2. Как скопировать файл через SSH на Linux
    • Как отправить файл по SSH с локального компьютера на сервер
    • Как скачать файлы с удаленного сервера на компьютер
  3. Как скопировать файлы по SSH на Windows
    • Как загрузить файл с компьютера на сервер
    • Как скачать файл через SSH на локальный компьютер

Для подключения к серверу вам потребуются:

  • IP-адрес или имя сервера,
  • логин пользователя (в том числе root),
  • пароль пользователя,
  • порт.

Чаще всего копирование файлов через SSH делают с помощью двух мини-программ:

  1. scp (Secure Copy) — утилита для Linux. Она позволяет безопасно передать или скачать файл по протоколу SSH. Программа scp входит в комплект OpenSSH и не требует установки.
  2. pscp.exe — это утилита для Windows. Она используется по тому же назначению, что и scp: подключение к серверу по SSH и работа с файлами. Эта мини-программа входит в состав PuTTY: ее можно скачать на официальном сайте. Процедура настройки SSH-клиента описана в нашей статье.

Важно: если загружаемый файл существует на целевом хосте, он перезапишется.

Работа через SSH предполагает использование консольных команд. Наиболее популярные из них вы можете найти в статье.

Как скопировать файл через SSH на Linux

Копирование файлов по SSH на Linux можно сделать с помощью scp. Эта утилита позволяет:

  • передать файл с локального компьютера на удаленный сервер,
  • скачать файл с удаленного сервера на локальный компьютер.

Команда scp имеет следующий синтаксис:

scp опция источник получатель

Как отправить файл по SSH с локального компьютера на сервер

Чтобы загрузить файл:

  1. Подключитесь к серверу по SSH.
  2. Выполните команду:

scp /home/test.doc username@servername:/directory

Где:

  • /home/test.doc — путь к файлу на локальном компьютере;
  • username — имя SSH-пользователя;
  • servername — имя сервера или его IP-адрес;
  • directory — директория на сервере, в которую нужно загрузить файл.

Готово, вы загрузили файл на сервер.

Как скачать файлы с удаленного сервера на компьютер

Чтобы загрузить файл:

  1. Подключитесь к серверу по SSH.
  2. Выполните команду:

scp username@servername:/directory/test.doc /home

Где:

  • /directory/test.doc — путь к файлу на сервере;
  • username — имя SSH-пользователя;
  • servername — имя сервера или его IP-адрес;
  • home — папка на компьютере, в которую нужно загрузить файл.

Готово, вы скачали файл на компьютер.

Как скопировать файлы по SSH на Windows

Копирование через SSH на ОС Windows выполняется с помощью утилиты pscp.exe из набора PuTTY.

Как загрузить файл с компьютера на сервер

Чтобы загрузить файл:

  1. Подключитесь к серверу по SSH.
  2. Выполните команду:

pscp C:/documents/test.doc username@servername:/directory

Где:

  • /documents/test.doc — путь к файлу на локальном компьютере;
  • username — имя SSH-пользователя;
  • servername — имя сервера или его IP-адрес;
  • directory — директория на сервере, в которую нужно загрузить файл.

Если название файла или путь содержит пробелы, заключите его в кавычки:

pscp “C:/documents/test 1.doc” username@servername:/directory

Готово, вы загрузили файл на сервер.

Как скачать файл через SSH на локальный компьютер

Чтобы загрузить файл:

  1. Подключитесь к серверу по SSH.
  2. Выполните команду:

pscp username@servername:/directory/test.doc C:/documents

Где:

  • username — имя SSH-пользователя;
  • servername — имя сервера или его IP-адрес;
  • directory/test.doc — путь к файлу на сервере;
  • /documents — директория на локальном компьютере, в которую нужно загрузить файл.

Если название файла или путь содержит пробелы, заключите его в кавычки:

pscp username@servername:”/directory/test 1.doc” C:/documents

Готово, вы скачали файл на компьютер.

  • Перестала скрываться панель задач windows 10
  • Перенос файла подкачки на другой диск windows 10
  • Перестала регулироваться яркость на ноутбуке windows 10
  • Перенос только windows 10 с hdd на ssd
  • Перестала работать яркость на ноутбуке windows 10