< Back
New-SSHSession
Post
NAME New-SSHSession
SYNOPSIS
Creates an SSH Session against a SSH Server
SYNTAX
New-SSHSession [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-ConnectionTimeout <Int32>]
[-OperationTimeout <Int32>] [-KeepAliveInterval <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted] [-KeyFile
<String>] [<CommonParameters>]
New-SSHSession [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-ConnectionTimeout <Int32>]
[-OperationTimeout <Int32>] [-KeepAliveInterval <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted] [-KeyString
<String[]>] [<CommonParameters>]
DESCRIPTION
Creates an SSH Session against a remote server. The command supports creating connection thru a Proxy and allows
for authentication to the server using username and password. If a key file is specified the command will use the
password in the credentials parameter as the paraphrase of the key.
PARAMETERS
-ComputerName <String[]>
FQDN or IP Address of host to establish a SSH Session.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Credential <PSCredential>
SSH Credentials to use for connecting to a server. If a key file is used the password field is used for the
Key pass phrase.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Port <Int32>
SSH TCP Port number to use for the SSH connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyServer <String>
Proxy server name or IP Address to use for connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyPort <Int32>
Port to connect to on proxy server to route connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyCredential <PSCredential>
PowerShell Credential Object with the credentials for use to connect to proxy server if required.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyType <String>
Type of Proxy being used (HTTP, Socks4 or Socks5).
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ConnectionTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OperationTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeepAliveInterval <Int32>
Keep Alive interval in seconds for a connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AcceptKey [<SwitchParameter>]
Automatically accepts a new SSH fingerprint for a host
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Force [<SwitchParameter>]
Do not perform any host key validation of the host.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ErrorOnUntrusted [<SwitchParameter>]
Throw a terminating error if the host key is not a trusted one.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyFile <String>
OpenSSH format SSH private key file.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyString <String[]>
OpenSSH key in a string array to be used for authentication.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String[]
System.Management.Automation.PSCredential
System.Int32
System.String
System.Boolean
OUTPUTS
NOTES
-------------- Example 1 --------------
PS C:\\> New-SSHSession -ComputerName 192.168.1.234 -Credential (Get-Credential) -Verbose
Create a new SSH Session to a server.
RELATED LINKS
Online Version: https://github.com/darkoperator/Posh-SS ... aster/docs
SYNOPSIS
Creates an SSH Session against a SSH Server
SYNTAX
New-SSHSession [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-ConnectionTimeout <Int32>]
[-OperationTimeout <Int32>] [-KeepAliveInterval <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted] [-KeyFile
<String>] [<CommonParameters>]
New-SSHSession [-ComputerName] <String[]> [-Credential] <PSCredential> [-Port <Int32>] [-ProxyServer <String>]
[-ProxyPort <Int32>] [-ProxyCredential <PSCredential>] [-ProxyType <String>] [-ConnectionTimeout <Int32>]
[-OperationTimeout <Int32>] [-KeepAliveInterval <Int32>] [-AcceptKey] [-Force] [-ErrorOnUntrusted] [-KeyString
<String[]>] [<CommonParameters>]
DESCRIPTION
Creates an SSH Session against a remote server. The command supports creating connection thru a Proxy and allows
for authentication to the server using username and password. If a key file is specified the command will use the
password in the credentials parameter as the paraphrase of the key.
PARAMETERS
-ComputerName <String[]>
FQDN or IP Address of host to establish a SSH Session.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Credential <PSCredential>
SSH Credentials to use for connecting to a server. If a key file is used the password field is used for the
Key pass phrase.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Port <Int32>
SSH TCP Port number to use for the SSH connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyServer <String>
Proxy server name or IP Address to use for connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyPort <Int32>
Port to connect to on proxy server to route connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyCredential <PSCredential>
PowerShell Credential Object with the credentials for use to connect to proxy server if required.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProxyType <String>
Type of Proxy being used (HTTP, Socks4 or Socks5).
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ConnectionTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OperationTimeout <Int32>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeepAliveInterval <Int32>
Keep Alive interval in seconds for a connection.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AcceptKey [<SwitchParameter>]
Automatically accepts a new SSH fingerprint for a host
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Force [<SwitchParameter>]
Do not perform any host key validation of the host.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ErrorOnUntrusted [<SwitchParameter>]
Throw a terminating error if the host key is not a trusted one.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyFile <String>
OpenSSH format SSH private key file.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyString <String[]>
OpenSSH key in a string array to be used for authentication.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String[]
System.Management.Automation.PSCredential
System.Int32
System.String
System.Boolean
OUTPUTS
NOTES
-------------- Example 1 --------------
PS C:\\> New-SSHSession -ComputerName 192.168.1.234 -Credential (Get-Credential) -Verbose
Create a new SSH Session to a server.
RELATED LINKS
Online Version: https://github.com/darkoperator/Posh-SS ... aster/docs