]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - rpc/dial.go
config: add Host option "ssh_user"
[safcm/safcm.git] / rpc / dial.go
index b723e55c5657e78609d79b8019448636c3de5eef..40ac7f60712dacbe1070c0a04e91c6332b4ae5bf 100644 (file)
@@ -32,11 +32,15 @@ import (
        "ruderich.org/simon/safcm/remote"
 )
 
-func (c *Conn) DialSSH(remote string) error {
+func (c *Conn) DialSSH(user, host string) error {
        if c.events == nil {
                return fmt.Errorf("cannot reuse Conn")
        }
 
+       remote := host
+       if user != "" {
+               remote = user + "@" + host
+       }
        c.debugf("DialSSH: connecting to %q", remote)
 
        opts := "-eu"