![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file access rights? | vkishore.btw | UNIX for Dummies Questions & Answers | 1 | 04-25-2008 10:53 AM |
| [C++] File I/O (Reading from a Random-Access File) | VersEtreOuNe | High Level Programming | 0 | 02-12-2008 04:34 PM |
| concurrent file access | beechwood | Filesystems, Disks and Memory | 1 | 05-25-2002 05:19 PM |
| access file for sendmail | liyas | UNIX for Dummies Questions & Answers | 3 | 10-11-2001 11:10 PM |
| Need help to access/mount so to access folder/files on a Remote System using Linux OS | S.Vishwanath | UNIX for Dummies Questions & Answers | 2 | 07-30-2001 09:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
HOw I can Know who Access my file!!
Hi there
I just want to know what is the best way to know who access my file and when? I want also to know if it's possiple to hide or restrict access to file or directory even from the root ' I THINK MUCH BETTER TO CHANGE THE NAME THEN "!!! thanks in advance Abdulkarim |
|
|||||
|
cheesy answer here
Its kind of cheesy, but you can use .filename or put spaces in the filename or leading spaces to make hard on those who don't know how to handle that. Like a leading space in a filename that will stop most people.
touch " filename" touch ". filename" ls filename won't work. You must do ls " filename" or ls ". filename" to ls the file. Same with vi. If they try to vi . filename, vi will try to open the directory as a file and a file called "filename". 2 files! ONE CAVEAT HERE... However, in my environment. I as root have cron jobs that search for and report an files with weird filenames. So you can't stop root from finding or accessing them. Maybe these tactics will stop some from looking at your file. Although, it kind of like locking your car doors with the window rolled down! Try it and report back. ![]() |
|
|||||
|
You could also write a shell script using lsof and grep out by the individual filename and append the grep output if found to another textfile. Although, I have to admit that it is not terribly effective.
Code:
#!/bin/sh
while true
do
sleep 1
lsof | grep -i "MySpecialFile" >> paranoia.txt
done
Code:
vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile vi 3703 auswipe 3rW VREG 116,131078 159 1411444 /usr/home/auswipe/paranoid/MySpecialFile There is bound to be a better solution for this type problem. I would suggest Google for searching. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|