0

Suppose a file called Test is in my /home/myname/ on Ubuntu. To transfer to remote I'll open a terminal and go:

 scp "Test" user@node:"~/Folder1/folder2"

How would I alter this command to be able to transfer Test into folder2 from within an SSH connection to user@node? As in, if I first open a SHH connection, then from within the terminal that's connected to remote what command do I issue to conduct the above transfer?

1 Answer 1

2

If I understand correctly the following is your setup:

  1. "Test" file is on your local machine
  2. you ssh another machine, lets call it remote machine
  3. you want to move the file to yet another machine, lets call it node

So, if remote machine have access to your local machine you can just

ssh you@your_local_machine:/path/to/Test user@node:~/Folder/folder2

this is usually the case if you are on the same network, connected to same home / office router etc.

this can't be done if remote machine can't access your local machine, that's usually the case if remote machine is a server, say on EC2 and alike, and your local machine is not publicly available, using a public ip or dynamic dns setup, but that's another story.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.