[Scp] Copy files locally from Linux server with Tera Term ssh scp

Thing you want to do

As the title says. Download the data on the Linux server in the cloud to your local PC.

Premise

-Tera Term is installed on the local PC

SSH SCP Functions in Tera Term. After logging in to the server with SSH, you can copy files by entering the copy source and copy destination paths.

procedure

1. Log in to Tera Term with SSH

This is omitted. Log in with each method.

2. Open SSH SCP and enter the path

Select "SSH SCP" from "File" Enter the upper row for local ⇒ server, and the lower row for server ⇒ local. This time the latter.

Describe the path of the file you want to copy on the Linux server in "From". Describe the path of the local PC where you want to put the copied file in "To".

ssh_scp画面.PNG

Press "Send" and check if the file is copied to the path of the local PC specified by "To".

When Permission denied is issued

Sometimes it fails with the error "Permission denied" due to the owner or permission of the file you want to copy via SSH. (I failed to write this article.)

Even if you switch to the "root" user and then receive the file, it seems that you can only receive the file with the authority of the user who logged in first. ↓ https://www.j-oosk.com/teraterm/file-transfer/143/

If you can log in as root from the beginning, that's okay.

approach

The solution was to copy the file on the server and change the owner of the copied file.

1. Switch to root user and copy files

sudo su -
cp [Path of the file you want to copy] [Directory path of the copy destination]

2. Change the owner of the copied file

'chown [User who wants to be the owner] [Path of the file whose owner you want to change]

3. Confirm that the owner has changed

ls -l

After doing this, you should be able to copy at the beginning of this article.

Recommended Posts

[Scp] Copy files locally from Linux server with Tera Term ssh scp
Copy files locally on Vagrant (scp)
Send files via bastion server with scp
Install Windows 10 from a Linux server with PXE
Copy files directly from Amazon EC2 (Amazon linux) to S3
Extract files from EC2 storage with the scp command
Get files from Linux using paramiko and scp [Python]
ODBC access to SQL Server from Linux with Python
[Linux] Copy data from Linux to Windows with a shell script
Edit files directly on Linux with Visual Studio Code Remote SSH