Synology Nas Change User Password Ssh

Posted on  by  admin
Synology Nas Change User Password Ssh Average ratng: 7,3/10 6357 reviews

Recently I had to reset my Root account password on my Synology DS214Play.I had set the password when I first got the Synology, and of course I forgot it.Resetting the account is no problem as there is a clear manual available on the Synology forums.However I wanted to do this trough PowerShell.One of the reasons I wanted to do this using PowerShell was because I was curious if it was possible to talk to Linux with PS.First we need to connect to the device using SSH. For this we will need to load a module in PowerShell.The module is called “Posh-SSH” and is supported from PowerShell 3.0 and up. First lets see if PowerShell can find it. 1: Invoke-SSHCommand -Index 0 -Command 'Your command here'But after running the command it will close that session. (The connection remains open)And because we want to reset the Root account we need to be able to use “SUDO”.

  1. Change User Password Windows 10
  2. Synology Nas Change User Password Ssh Vmware

This is not possible using the command mentioned above because running “SUDO” will ask for credentials. And as the “Invoke-SSHCommand” will close the session after running the command, we can’t enter those.Luckily they thought about this while building “Posh-SSH”Specifically for when you want to run multiple command or need the session to stay open for other reasons there is “SSHStream”.With this the session will stay open so we have more options.To use the stream option we first have to define which stream we are referring to. 1: Invoke-SSHStreamExpectSecureAction -ShellStream $stream -Command 'sudo synouser -setpw root Password1' -ExpectString 'Password:' -SecureAction (read-host -AsSecureString) -VerboseWith this command the Root password will be reset to “ Password1”If we want to know what the terminal is displaying (as it is not a live feed of the terminal) we can run “$stream.Read”This way we know what the terminal is replying.After installing the Posh module the complete script to reset the Root password will be something like. 1: New-SSHSession -ComputerName IpOfYourSynology -Port.Credential ( Get-Credential)2: $stream = New-SSHShellStream -Index 03: Invoke-SSHStreamExpectSecureAction -ShellStream $stream -Command 'sudo synouser -setpw root Password1' -ExpectString 'Password:' -SecureAction (read-host -AsSecureString) -Verbose4: $stream.ReadDon’t use Password1 for your Root password but use something creativeAlso we are now using this module to reset a password, but we can also use it to run other command on Linux while using Powershell.

Reset

Change User Password Windows 10

Synology Nas Change User Password SshSynology

Synology Nas Change User Password Ssh Vmware

Q14: How do I connect to my Synology NAS with SSH? First of all, make sure you have SSH enabled on your NAS. Username = admin Password = Password used by the admin account of your NAS. Edit the iTunes Music Library.xml on your NAS and change ALL of the file addresses to match the locations on your NAS.

Coments are closed