Solved

Want to Exclusive Lock directory in Linux

Posted on 2007-03-23
6
235 Views
Last Modified: 2012-08-14
I have a directory which I want to lock exclusively so that nobodu can put files in that directory

I have to encrypt the files in that directory and move the files to specific locations and delete all files and then empty the directory but during the execuition of all this i do not want any user to access that directory and put or remove files, other than teh user doing this, the script will do all this task, but I m having trouble locking the directory for exclusive access to that user,,, I am using HP _ AUX please advise at the earliest,

Thanks

0
Comment
Question by:mivbinfotech
  • 2
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
NickUpson earned 500 total points
ID: 18780720
login using a specific user id and set the directory permissions so that only that user can use it, e.g.

login as fred

chmod 700 /home/mydir # no-one else can use it

mv & copy files etc

chmod 777 (or whatever is reasonable) /home/mydir
0
 
LVL 2

Author Comment

by:mivbinfotech
ID: 18781576
if i do this will root still have access to this please advise,, i do not want even root to have access apart from fred ..
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 18782389
nothing you can do can stop root
0
 
LVL 2

Author Comment

by:mivbinfotech
ID: 18934575
I have not able to achieve what i want but

thanks for all your support...

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now