Tag Archives: admin

Clear exim queue

The queue can be viewed with mailq, which is the same as exim -bp.
You can view individual messages using exim -Mvc <message-id>. Once you’re done, run

exim -bp | grep -Eo "[[:alnum:]]{6}-[[:alnum:]]{6}-[[:alnum:]]{2}" | xargs exim -Mrm

Making a GRUB boot floppy

mkfs -V -t msdos /dev/fd0
mount /dev/fd0 /media/floppy
cd /media/floppy
mkdir boot
mkdir boot/grub
cp -pa /boot/grub/* /media/floppy/boot/grub
umount /media/floppy
/sbin/grub --batch --device-map=/dev/null <<EOF
device (fd0) /dev/fd0
root (fd0)
setup (fd0)
quit
EOF

Lifted from Linux-SXS and GNU Hurd FAQ.

Simple SSH account blocking, FreeBSD

Read the man page! There you’ll find that it’s performed in /etc/ssh/sshd_config by a troup of four directives:

DenyUsers
AllowUsers
DenyGroups
AllowGroups

In that order.

Say you’ve got group users with users jack, off, and jill, and group assholes with jack and jill.

If you want only jill to be able to login, you could specify:

AllowUsers jill

or

AllowUsers jill
AllowGroups assholes

and both of these wouldn’t allow (sic!) jack in!

If you wanted all the users of group assholes to be authorized, you’d put:

AllowUsers *
AllowGroups assholes

in the file. With only the second line, you’d lock everybody out (like I just did with my remote machine… oops!).

After you’re done, restart the server with

sudo /etc/rc.d/sshd restart