w shows a list of users and the last run program by each user. What are ways to hide the last run program?
|
feedback
|
migrated from stackoverflow.com Dec 21 '11 at 2:26
This question came from our site for professional and enthusiast programmers.
|
Note: One way you can hack this is by using perl:
If you checked the output of This works because Also note that this is an absolutely hacky way of doing what you're trying to do. Another way would just to put whatever you wanted inside a shell script, and run that. But that's not as fun. | |||||
feedback
|
You would have to make the process attributes non-readable. The program name and/or executable name - one way or another - is found in /proc/N/{cmdline,comm,environ,exe,maps,numa_maps,smaps}... and short of unmounting /proc, making all sorts of programs not function the way they are supposed to, the prerequisite to do this in some way would be a change to the linux kernel source. Even then, things like auditd(8) or selinux have ways to record what you are executing. If you don't like being looked over the shoulder, don't use the particular system. | |||
|
feedback
|
|
The bigger security problem with having the command line visible is something like:
Where users and batch applications access databases and/or embed passwords. If you cannot change this behavior you have to chroot users who have command line access on that system. chroot allows you to selectively prohibit or allow ordinary users access to commands like top, ps and other commands that use /proc. That is a standard approach to this kind of problem. | |||
|
feedback
|
topwill also show your current activity... Been reading Hackernews recently? :D – three Dec 20 '11 at 15:41sa– BRPocock Dec 20 '11 at 16:12