Problem with user login after canceling a shutdown -r +2
Word of preface:
nuc pc is running freebsd 14.2 headless and it's hostname is bsd
the user is ben, so the prompt says ben@bsd
It seems it does not recognize the -c flag. Fine, I use kill instead.
The man page shutdown() also mentions something about that:
****
-c The system is power cycled (power turned off and then back on) at
the specified time. If the hardware doesn't support power cycle,
the system will be rebooted. At the present time, only systems
with BMC supported by the ipmi(4) driver that implement this
functionality support this flag. The amount of time the system
is off is dependent on the device that implements this feature.
****
I am not 100% sure but I think freebsd 13.4 responded as expected to sudo shutdown -c
I can reproduce the problem any time.
This is the sequence of commands:
*1* ben@bsd:~ $
Shutdown at Thu Feb 6 09:19:19 2025.
shutdown: [pid 1340]
Because sudo shutdown -c does not work I have to use the kill command.
*2* ben@bsd:~ $
*3* ben@bsd:~ $
*********
*4*
On my laptop, with hostname ben I executed ssh at 9:20h. to connect to the freebsd system
logging in as user ben at the nuc freebsd 14.2, using a console instead
of ssh, gives the very same message, so it is not just related to using ssh.
user root is always able to login at the nuc freebsd using a console.
By the way, ssh login is disabled for user root.
********
back on my nuc with freebsd 14.2 the /var/log/messages says:
But before the
signed on in the sessions where he was signed on before the "shutdown". But he can not start a new session.
To me it looks like pieces of the shutdown are still pending, despite killing it.
on the nuc freebsd 14.2 I checked:
After a reboot of the nuc (freebsd) user ben can signon again, either at the console or remotely using ssh
I can not explain this. Can anyone?
Not important but I use
before testing a modified pf firewell test script.
When I lock myself out the system will reboot using
a well tested /etc/pf.conf instead of testscript.conf
That enables me to log on remotely again using ssh.
When I am not locked out I kill the shutdown -r +2 immediatly
Word of preface:
nuc pc is running freebsd 14.2 headless and it's hostname is bsd
the user is ben, so the prompt says ben@bsd
sudo shutdown -c
does not work, it says:
Code:
ben@bsd:/usr/share/zoneinfo $ sudo shutdown -c
Password:
usage: shutdown [-] [-c | -h | -p | -r | -k] [-o [-n]] time [warning-message ...]
poweroff
It seems it does not recognize the -c flag. Fine, I use kill instead.
The man page shutdown() also mentions something about that:
****
-c The system is power cycled (power turned off and then back on) at
the specified time. If the hardware doesn't support power cycle,
the system will be rebooted. At the present time, only systems
with BMC supported by the ipmi(4) driver that implement this
functionality support this flag. The amount of time the system
is off is dependent on the device that implements this feature.
****
I am not 100% sure but I think freebsd 13.4 responded as expected to sudo shutdown -c
I can reproduce the problem any time.
This is the sequence of commands:
*1* ben@bsd:~ $
sudo shutdown -r +2
Shutdown at Thu Feb 6 09:19:19 2025.
shutdown: [pid 1340]
Code:
ben@bsd:~ $
*** System shutdown message from ben@bsd.localnamar.nu ***
System going down in 2 minutes
Because sudo shutdown -c does not work I have to use the kill command.
*2* ben@bsd:~ $
sudo ps ax | grep shutdown
Code:
1340 - S<s 0:00.00 shutdown -r +2
1343 1 S+ 0:00.00 grep shutdown
*3* ben@bsd:~ $
sudo kill -9 1340
*********
*4*
On my laptop, with hostname ben I executed ssh at 9:20h. to connect to the freebsd system
Code:
ben@ben:~$ [cmd]ssh ben@bsd.localnamar.nu[/cmd]
NO LOGINS: System going down at 09:19
Administrator refusing you: /var/run/nologin
Connection closed by 192.168.178.18 port 22
ben@ben:~$
logging in as user ben at the nuc freebsd 14.2, using a console instead
of ssh, gives the very same message, so it is not just related to using ssh.
user root is always able to login at the nuc freebsd using a console.
By the way, ssh login is disabled for user root.
********
back on my nuc with freebsd 14.2 the /var/log/messages says:
Code:
Feb 6 09:20:00 bsd sshd[1357]: fatal: Access denied for user ben by PAM account configuration [preauth]
Feb 6 09:29:52 bsd sshd[1384]: fatal: Access denied for user ben by PAM account configuration [preauth]
But before the
sudo shutdown -r +2
followed by killing the shutdown, user ben could signon and also remainssigned on in the sessions where he was signed on before the "shutdown". But he can not start a new session.
To me it looks like pieces of the shutdown are still pending, despite killing it.
sudo ps ax | grep shutdown
does not show anything, but the grep:
Code:
ben@bsd:~ $ sudo ps ax | grep shutdown
1416 1 S+ 0:00.00 grep shutdown
on the nuc freebsd 14.2 I checked:
ls -l /etc/nologin
# It replies : ls: /etc/nologin: No such file or directory pw usershow ben
# It replies: ben:*:1001:0::0:0:Ben Thijssen:/home/ben:/bin/sh sudo cat /etc/master.passwd | grep ben
# Replies ben:$6$O4Hqk .etc. ReS/:1001:0::0:0:Ben Thijssen:/home/ben:/bin/shAfter a reboot of the nuc (freebsd) user ben can signon again, either at the console or remotely using ssh
I can not explain this. Can anyone?
Not important but I use
sudo shutdown -r +2
justbefore testing a modified pf firewell test script.
sudo pfctl -f /usr/local/etc/firewall/testscript.conf
When I lock myself out the system will reboot using
a well tested /etc/pf.conf instead of testscript.conf
That enables me to log on remotely again using ssh.
When I am not locked out I kill the shutdown -r +2 immediatly