Sponsored Content
Full Discussion: File Protection and Security
Top Forums Shell Programming and Scripting File Protection and Security Post 302498457 by imjustjong on Monday 21st of February 2011 11:14:51 AM
Old 02-21-2011
File Protection and Security

Since I'm just new in unix, can I ask the experts on how I can develop or enhance a unix utility in protecting or securing a file using scripts.

Im thinking chmod, is it enought? or are there other utilities in unix?

My algorithm is like there will be a menu that shows a list of types of protection that the user wants to put in his/her file. and also to unprotect files. *I need more ideas.

sample

1 Protect
2 Unprotect
3 etc that you can add
4 etc that you can add
5. maybe exit here.

then input will be

"filename" "choice"

Thanks in advance Smilie
 

We Also Found This Discussion For You

1. Linux

file security/protection

Hi All I am working on a site to help newbie to learn linux for free. demo.freelinuxconsole.info there is only one file index.php its been able to rename or deleted. Kindly let me know what permissions should i give to secure this file from editing or deleting by others. (8 Replies)
Discussion started by: smithjack
8 Replies
FLOCK(1)						    BSD General Commands Manual 						  FLOCK(1)

NAME
flock -- Provide locking API for shell scripts SYNOPSIS
flock [-dnosvx] [-w timeout] lockfile|lockdir [-c command] | [command ...] flock [-dnsuvx] [-w timeout] lockfd DESCRIPTION
The flock utility provides flock(2) access to the command line or scripts. The first form locks a file or directory while the command pro- vided is executed. If the file or directory does not exist, then a file is created. The second form can use an arbitrary file descriptor that is provided from a shell script for example: ( flock -s 100 # commands to be executed under the lock ) 100> /path/to/lockfile The following options are available: -c command Pass a command to a the shell. -d, --debug Provide debugging output. -n, --nb, --nonblock Don't block and fail immediately if the lock could not be obtained. -o, --close Close the file before executing the command. This is useful if the child forks and should not be holding the lock. -s, --shared Obtain a shared lock. -u, --unlock Unlock an existing lock. This is available only for a file descriptor. -v, --verbose On error print an explanation of the failure. -w, --wait, --timeout seconds Fail if the lock could not be obtained after seconds. -x, --exclusive Obtain an exclusive lock. EXIT STATUS
The flock utility exits 0 on success, and >0 if an error occurs. SEE ALSO
shlock(1), flock(2) HISTORY
An flock utility appeared in NetBSD 6.1. BSD
November 2, 2012 BSD
All times are GMT -4. The time now is 12:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy