Folder Lock in Unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Folder Lock in Unix
# 1  
Old 11-04-2008
Folder Lock in Unix

I am a new user of linux. I have 2 Queries
1) I recently started working with shell script, and now i plan to make a folder lock using a shell script. I have ubuntu 8.04 installed on my system.


2) When i searched on this forum all i got was mini-httpd, and apache2-utils package, but they are 4 web directory, i tried them on my college lan(web server: running on red hat), but could not get any result.....


Pls help me, this is really urgent.

Smilie

Last edited by tsunami; 11-04-2008 at 02:44 PM..
# 2  
Old 11-04-2008
Folder = directory in unix.

Without resorting to C, the only "lock" generally available is to use a lock file. A file that works as a traffic cop. The only drawback is that every script that accesses the directory under the control of the lock file has to play the game.

Is this some kind of homework?
# 3  
Old 11-05-2008
Question

Quote:
Originally Posted by jim mcnamara
Folder = directory in unix.

Without resorting to C, the only "lock" generally available is to use a lock file. A file that works as a traffic cop. The only drawback is that every script that accesses the directory under the control of the lock file has to play the game.

Is this some kind of homework?

sort of actually i wish to develop this as a project for my entry into the LUG of my college Smilie, anyways i tried this
  1. Make an .htpasswd file. The htpasswd command in Unix does this. You should put the password file outside of your web directory. So a command like “htpasswd -bc /home/matt/.htpasswd review donotenter” will create a new file using a username of review and a password of donotenter into the file /home/matt/.htpasswd . If you were to run the command “cat /home/matt/.htpasswd” you might see a line like “review:M1OdtjdGiDn1Y”.
  2. Make an .htaccess file. In this case, the file would be located at /home/matt/www/.htaccess and it would look something like
    AuthUserFile /home/matt/.htpasswd
    AuthName EnterPassword
    AuthType Basic
    <Limit GET POST>
    require valid-user
    </Limit>
You might need to fiddle with file permissions a little bit. My .htaccess file was readable by all, and my .htpasswd file was readable by all as well.


didnt workout, though this prompted 4 d passwords and all, but didnot lock the directory as expected.....Smilie

Pls help.................
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to lock Oracle table through UNIX?

Hi frndz, Can anyone provide me some input or pseudo code for my req as mentioned below... I am loading 2 files through unix script into oracle table...as i am doing some updates also i am getting an error where both files try to update the table simultaneously and my script fails.. so i... (3 Replies)
Discussion started by: gnnsprapa
3 Replies

2. Red Hat

sftp configuration | to lock users to their home folder.

In generally I use vsftp but I want to improve our security so I decide to use sftp instead of vsftp. We know that ssh,scp and sftp are in openssh server. How can I lock only sftp user to their home folder? And to prevent some users for sftp like root as such in vsftp daemon? (3 Replies)
Discussion started by: getrue
3 Replies

3. UNIX for Advanced & Expert Users

Testing privileges -lock lockfile /var/lock/subsys/..- Permission denied

Hi all, I have to test some user priviliges. The goal is to be sure that an unauthorized user can't restart some modules (ssh, mysql etc...). I'm trying to automate it with a shell script but in same cases I got the syslog broadcast message. Is there any way to simply get a return code... (3 Replies)
Discussion started by: Dedalus
3 Replies

4. Red Hat

Security Question: Lock after invalid login, Session Lock and Required Minimum Password Length

Hello all, If anyone has time, I have a few questions: How do I do the following in Linux. We are using Red Hat and Oracle Enterprise Linux, which is based on Red Hat too. 1. How to lock the account after a few (like 3) invalid password attempts? 2. How do you lock a screen after 30... (1 Reply)
Discussion started by: nstarz
1 Replies

5. Shell Programming and Scripting

how to create folder and sub-folder in UNIX ?

Hi all, I have the following code to check the whether the folder is exist in my system. if ; then echo 'folder exist'; else echo 'folder not exist'; mkdir /home/batch/testing ; fi When I remove the "testing" folder from "/home/batch" directory, the code is working fine. But when I... (2 Replies)
Discussion started by: suigion
2 Replies

6. Shell Programming and Scripting

Applying lock on a file in Unix Ksh

Hi, How can we apply lock on a text file through Unix Ksh script. I did found a command flock (file descriptor) but am not very acquainted with the usage. Can anybody tell me if I need to use Flock command for applying locks to a file while writing on it. If the person can explain the usage... (3 Replies)
Discussion started by: kum5256
3 Replies

7. Shell Programming and Scripting

How to lock an inbox using UNIX scripting

Hi All, I have an inbox , which recieves mails every second. I need to copy the contents of the mails in the inbox to a file , say once every minute. Then clear the content of the inbox. There is a possibility that a new mail might come in before I delete the content. Please let me know if... (1 Reply)
Discussion started by: Manju-he202
1 Replies

8. Windows & DOS: Issues & Discussions

How can I upload a zip folder on a unix path from my windows folder?

Hello, I am an amature at UNIX commands and functionality. Please could you all assist me by replying to my below mentioned querry : How can I upload a zip folder on a unix path from my windows folder? Thanks guys Cheers (2 Replies)
Discussion started by: ajit.yadav83
2 Replies

9. UNIX for Advanced & Expert Users

Lock the required folder

Hi friends, 5-6 users are using the same login in one of our Unix server. My question is, Is it possible to lock some folder using seperate password other than login password by each user, so that that folder is not accessible to other users. Please guide/suggest me. Cheers~~ Ganapati.... (11 Replies)
Discussion started by: ganapati
11 Replies

10. UNIX for Dummies Questions & Answers

How to lock a file in unix?

We wish to keep a sequence number in a file. When someone wants to get the next sequence number we need to lock the file, get the next number and increment it by one. How do you do that? I know how to get the number and increment it but how do I lock the file and test that it is locked or not... (1 Reply)
Discussion started by: tammy_schmuki
1 Replies
Login or Register to Ask a Question