[LINUX] When you don't know the SCP when you port forward

For security reasons, I wrote a memorandum because the file exchange when port forwarding and communicating via the bastion server always fails.

Execution command

First of all, port forwarding. 1234: 1.2.3.4 is the port used for SSH connection and the IP address of the connection destination, and [email protected] is the user name and IP address of the bastion server to log in to the bastion server. /.Ssh/id_rsa is the private key path.

ssh -A -L 1234:1.2.3.4 -i /.ssh/id_rsa [email protected]

scp connect.

scp -r -i /.ssh/id_rsa -P 10022 user@localhost:/etc/path/to/file /file/ /local/pc/path

This command transfers the contents of the / etc / path / to / file directory on the server to / local / pc / path on the local PC. It is a list of transfer source location.

Recommended Posts

When you don't know the SCP when you port forward
Don't you know it? pip command
I don't know the value error
How to find if you don't know the Java installation directory
Python Note: When you want to know the attributes of an object
Did you know that you can port forward with ssh for IP aliases?
Don't use hash () when you need persistence!
When you want to update the chrome driver.
How to know the port number of the xinetd service
[CentOS] When you change or forget the root password
Tips you should know when programming competitive programming with Python2
When you think the update of ManjaroLinux is strange
How much do you know the basics of Python?
If you don't know it, it's dangerous. Carefully explain how to use the xargs command