How to temporarily access Samba v1 to support old software?

NASbox

Guru
Joined
May 8, 2012
Messages
650
Unfortunately I still have one old Windows XP machine that I haven't been able to get rid of yet which requires that I use Samba V1.

I found a command line hack here in the forum
sysctl freenas.services.smb.config.server_min_protocol=NT1
followed by restarting Samba. Works fine.

My questions are:
  1. What is the equivalent command to sysctl freenas.services.smb.config.server_min_protocol=NT1 to return back to normal?
  2. Can I safely restart samba from the command line, and if so how?
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Unfortunately I still have one old Windows XP machine that I haven't been able to get rid of yet which requires that I use Samba V1.

I found a command line hack here in the forum
sysctl freenas.services.smb.config.server_min_protocol=NT1
followed by restarting Samba. Works fine.

My questions are:
  1. What is the equivalent command to sysctl freenas.services.smb.config.server_min_protocol=NT1 to return back to normal?
  2. Can I safely restart samba from the command line, and if so how?
There is a checkbox in the UI under services->SMB that enables SMB1 support. Use that. The sysctl was deprecated in FreeNAS 11.2.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
There is a checkbox in the UI under services->SMB that enables SMB1 support. Use that. The sysctl was deprecated in FreeNAS 11.2.
Thanks for letting me know - I've made a note for the future so it doesn't become a Gotcha!
the sysctl (from the command line still works in 11.2-U7 and I hope to be rid of Windows XP by the time it is gone for good.

For now I would really like a quick command line solution if that is possible with screwing up the system. Is that possible?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Thanks for letting me know - I've made a note for the future so it doesn't become a Gotcha!
the sysctl (from the command line still works in 11.2-U7 and I hope to be rid of Windows XP by the time it is gone for good.

For now I would really like a quick command line solution if that is possible with screwing up the system. Is that possible?

This sysctl is already deprecated in 11.2-U7. I wrote a migration that reads the value of the sysctl, and converts it to the UI / db checkbox. If you want a CLI way of altering that parameter, then:
Code:
midclt call smb.update '{"enable_smb1": true}'
service ix-pre-samba start
service samba_server restart


To disable midclt call smb.update '{"enable_smb1": false}' and then the other two commands. Don't use the sysctl.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
This sysctl is already deprecated in 11.2-U7. I wrote a migration that reads the value of the sysctl, and converts it to the UI / db checkbox. If you want a CLI way of altering that parameter, then:
Code:
midclt call smb.update '{"enable_smb1": true}'
service ix-pre-samba start
service samba_server restart


To disable midclt call smb.update '{"enable_smb1": false}' and then the other two commands. Don't use the sysctl.
Thanks for taking the time to come back to me on this as I didn't get the significance of what you were saying since the sysctl command actually did enable samba1. IIUC all I need to do is set up the following batch files (just chnage true -> false) for enable -> disable.

Have I got that correct?

samba1_enable
Code:
#!/bin/sh
midclt call smb.update '{"enable_smb1": true}'
service ix-pre-samba start
service samba_server restart

samba1_disable
Code:
#!/bin/sh
midclt call smb.update '{"enable_smb1": false}'
service ix-pre-samba start
service samba_server restart
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Thanks for taking the time to come back to me on this as I didn't get the significance of what you were saying since the sysctl command actually did enable samba1. IIUC all I need to do is set up the following batch files (just chnage true -> false) for enable -> disable.

Have I got that correct?

samba1_enable
Code:
#!/bin/sh
midclt call smb.update '{"enable_smb1": true}'
service ix-pre-samba start
service samba_server restart

samba1_disable
Code:
#!/bin/sh
midclt call smb.update '{"enable_smb1": false}'
service ix-pre-samba start
service samba_server restart
Or a simpler way to do it will be just two commands:
Code:
midclt call smb.update '{"enable_smb1": true}'
midclt call service.restart cifs

I believe this should work in 11.2.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
Or a simpler way to do it will be just two commands:
Code:
midclt call smb.update '{"enable_smb1": true}'
midclt call service.restart cifs

I believe this should work in 11.2.

Thanks... so am I correct that all I need to do is change true -> false to deactive smb1?
Code:
midclt call smb.update '{"enable_smb1": false}'
midclt call service.restart cifs
 
Top