[systemd-devel] systemd services via SSH (-H key)

Mikhail Kasimov mikhail.kasimov at gmail.com
Thu Oct 22 15:05:14 PDT 2015


23.10.2015 0:50, Jan Alexander Steffens пишет:
> On Thu, Oct 22, 2015 at 11:07 PM, Mikhail Kasimov
> <mikhail.kasimov at gmail.com> wrote:
>> Hello!
>>
>> 1. systemd services have a special key (-H) to connect to remote host
>> via ssh. E.g. 'timedatectl -H user at host'. By default port 22 is used.
>> But in very often cases admins change the default ssh-port in
>> sshd-daemon settings (e.g. 41122). It's useful to avoid connections from
>> ssh-bruteforce robots.
>> But systemd has no way (I can't find it in man-pages for example) how to
>> define the admin-defined ssh connection port (possibly, other ssh
>> options are also not accessable).
> 
> You can use ~/.ssh/config to alter any connection properties
> associated with a certain hostname, even directing the connection to a
> completely different host (a way of creating aliases).
> 
> Example:
> 
> Host foo
>   HostName foo.example.com
>   User bar
>   Port 41122
> 
> and henceforth, `timedatectl -H foo` will connect to bar at foo.example.com:41122

Hmm... it's simple variant I didn't think about, thanks. But I have
builded more complicated conception.





More information about the systemd-devel mailing list