0

i have ubuntu server installed in one of my pc.

i used samba for the network sharing.

i manually enable/disable samba user on a fix day.

please help me to make it as automatic based on given date or time. Let's say Friday the user will be enabled and disabled on the other days.

i tried searching the net but nothing comes up..

1 Answers1

0

You can disable a user with

at 0:00 Fri smbpasswd -x {user}
  • You can read this as "at 0:00 on Friday start smbpassword and remove {user}'s password.

You can enable a user with

at 0:00 Sat smbpasswd -x {user} -W {password}
  • You can read this as "at 0:00 on Saturday start smbpassword and set {password} for {user}.

  1. The password is shown in plain text in the process list.
  2. This is a command line method that survives reboots.

If you want this automated you can add those 2 lines to a script. See How do I run a script at start up? on a couple of methods)

Rinzwind
  • 299,756