- https://github.com/Benjamin-Loison
- Joined on
2022-10-16
Block a user
Run command on a given user SSH connection
ls /etc/pam.scripts/
ls: cannot access '/etc/pam.scripts/': No such file or directory
sudo mkdir /etc/pam.scripts
/etc/pam.scr…
Run command on a given user SSH connection
Being notified when the user logs out would also be interesting but in a second time.
Run command on a given user SSH connection
Could in theory modify .bashrc
but I suspect that the user can avoid running this file, for instance by using SCP. Furthermore, the aim is to not trust the user to not remove this statement from…
Run command on a given user SSH connection
ssh root@lemnoslife.com 'date && tail -n 5 /var/log/auth.log'
Output:
Fri Nov 8 06:38:07 PM CET 2024
2024-11-08T18:38:04.547790+01:00…
Run command on a given user SSH connection
Avoid users to see commands executed by others
/etc/fstab
:
proc /proc proc defaults,nosuid,nodev,noexec,hidepid=2 0 0
grep '^proc' /proc/mounts…
Avoid users to see commands executed by others
/etc/fstab
:
proc /proc proc defaults,hidepid=2 0 0
results at reboot in:
grep '^proc' /proc/mount…
Avoid users to see commands executed by others
sudo mkinitramfs
Output:
Usage: mkinitramfs [option]... -o outfile [version]
Options:
-c compress Override COMPRESS setting in initramfs.c…
Avoid users to see commands executed by others
mkinitramfs
Output:
Command 'mkinitramfs' is available in the following places
* /sbin/mkinitramfs
* /usr/sbin/mkinitramfs
The command…
Avoid users to see commands executed by others
ls -lh /boot/initrd.img-6.1.0-26-amd64
-rw-r--r-- 1 root root 37M Oct 6 11:33 /boot/initrd.img-6.1.0-26-amd64
file /boot/initrd.img-6.1.0-26-amd64
/…
Avoid users to see commands executed by others
ls -l /initrd.img
lrwxrwxrwx 1 root root 30 Oct 6 11:33 /initrd.img -> boot/initrd.img-6.1.0-26-amd64
I don't want a crontab solution as the statement may not be the…
Avoid users to see commands executed by others
https://ubuntuforums.org/archive/index.php/t-2443493.html does not seem helpful.
Could give a try to /etc/fstab
, see the Super User question 1858984.
Avoid users to see commands executed by others
time grep -r 'hidepid' / --exclude-dir={proc,sys}
Output:
grep: /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-252.so: binary file…