             self.arguments?.append(parameter4)
             if forDisplay { self.arguments?.append(" ") }
         }
-        if offsiteServer.isEmpty {
-            // nothing
-        } else {
-            // TODO:
+        if offsiteServer.isEmpty == false {
             // We have to check for both global and local ssh parameters.
-            // Parameters are port, identityfile and keypath
-            // Set on task rules global settings
+            // either set global or local
             if parameter5.isEmpty == false {
-                self.sshportparameter(config: config, forDisplay: forDisplay)
+                if config.sshport != nil || config.sshport != nil || config.sshkeypath != nil {
+                    self.sshparameterslocal(config: config, forDisplay: forDisplay)
+                } else {
+                    self.sshparametersglobal(config: config, forDisplay: forDisplay)
+                }
             }
         }
     }

        if forDisplay { self.arguments?.append(" ") }
    }

    // TODO: set ssh parameters port, identityfile and keypath
    func sshparameters(config: Configuration, forDisplay _: Bool) {
        // -e "ssh -i ~/.ssh/id_myserver -p 22"
        // -e "ssh -i ~/sshkeypath/sshidentityfile -p portnumber"
        // default is
        // -e "ssh -i ~/.ssh/id_rsa -p 22"
        // parameter5 = "-e"
        // parameter6 = "ssh", "ssh -i ~/sshkeypath/sshidentityfile -p portnumber"
        let parameter5: String = config.parameter5
        let parameter6: String = config.parameter6
        var sshportadded: Bool = false
        var sshidentityfileadded: Bool = false
        var sshkeypathadded: Bool = false
    }

    func setdatesuffixlocalhost() -> String {

        if let sshidentityfile = config.sshidentityfile {
            sshidentityfileadded = true
            if let sshkeypath = config.sshkeypath {
                // "ssh -i ~/sshkeypath/sshidentityfile"
                identifyfile = sshkeypath + sshidentityfile
            } else {
                // "ssh -i ~/.ssh/identifyfile"
                identifyfile = self.defaultsshkeypath + sshidentityfile
            }
            if forDisplay { self.arguments?.append(" \"") }
            // Then check if ssh port is set also
            if let sshport = config.sshport {
                sshportadded = true
                // "ssh -i ~/sshkeypath/sshidentityfile -p portnumber"
                self.arguments?.append("ssh -i " + identifyfile + " " + "-p " + String(sshport))
            } else {
                self.arguments?.append("ssh -i " + identifyfile)
