How to scp via an intermediate computer [closed] - bash

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am on computer A and in order to ssh into computer C I have to ssh into computer B and then ssh from there. I have a one line bash script that does this with
ssh -XJ user#compB user#compC
How can I write a bash script to let me copy a file or files from compA to compC?

ProxyJump is just as available with scp as it is with ssh; there just isn't a -J shortcut on all versions of the command-line tool, so you can need to spell it out the long way.
scp -o 'ProxyJump user#compB' ./your-local-file user#compC:/path/to/your-remote-file
Community Wiki since this question isn't on-topic here, and would be better suited to Unix & Linux Stack Exchange

The best way would be to make a server VPN on a computer B and then make an SCP from computer A to computer C using the VPN (computer B).
Otherwise, you make ssh keys from a->b and from b->c so that ssh doesn't ask you the passwords, that you make:
computer_A:$ scp -r myfilesfolder/ myuser#computerB:.
computer_A:$ ssh myuser#computerB scp -r myfilesfolder/ myuser#computerC:.
or another way is, install sshfs look this and then you mount the folder you want to copy in computer A in computer B and after you mount the folder in computer B in computer C. After that you copy as usual the files in the mounted folder.

Related

Ssh from Ubuntu to Windows 7 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I was just about to try sshing for the first time and before I get into it, I want to know what's the best way to go about it. In particular, I'm currently running Linux through crouton on an HP chromebook and I want to ssh into and old windows 7 pc. Ideally I would love to have some sort of bash shell inside the windows ssh as I'm not so confident with cmd but I can make do. Are there any packages/apps that I should install on my old pc before I start trying. Preferably if there was something like WSL but for windows 7 that'd be great but I can't seem to find anything like it.
there is no ssh daemon (service) for windows from Microsoft.
So installing shell on windows, it is only about run it locally.
To connect with ssh on remote windows, you should install 3rd party ssh server on windows.

Logging in with an SSH key doesn't work on Git Bash but does in Windows Command Prompt [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'm following this tutorial to set up my first DigitalOcean droplet, and I just generated a Key Pair for Public Key Authentication. After using ssh-copy-id (from Git Bash, since the command isn't available in Command Prompt) to add the key to my Droplet, I can SSH into my droplet just fine from Command Prompt.
However, when I try to SSH from Git Bash, it still prompts me for my password! I've checked, and the SSH keys exist on my Droplet and on my computer. What's the problem?
You can load the key by running ssh-add path-to-private-key
ssh-add /Users/ben/id_rsa
The predefined path is UserHome -> .ssh -> private-key & public-key
/c/Users/USERNAME/.ssh/id_rsa
/c/Users/USERNAME/.ssh/id_rsa.pub
There are restrictions to the name of the file as well as the location. Following are the known filenames that SSH agent will look for that I can think on top of my head:
identity
id_dsa
id_rsa
These names are generally determined by the Type you've used to generate them. Most commonly used is rsa which creates id_rsa and id_rsa.pub.
Also, most Windows user uses Putty as the SSH daemon. It works pretty well. The best thing about that is it has GUI to set the specific private key so it loads that every time without having to do any of the above stuff.

How do I send files on my PC to the computers at my school through bash? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I need to send files the are on my PC the computer system at my school. In order for me to log in a manipulate the files on my school profile (when using bash) I have to type :
ssh -Y <username>#<school_name>.com
And that works just fine. But what I'm wondering is, if I want to be able to manipulate a file (for example file.txt) that is on my PC, how would I be able to send and manipulate the file.txt at school?
P.S. Sorry for my bad English...
You can just use scp <file> <username>#<school_name>.com from your PC's terminal. For futher details goto this link: SCP
You might want to take a look at SCP.
It allows you to copy a file on your local machine to a remote machine (such as your school computer) of vice versa.

Need a script to open ssh connections [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
My entirely new to MAC OS.
I am using MAC Terminal to connect to Linux servers (using SSH)
Is there a way to write a .command file to connect to the Linux servers, just by executing the .bat file from desktop?
Look at ssh client configuration and key-based authentication (man ssh and man ssh_config). You can configure all that so the command reduces to ssh hostname without writing any shellscript code. You can even assign a short name to a host.
For example (in ~/.ssh/config):
host abc
hostname remotehost.domain.tld
identityfile ~/.ssh/abc.dsa
user myuserid
Assuming you've generated and uploaded the corresponding public key, you can connect with the command
ssh abc

Is it possible to copy files from one computer (which is remotely accessing another one through terminal) to the other one? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm using a Mac to remotely access a computer in my university's computer lab. The Mac serves as a terminal. If I need to transfer some files from my computer into the one in the lab, is it, firstly, possible? If yes, then please guide me to it.
Absolutely, use the UNIX / Linux command scp (secure copy):
$ scp user#server:directory/SourceFile TargetFile
Update based on OP's response:
$ scp path/to/my/file.txt user#server.com:/path/to/copy/to/file.txt

Resources