I would like ssh, sudo su and umount /home and run diagnostic on it. Is there a runlevel I can used to close X and other process using /home while keeping network access? Or another way?
thanks
I would like ssh, sudo su and umount /home and run diagnostic on it. Is there a runlevel I can used to close X and other process using /home while keeping network access? Or another way?
thanks
First, log out all user manually, then ssh with root.
Use "lsof | grep home" to find remaining process that use /home and kill them all.
You can umount.
/home
is only typically in use when users are logged in. The root user has a/root
home specifically so the root user is not dependent upon additional mount points.Enable root SSH login
For Ubuntu this means you need to give root a password in order to login via
ssh
:https://help.ubuntu.com/community/RootSudo#Enabling the root account
Consider that the root account may be disabled from SSH access by default, verify the setting in
/etc/ssh/sshd_config
:Logoff users and prevent new logins
To kick users off in a multi-user environment one would normally change to the single-user run level 1. However this is pretty much a console or serial port only task as
sshd
by default is configured only for run levels 2, 3, 4, and 5, and that you will likely lose yourssh
connection.http://www.debianadmin.com/debian-and-ubuntu-linux-run-levels.html
The not so great alternative is judicious use of
killall --user
but has to be applied to each and every user. Only the login (pseudo) terminal process needs to be killed and a more refined approach can be taken, for example:The next problem is prevent users immediate sign back in. You can create the file
/etc/nologin
to prevent user logins, you need to ensurepam_nologin.so
is enabled on Linux for all PAM methods such as SSH:http://www.novell.com/support/dynamickc.do?cmd=show&forward=nonthreadedKC&docType=kc&externalId=7007116&sliceId=1
This is also provided by the
shutdown -k
command:Finally
You can
unmount /home
.