Thanks for your time. Posh-ssh is amazing. But i have a problem with some remote devices, showed the error: MODO DETALHADO: Using SSH Username and Password authentication for connection. AVISO: Host key is not being verified since Force switch is used. New-SSHSession : Connection failed to establish within 10000 milliseconds. In putty the connection works normally
Marcelo Santos weird that error should only happen if there is no connection. Try the beta 1 to see if the updates in identification addresses the issue at the protocol level.
@@atomichacking Good mornig, thanks for your reply. I tried tried to use de beta version but the error is the same. When the verbose mode is ON, i can see the posh sending the user but there is no response. Putty works normaly.
another question, does posh works like pscp for download for only one file? I am trying to make fortigate config download, above is the fortigate sintaxe with pscp. pscp admin@:sys_config
@@marcelo05111 is it the same type of device? could be an issue with Renci.SSH and those devices. I know SSH v1 is not supported and some embedded devices use that old version of SSH.
@@marcelo05111 there is get-scpitem in the module to donwload single files or folders. Github Issues is a better place for questions or problems with the module. Easier to reply there.
after starting a session via `New-SSHSession` is it possible to have every command thereafter sent to the remote server? i.e. the PowerShell prompt becomes the remote shell effectively. also using `Invoke-SSHCommand -Index 0 -Command "pwd"` is a bit clunky - having to specify the Index and Command seems unnecessary; it should just use the first session automatically if you omit the `Index` param. then you can shorten things to Invoke-SSHCommand
@DarkOperator Thanks for creating Posh-ssh library. Is there any way to automatically accept SSH host keys-even when keys are changed-in posh-ssh? I am getting error in my script because the SFTP server host key is changed, and I don't want to use -Force parameter.
Hi, I would like use New-SFTPSession with keyfile as password. I do not want the login dialog box to open. how can i write my command line? Tank for your work.
You would need to use a PSCredential object. There are multiple ways to create it since people have different takes on how to protect the cleartext password.
You can do something like this: New-SSHSession -ComputerName linux-docker -Credential $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'sshUsername', $( New-Object -TypeName System.Security.SecureString )) -keyfile "C:\Users\bob\Documents\ssh_rsa.key" -Verbose Though, I'm sure you figured this out sometime in the last 3 years...
@@atomichacking not sure I'm following. Can this type of query be run using POSH-SSH: date; ldapsearch -1 -T -h HostName -p 1111 -D "uid=udump,ou=POSH,o=darknight.com" -wdumpu -b > Aliases.txt I just installed POSH yesterday and was curious to know how to run the above command
@@cu806 I would try invoke-sshcomand or create a shellstream with new-sshshellstream and then use invoke-sshstreamshellcommand. you will need to manipualate the object you get back to parse the output of the command like you want.
Hey Carlos, you did a really great job with this module. Let me ask you for help with a problem I am not able to handle. We're using the SSH connections to linux devices authenticated by ed25519 signed keys eg. "ssh.exe username@serverIP -i {userprofile}/.ssh/id_ed25519". The device has a public key of CA signing those ed25519 keys to evaluate the validity of the connected client. Is there a way to use your module for this type of auth? I have tried use the New-SSHSession, but no luck yet.