How to transfer files from a Windows computer to a Linux server without lrzsz and root permissions

Good luck to the Foundation! Of course this is not the scp we are talking about this time

background

Generally speaking, through xshell and other software, the lrzsz plug-in on the Linux server can realize the transmission of small files. The command is as follows:

rz

rz is used to transfer files from Windows computer to Linux server.

sz 文件地址

For example

sz ~/data.txt

This sz is used to upload the data.txt file in the user root directory from the Linux server to the Windows computer.

Not applicable in the following situations

①The file is too large, exceeding 4G

②There is no root authority on the server, and the lrzsz plug-in cannot be installed without it

solve

Use the scp command.

scp, namely secure copy, is used to encrypt cross-server transmission.

Start by opening the Windows command line. For specific methods, please refer to my article:

https://blog.csdn.net/m0_46948660/article/details/129672292?spm=1001.2014.3001.5501

Then enter the scp command:

scp '本地文件' '服务器中用户名'@'服务器ip':'服务器中你要传到的地址'

for example:

scp C:\Users\12345\Desktop\mydata.zip [email protected]:~/data

This is to transfer the compressed file of mydata.zip on the desktop to the ip address 101.102.103.104, the user name is user007, and the data folder under the user root directory.

Whether it is a file over 4G in size, or an ordinary user on the server without root authority, this can be passed quickly. It can be said that it is very convenient.

postscript

In fact, scp is also a package. if you directly

apt install scp

The package cannot be found. Because it belongs to another package. Let's see which package it belongs to:

first enter

which scp

got the answer

/usr/bin/scp

Then use the dpkg-query command to view:

dpkg-query -S /usr/bin/scp

What I get is:

openssh-client: /usr/bin/scp

As you can see, the openssh-client package is what it needs.

Basically, as long as you can connect to a Linux server with ssh, you must have the openssh-client package. Therefore, this command must be usable.

Guess you like

Origin blog.csdn.net/m0_46948660/article/details/129671975