How shutdown QNAP by command line from PC Windows

Q'center app, Helpdesk app
Post Reply
tuanhh1980
New here
Posts: 5
Joined: Wed Jul 10, 2024 11:20 am

How shutdown QNAP by command line from PC Windows

Post by tuanhh1980 »

I want to shutdown My QNAP by command line in My PC Windows, How can you help me?
Thank you.
User avatar
OneCD
Guru
Posts: 12394
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: How shutdown QNAP by command line from PC Windows

Post by OneCD »

Hi and welcome to the forum. :)

If you're using Windows 10 or-later, try the builtin 'ssh' command. Use this command to login to your NAS via SSH as 'admin', and issue the 'poweroff' command.

You'll first need to enable SSH on your NAS, and disable the console management menu.

If you'll be running this command unattended, establish passwordless login via SSH.

If Windows 'ssh' is anything like the regular OpenSSH 'ssh' command, you'll be able to issue a poweroff with:

Code: Select all

ssh admin@yournas poweroff
... from your Windows cmd prompt.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
tuanhh1980
New here
Posts: 5
Joined: Wed Jul 10, 2024 11:20 am

Re: How shutdown QNAP by command line from PC Windows

Post by tuanhh1980 »

Thanks for Reply.
When I type : ssh admin@yournas poweroff
And I Enter -> It ask password of NAS, I want to remember password in command line
Thanks
User avatar
OneCD
Guru
Posts: 12394
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: How shutdown QNAP by command line from PC Windows

Post by OneCD »

tuanhh1980 wrote: Wed Jul 10, 2024 11:58 am And I Enter -> It ask password of NAS, I want to remember password in command line
So, you'll need to configure passwordless login from your Windows user account into the NAS.

Short-version:
  • Find the 'id_rsa.pub' file for your Windows SSH account, copy it to the NAS, then add the contents to the 'authorized_keys' file in /etc/config/ssh.
Long-version:

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
tuanhh1980
New here
Posts: 5
Joined: Wed Jul 10, 2024 11:20 am

Re: How shutdown QNAP by command line from PC Windows

Post by tuanhh1980 »

Have too much step.
I can not understand and do that. Can you tell me more simple?
Thanks
tuanhh1980
New here
Posts: 5
Joined: Wed Jul 10, 2024 11:20 am

Re: How shutdown QNAP by command line from PC Windows

Post by tuanhh1980 »

Oh yes, too simple and easy, only using command below
plink -batch admin@yournas -pw ***** -P 22 sudo -S poweroff
User avatar
OneCD
Guru
Posts: 12394
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: How shutdown QNAP by command line from PC Windows

Post by OneCD »

That’s one way to do it. ;)

But now you have to store your NAS admin password in a script.

Also, if you’re logging-in as the ‘admin’ user, you don’t need to use ‘sudo’.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
tuanhh1980
New here
Posts: 5
Joined: Wed Jul 10, 2024 11:20 am

Re: How shutdown QNAP by command line from PC Windows

Post by tuanhh1980 »

I try on another PC It's not remember password.
I was try config on Nas many time but still not remember password.
Can you help me?
Thank you
dosborne
Experience counts
Posts: 1972
Joined: Tue May 29, 2018 3:02 am
Location: Ottawa, Ontario, Canada

Re: How shutdown QNAP by command line from PC Windows

Post by dosborne »

A 3 second reset will set the admin password to default (if that is what you are asking).
https://www.qnap.com/en/how-to/faq/arti ... set-my-nas
QNAP TS-563-16G 5x10TB Seagate Ironwolf HDD Raid-5 NIC: 2x1GB 1x10GbE
QNAP TS-231P-US 2x18TB Seagate Exos HDD Raid-1
[Deadbolt and General Ransomware Detection, Prevention, Recovery & MORE]
User avatar
OneCD
Guru
Posts: 12394
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: How shutdown QNAP by command line from PC Windows

Post by OneCD »

tuanhh1980 wrote: Fri Jul 12, 2024 5:32 pm I try on another PC It's not remember password.
I was try config on Nas many time but still not remember password.
Which method are you asking about? The passwordless login, or the second method you used? :'

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
Post Reply

Return to “NAS Management”