Is there any way to specify, in .ssh/config
, a command like:
ssh -t remote-host "screen -dR screen_name"
so I can easily access the remote screen
session with ssh remote-host
?
Right now I solved this problem using a custom script:
$ cat ~/bin/sssh
#!/bin/sh
/usr/bin/ssh -t $1 "screen -dR ab"
~/bin
stays first at $PATH
, but it is unflexible and ugly.
Also I would like to find way to implement host autocompletion for my custom script.
$1
with$@
. Then you can add more options, not just the hostname. For completion, try executing. /usr/share/bash-completion/completions/ssh
, followed bycomplete -F _ssh sssh
– Alex Stragies Jul 07 '16 at 17:59