Help on remote

Status
Not open for further replies.

FlyDiver

Cadet
Joined
Jun 24, 2013
Messages
2
Hello All,

I am having a problem in which I hope there are people who can help me.

Have recently build a back-up storage (iSCSI 4x2T Raid5) with FreeNAS 8.3.1p2 on flash-drive which I want to power on/off remotely.

With CentOS VM and a Wake On Lan script found on the Internet I'm able to startup the storage.

Unfortunately I'm not able to power-off the storage remotely by a command such as “ssh ssh_private_key root@IP-address poweroff”.

As written in the manual are for security reasons, the root password, the SSH service, and root SSH logins all disabled by default in the used release of FreeNAS.

Therefore also not permitted to store the public ssh key on FreeNAS operating system.
When logged in as a user I haven't the permission to use the "poweroff" or "shutdown-p now" command.

Wouldn't it be nice when the developping team of FreeNAS will give users some root ssh privileges that at least a remote power-off will be possible?.

Found suggestions on the Internet to shutdown FreeNAS by itself with a Cron job doesn't give any result.

VMware host doesn't support pass through configuration, so using CentOS and an USB Relay switch is also not an option.

Is there someone on the forum who can help with the right solution, other than suggest to use a second physic system with USB Relay to solve this problem.
 

Dobbin22

Cadet
Joined
Sep 22, 2013
Messages
1
Hello,

Have any success with remote shutdown?

Not shutting down FreeNAS properly in the past has caused a lot of problems.
And a serial connection is not always practical which together creates a dilemna.

Thanks.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
As written in the manual are for security reasons, the root password, the SSH service, and root SSH logins all disabled by default in the used release of FreeNAS.
Yes, it is disabled by default, but nothing prevents you from enabling it. You can change sshd settings in Services -> SSH (Login as Root with password, Allow Password Authentication). You can set the root password via Accounts -> View Users -> root -> Change Pasword.
Therefore also not permitted to store the public ssh key on FreeNAS operating system.
You can easily add a public ssh key for the root user here: Accounts -> View Users -> root -> Modify User -> SSH Public Key.
 

FlyDiver

Cadet
Joined
Jun 24, 2013
Messages
2
Thanks a lot for all your reactions, warnings and suggestion. In the meantime I succeeded with some help to power On/Off the FreeNAS server remotely. Now a small script on my CentOS server is powering up the FreeNAS backup-server, starts the backup procedure on the VMware hypervisor and when finished, it’s sends me an e-mail of the backup status while powering down the FreeNAS backup-server.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You can potentially do a variety of things ... the best of which would probably be making a non-root user named "shutdown", add a home directory for him on your datastore, and make sure he's part of the "operator" group. Then arrange key based SSH access to that account. Then you can "ssh shutdown@foo shutdown -p"
 
Status
Not open for further replies.
Top