[ale] Ssh config question
DJ-Pfulio
DJPfulio at jdpfu.com
Sat Feb 14 09:57:50 EST 2015
Every external system I can ssh into gets an entry - even if it has defaults -
just so I can call the system whatever I want. Plus it is a handy way to
document remote access. Just change the "Host" line to be unique - everything
else can point to the same IP, hostname, userid, port or not. Up to you.
Hopefully, this reply won't take 2 days like the last one did.
On 02/14/2015 09:01 AM, Jim Lynch wrote:
> Thanks, I wasn't aware I could have multiple Host blocks for the same url.
>
> JIm.
> On 02/13/2015 04:39 PM, James Sumners wrote:
>> How about this:
>>
>> ```
>> Host normalB
>> HostName b.example.com <http://b.example.com>
>> User normal
>> Port 2222
>>
>> Host rootB
>> HostName b.example.com <http://b.example.com>
>> User root
>> Port 2222
>> ```
>>
>> On Thu, Feb 12, 2015 at 10:09 AM, Jim Lynch <ale_nospam at fayettedigital.com
>> <mailto:ale_nospam at fayettedigital.com>> wrote:
>>
>> I have a backup being run on a system that then uses scp to copy
>> the archive to another system. The backup is running on system A
>> as root and copies to system B as a normal user, e. g. scp
>> backup.tar normal at B.example.com <mailto:normal at B.example.com>. In
>> my /root/.ssh/config file I have
>>
>> Host B.example.com <http://B.example.com>
>> Port 2222
>>
>> I did a ssh-copy-id normal at B.example.com
>> <mailto:normal at B.example.com> AND
>> ssh-copy-id B.example.com <http://B.example.com>
>>
>> So ssh works fine to root at B.example.com
>> <mailto:root at B.example.com> but not to normal at B.example.com
>> <mailto:normal at B.example.com>
>>
>> If I change the ssh port back to 22 it works as advertised,
>> connecting to either, but it won't connect to another user on
>> B.example.com <http://B.example.com> with an alternate port. In
>> the man page for .ssh/config there is a User key word but I'm
>> guessing that would force all connections to the host to use that
>> user.
>>
>> Other than putting the port number on the command is there a way
>> around this problem?
>> scp -P 2222 backup.tar normal at B.example.com
>> <mailto:normal at B.example.com> works.
>>
>> Thanks,
>> Jim.
>> _______________________________________________
More information about the Ale
mailing list