Class BaseSshTask<T extends BaseSshTask<T,​E>,​E extends BaseSshTaskProperties>

    • Field Detail

      • hosts

        protected java.util.List<java.lang.String> hosts
      • username

        protected java.lang.String username
      • password

        @Nullable
        protected @Nullable java.lang.String password
      • key

        @Nullable
        protected @Nullable java.lang.String key
      • passphrase

        @Nullable
        protected @Nullable java.lang.String passphrase
      • hostFingerprint

        @Nullable
        protected @Nullable java.lang.String hostFingerprint
      • port

        protected int port
    • Constructor Detail

      • BaseSshTask

        public BaseSshTask()
    • Method Detail

      • host

        public T host​(@NotNull
                      @NotNull java.lang.String host)
        Hostname or IP address of the remote host.
      • host

        public T host​(@NotNull
                      @NotNull java.lang.String... host)
        Hostnames or IP addresses of the remote hosts.
      • username

        public T username​(@NotNull
                          @NotNull java.lang.String username)
        Username you want to use to access the remote host.
      • authenticateWithPassword

        public T authenticateWithPassword​(@NotNull
                                          @NotNull java.lang.String password)
        Authenticate with password associated with username username(String).
      • authenticateWithKeyWithPassphrase

        public T authenticateWithKeyWithPassphrase​(@NotNull
                                                   @NotNull java.lang.String key,
                                                   @NotNull
                                                   @NotNull java.lang.String passphrase)
        Authenticate with key with passphrase.
        Parameters:
        key - - SSH private key
        passphrase - - SSH passphrase
      • authenticateWithKeyWithPassphrase

        public T authenticateWithKeyWithPassphrase​(@NotNull
                                                   @NotNull java.nio.file.Path keyPath,
                                                   @NotNull
                                                   @NotNull java.lang.String passphrase)
        Authenticate with key with passphrase.
        Parameters:
        keyPath - - path to SSH private key
        passphrase - - SSH passphrase
      • authenticateWithKey

        public T authenticateWithKey​(@NotNull
                                     @NotNull java.lang.String key)
        Authenticate with key (without passphrase).
        Parameters:
        key - - SSH private key
      • authenticateWithKey

        public T authenticateWithKey​(@NotNull
                                     @NotNull java.nio.file.Path keyPath)
        Authenticate with key (without passphrase).
        Parameters:
        keyPath - - path to SSH private key
      • authenticateWithSshSharedCredentials

        public T authenticateWithSshSharedCredentials​(@NotNull
                                                      @NotNull SharedCredentialsIdentifier sharedCredentials)
      • authenticateWithUsernamePasswordSharedCredentials

        public T authenticateWithUsernamePasswordSharedCredentials​(@NotNull
                                                                   @NotNull SharedCredentialsIdentifier sharedCredentials)
      • hostFingerprint

        public T hostFingerprint​(@NotNull
                                 @NotNull java.lang.String hostFingerprint)
        Set public key fingerprint.
      • port

        public T port​(int port)
        Set the port number of the remote host that is used for the SSH connection. The default value is 22.
        See Also:
        portDefault()
      • portDefault

        public T portDefault()
        Set the port number of the remote host to the default value (22).
        See Also:
        portDefault()