Want to Exclusive Lock directory in Linux

Posted on 2007-03-23
Medium Priority
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,


Question by:mivbinfotech
  • 2
  • 2
LVL 19

Accepted Solution

Nick Upson earned 2000 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

Author Comment

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 ..
LVL 19

Expert Comment

by:Nick Upson
ID: 18782389
nothing you can do can stop root

Author Comment

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

thanks for all your support...


Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Cron is one of the most popular and basic utilities found on Unix systems. Combined with other tools, cron makes it exceptionally easy to automate a broad range of tasks on your server.
This article explains how to use the rsync command to create backups and sync data across hosts. Rsync is a very useful command that is often used to copy data, make backups, migrate hosts, and bridge the gap between site staging and production envi…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

600 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