Koozali.org: home of the SME Server
Obsolete Releases => SME Server 9.x => Topic started by: fpausp on August 04, 2016, 08:48:16 PM
-
I would like to temp. lock a user account (over night) via console/cronjob, is there a command ?
-
please, explain your problem/aim, not your solution, thank you ;-)
-
I would like to connect via ssh and lock a user account ?
-
each time you lock an user you have to reset his password..
so, again, why you need to lock an user?
is it an X Y problem (http://xyproblem.info/) case?
-
I would like to temp. lock a user account (over night) via console/cronjob, is there a command ?
You can do this by using
signal-event user-lock <username>
but you will have to reset password to active the account again.
-
Yes, thank you...
# lock a user
signal-event user-lock <username>
Maybe there is a way to unlock a user, please try it out and confirm:
# unlock a user
usermod <username> -U
# correct user-unlock in server-manager
db accounts setprop <username> PasswordSet yes
-
I am sorry but my last post is not the clean solution what I am looking for...
What I like to do is lock / unlock a user account for my working RADIUS Authentication (WPA2-Enterprise WIFI).
I can do it with the server-manager but it would also be nice to do it over ssh to have the ability of automating.
-
fpausp
[quote!]I can do it with the server-manager but it would also be nice to do it over ssh to have the ability of automating.
[/quote]
Anything you can do in server manager, you can do at the command prompt eg when running a ssh session.
Anything you do at command line can be automated using a cron job. To temporarily change settings for a user you can run one cron job to disable something (say at 5pm) & then another cron job to enable something (say at 8am).
So please tell us what change you make in server manager & we will tell you what command to issue at command line/using ssh.
You can find out yourself what commands are issued when using server manager.
Perform the required change in server manager noting the exact time you start doing this. Then when done, review the messages log file, in server manager view log files panel, select messages (which is the default) ie this is the /var/log/messages log file.
Look through the file for the exact time you made the change(s) in server manager & you will see the command or commands that the system issued.
You can also see the commands in real time by opening a putty/ssh session & running the tail command before you make the changes in server manager, & then watch the ssh session screen.
man tail
for more info.
Also FYI you can run server manager in text mode (non GUI) when using a putty/ssh session,
Type
console
& select server manager
or use elinks