Need a script to create file permission change restriction
Hello,
I am looking for a UNIX shell script which can help me for access restriction.
1) /home/ram, there are number file with .txt extension, which should be only owned "ram" user.
like as below
2) In case ram user, fortunately/unfortunately make any permission change, immediately email group should get alert.
3) Immediately file permission for .txt extension file again should come on same file permission like (-rwx------), it means ram user will only have "rwx" no one else.
Let me explain you by example
If you see as of now ram user only having 'rwx', now unfortunately ram execute chmod 777 *.txt, then all *.txt will have 777 permission,
If any .txt file change permission command (apart from Ram --> "rwx") execute on particular directory
then immediately email group should get alert, as well as file permission should get change with only "-rwx------"
Please advice script.
Regards,
Last edited by Scrutinizer; 03-11-2016 at 04:07 AM..
Reason: code text
Hi!! Experts,
Is there any way to find the timestamp when the permission of a file was modified?? I mean no change to file contents.. Just the chnage of permissions.
:) (1 Reply)
I am creating a file using the UTL_FILE command of oracle. This creates a file with the oracle user id. The file does not have permission for being read by any other user id. Is there a way that I can change this default permission. I tried using umask in the .login. Setting the umask to 022 works... (2 Replies)
In my script, I am creating a file ----> then writting one line (i.e. Timestamp) ----> then FTP'ing. The same script can be executed by many other users.
While other users executing this script, they couldn't Over write this one line (i.e. Timestamp)
My expectation
So I wanted to create a... (2 Replies)
Hello,
I would to create a new user with some restriction:
1. The user will not be able to CD any directory (I mean he'll login to the defined home directory and that's all).
2. The user will not be able to delete anything in that home directory
Thanks a lot in advance,
Shahar (1 Reply)
Hi Guys,
I want to know is there any method to create a file having 777 permission. I am aware of umask, since it is only giving max. 666 permission for files this is not fulfilling my needs.
Thanks in advance
---------- Post updated at 12:49 AM ---------- Previous update was at 12:31... (10 Replies)
Guys, I need help.
I need to change the .txt file permission after I have reset the file content to 0.
The code that reset the file content to 0 is as follows:
#!/bin/sh
for i in /root/script/*.txt
do
echo "0" > $i
done
However, the file is generated by the apache application,... (3 Replies)
I want to change the permission of a dir to 777 after every hour in a background process.I do not have the access to the crontab , is there another way of doing it a scrit of some thing like that . Any help will be great. (1 Reply)
Hello all, I am trying to create a script or a .command file that will run for me and my other techs on many, many Mac OSX computers that will add a file to the /etc/ folder called /etc/launchd.conf
Every time I try to run the script, I get "Permission Denied" when trying to put the file into... (13 Replies)
Hi,
this is the structure of the directory
/local/home/app/cases
under cases directory, below are the sub directories and each directory has files.
/local/home/app/cases/1
/local/home/app/cases/2
/local/home/app/cases/3
/local/home/app/cases/4
File types are .txt .sh and so... (5 Replies)
Discussion started by: lookinginfo
5 Replies
LEARN ABOUT DEBIAN
package
PACKAGE(1) General Commands Manual PACKAGE(1)NAME
package - register package user via mailagent
SYNOPSIS
package address system version patchlevel [ mailpatches | notifypatches ]
DESCRIPTION
This command is not intended to be run directly by a user, but may appear in any mail whose subject is set to Command. Such mail will be
processed by the mailagent(1), which will extract all lines beginning with @SH, which may specify this command. The mailagent first sets
environment variables that will be used by the command.
Package is used to notify the author of a package about its users. It is normally generated automatically by the MailAuthor.U unit when
the user runs Configure.
If the patchlevel specified is not the latest for that system and version, mail is immediately sent suggesting that they upgrade and
remindng them how to request the latest patches.
The final parameter, if included may be set to mailpatches to specify that the user would like to have future patches mailed to them, or
notifypatches to specify that a mail notification of future patches should be sent, rather than the entire patch.
The user's address and notification request are saved in the file users in the package's directory.
Package performs an approximate address match in order to avoid duplicate entries. Whenever this elimination occurs, a warning message is
issued in the logfile. Two addresses will be said equivalent if one of them has an added machine name or if they are really equal. There-
fore, the following addresses are equivalent:
ram@acri.fr
ram@main.acri.fr
whereas the following two are not equivalent, unfortunately:
ram@acri.acri.fr
ram@main.acri.fr
When a user is asking to be left alone, it is important to let him know if the request failed, because he will be annoyed when the next set
of patches is issued and he still gets them despite his previous request. Therefore, if no approximate match occurs, a warning message is
sent back, with a list of addresses that are close to his own e-mail address, but not equivalent. Fortunately, the following addresses are
considered close:
ram@acri.fr
ram@somewhere.com
raphael@main.acri.fr
manfredi@acri.acri.fr
because they either have the same login (important when someone changes company) or share the same domain or sub-domain part.
In order to edit the users file, the edusers script should be used. For one thing, it will let you edit the users file from whatever pack-
age you name in the command line, but it will also properly lock the file so that the execution of package will stall for the duration of
the manual edition (provided you have a strict locking policy defined in your ~/.mailagent configuration file).
FORWARDING
Package supports command forwarding as described in the mailhelp(1) page.
FILES
~/.mailagent configuration file for mailagent.
System/users list of users of that system.
This file consists of single line records, one for each registered user. Each record consists of three tab-separated
fields.
The first field indicates the level of updates requested by the user by a single letter as follows:
M Mail future patches directly to the user when they are issued.
N Notify the user of future patches.
U The users chose to let the author know that they have tried the program, but does not wish to know about future
updates.
L The user is no longer interested in the program and wants to be left alone.
The second field is their last notified patch level, or a dash (-) if it is not known.
The third field is the user's Email address.
Log/agentlog mailagent's log file
AUTHORS
Graham Stoney <greyham@research.canon.oz.au>
Raphael Manfredi <Raphael_Manfredi@pobox.com> (minor enhancements)
SEE ALSO edusers(1), mailagent(1), metaconfig(1).
PACKAGE(1)