Re: multi-hop scp questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08Dec2016 12:04, ProPAAS DBA <dba@xxxxxxxxxxx> wrote:
I want to copy files from server C to my laptop, I have access to server C via:
laptop --> ssh to server B (the jumpbox)
then
server B --> ssh to server C

I added an ssh config like this (.ssh/config in my home dir on my laptop):

Host serverB
       HostName jumpbox.clientA.aws.com
Host serverC
       ProxyCommand    ssh -q serverB nc -q0 serverC -db 22

I just write this as:

 ProxyCommand    ssh serverB nc serverC 22

However when I tried this from my laptop:
ssh myuser@serverC

I get prompted for my user on serverB, enter the pw but it never accepts it:

$ ssh myuser@serverC
jsmith@xxxxxxxxxxxxxxxxxxxxxxx's password:
jsmith@xxxxxxxxxxxxxxxxxxxxxxx's password:
jsmith@xxxxxxxxxxxxxxxxxxxxxxx's password:


I notice that I'm trying to login as the jump box user (myuser) but i'm prompted for the laptop user I'm logged in as (jsmith).

You want a User setting in your serverB clause:

 Host serverB
    User      myuser
    HostName jumpbox.clientA.aws.com

Re keys: they will make your life easier, and are more secure. First make this work with passwords to get it debugged, but ssh keys are very much a better approach. Passwords are usually very breakable. Avoid them. Make yourself a keypair with "ssh-keygen" on your laptop, and add the public half to serverB and serverC's .ssh/authorized_keys files. Start an ssh-agent on your laptop and add your key to it. Then you won't be troubled with passwords again. (And you can _revoke_ password access to servers B and C, securing them further.)

Anyway, try the abve and let us know where you end up.

Cheers,
Cameron Simpson <cs@xxxxxxxxxx>
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]
  Powered by Linux