question about restrict user login time in freebsd14.2 ?

Dear all:
i have freebsd14.2 server . now new user xx1 want to use it. i want to restrict xx1 user can login from 9:00am to 21:00PM . how to do that ? thanks.
i have read login.conf(5) . some look like times.allow function. but ,i am not sure. and don't know to configure it. please show me something. thanks.
 
Have a look at "sessiontime" in login.conf(5). There is also a example "subscriber" login class [1] in /etc/login.conf with additional control capabilities listed which might be useful to restrict the users account usage.

Instead of modifying the "default:\" login class, a new class can be created, or the "subscriber" class can be used, modified as needed. The ":tc=standard:" in the "subscriber" class configuration forwards to
Code:
standard:\
        :tc=default:
which in change forwards to the "default:\" class.

A existing users login class can be modified through chsh(1) or pw(8), run as root. A new users login class can be specified during creation with adduser(8) or pw(8).

See also Thread fine-grain-control-over-user-login-particularly-regarding-duration.51782

[1]
Rich (BB code):
## Example standard accounting entries for subscriber levels
##
#
#subscriber|Subscribers:\
#       :accounted:\
#       :refreshtime=180d:\
#       :refreshperiod@:\
#       :sessionlimit@:\
#       :autodelete=30d:\
#       :expireperiod=180d:\
#       :graceexpire=7d:\
#       :gracetime=10m:\
#       :warnexpire=7d:\
#       :warnpassword=7d:\
#       :idletime=30m:\
#       :sessiontime=4h:\
#       :daytime=6h:\
#       :weektime=40h:\
#       :monthtime=120h:\
#       :warntime=4h:\
#       :tc=standard:
 
Back
Top