How to verify all user home directories are writable only by their owner
1. The problem statement, all variables and given/known data: Need to verify that all user home directories are writable only by their owner on Solaris. The script posted below is workable but it is taking a long time to display the results, and I don't seem to be able to fix it or find any alternative way to it.
2. Relevant commands, code, scripts, algorithms: My friend says it's the `su - $i -c "ls -ld" 2> /dev/null | grep ^d | awk '{print $1}'` part that is causing the problem but his not sure what to do either.
3. The attempts at a solution (include all code and scripts):
4. School (University) and Course Number:
TP, COH
Last edited by DukeNuke2; 11-05-2009 at 05:09 AM..
Reason: please use code tags...
I have a script that deletes obselete users from /etc/passwd then moves their home directories to another location. After 30 days, I need to delete the home directories that were moved to the new location. I would appreciate any ideas on how to delete the directories after the 30 days? (2 Replies)
Hi!
Need your help. How can I delete the cache folder of multiple user home directories via automatically executed shell script on a Mac OS X Server?
Example:
The userdata are stored on a Xsan Volume like this:
/Volumes/Xsan/userdata/mike
/Volumes/Xsan/userdata/peter... (2 Replies)
Hi, I'm currently working on my school assignment on how to verify that all user home directories are writable only by their owner on Solaris with VMware. But I'm not sure why my codes take a very long time to display the results. My friend says it's the `su - $i -c "ls -ld" 2> /dev/null | grep... (1 Reply)
Hi all
i am using solaris 10, i am creating user with
useradd -d/home/user -m -s /bin/sh user
user is created with in the following path
/export/home/user (auto mount)
i need the user to be created like this
(/home as default home directory )
useradd -d /home/user -m -s /bin/sh... (2 Replies)
I've allocated /exports for all user directories by making separate directories under /exports.....
:rolleyes:
now i need to unmount /exports . But i'm unable to do that..
How can i troubleshoot this issue.
Thanks in advance:D (2 Replies)
what is wrong with this script?
I get:
./perm.sh: command substitution: line 21: unexpected EOF while looking for matching `"'
./perm.sh: command substitution: line 22: syntax error: unexpected end of file
Script:
#!/bin/bash
for dir in `/bin/cat /etc/passwd | /bin/egrep -v... (4 Replies)
I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
We have regularly questions about how to create users and user accounts. But regularly user accounts need to be deleted too. It is quite easy to delete the user account itself but usually the HOME directory of the user remains.
It is good style to remove these directories but simply deleting... (3 Replies)
Discussion started by: bakunin
3 Replies
LEARN ABOUT DEBIAN
rfio_chmod
RFIO_CHMOD(3) Rfio Library Functions RFIO_CHMOD(3)NAME
rfio_chmod, rfio_fchmod - change access mode of a directory/file
SYNOPSIS
#include <sys/types.h>
#include "rfio_api.h"
int rfio_chmod (const char *path, mode_t mode);
int rfio_fchmod (int s, mode_t mode);
DESCRIPTION
rfio_chmod sets the access permission portion of the mode of a directory/file to the bit pattern in mode.
rfio_fchmod is identical to rfio_chmod but works on the file descriptor s returned by rfio_open.
path specifies the logical pathname relative to the current directory or the full pathname.
mode is constructed by OR'ing the bits defined in <sys/stat.h> under Unix or "statbits.h" under Windows/NT:
S_IRUSR 0000400 read by owner
S_IWUSR 0000200 write by owner
S_IXUSR 0000100 execute/search by owner
S_IRGRP 0000040 read by group
S_IWGRP 0000020 write by group
S_IXGRP 0000010 execute/search by group
S_IROTH 0000004 read by others
S_IWOTH 0000002 write by others
S_IXOTH 0000001 execute/search by others
The effective user ID of the process must match the owner of the file or be super-user. If a directory is writable and has the sticky bit
set, files/directories within that directory can be removed or renamed only if:
the effective user ID of the requestor matches the owner ID of the file or
the effective user ID of the requestor matches the owner ID of the directory or
the file is writable by the requestor or
the requestor is super-user.
RETURN VALUE
This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately.
ERRORS
EPERM The effective user ID does not match the owner of the file and is not super-user.
ENOENT The named file/directory does not exist or is a null pathname.
EBADF s is not a valid file descriptor.
EACCES Search permission is denied on a component of the path prefix or write permission on the file itself is denied.
EFAULT path is a NULL pointer.
ENOTDIR A component of path prefix is not a directory.
ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of a path component exceeds CA_MAXNAMELEN.
SENOSHOST Host unknown.
SENOSSERV Service unknown.
SECOMERR Communication error.
SEE ALSO Castor_limits(4)AUTHOR
LCG Grid Deployment Team
LCG $Date: 2005/03/31 13:13:02 $ RFIO_CHMOD(3)