Removing user access using user id


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Removing user access using user id
# 8  
Old 01-27-2011
Hi, is it possible that you have GNU sed installed separately? It often is installed in a different directory, perhaps as gsed, and it supports -i.

And I'll throw perl into the pot:

Code:
perl -i.bak -e '$du = shift; while(<>){ s/,?$du// if /[:,]$du[:,]/; print; }' user_you_want_to_delete *.prm

# 9  
Old 01-27-2011
Code:
find . -type f -name '*.prm' | while read PERMFILE
do
    sed -e "s/,${name},/,/g" \
        -e "s/:${name}[:,]/:/" \
        -e "s/,${name}:/:/" $PERMFILE > /tmp/prm_tmp_$$
    cat /tmp/prm_tmp_$$ > $PERMFILE
done
rm /tmp/prm_tmp_$$

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

User permission access

Hi folks, I am trying to grant the access like below items using the setfacl command, but i couldn't achieve as what I required. any other possibility. username : testing Readonly access in /form_dl/system/prd/logs Write only access in /form_dl/system/prd/deploy No access to other... (0 Replies)
Discussion started by: gsiva
0 Replies

2. AIX

Removing the password of a user

Hi Experts, According to the manual if you want to remove the password for a user account the "password" field in /etc/security/passwd should be set to "*" So instead of this: password = 6BqaLx8FeI8os Should be set to this: password = * But when I run the following command in my AIX... (5 Replies)
Discussion started by: livehho
5 Replies

3. UNIX for Advanced & Expert Users

Need help about user access

Hi frds, I have got a script restart.sh that kills and restarts a process. This scripts runs under a user called USER1 who is a normal user. Now my requirement is that i got other user named USER2 who should be able to run that script as USER1 as we dont want to share the password of user1 we... (2 Replies)
Discussion started by: phanidhar6039
2 Replies

4. Solaris

User access on Solaris

Hi There I am having trouble in solving a scenario. We have some test systems on the network where users can login as themselves. These systems are connected to the LDAP server and authentication happens without any issues. These systems are used to create flars which are used to jumpstart other... (0 Replies)
Discussion started by: sinfuldips
0 Replies

5. AIX

Limit user access

We have gotten an application that will read and display logs in a report format. The application need a user name and password to access the AIX servers where the logs reside. My problem is the logs are in a few different file systems on the server. Is there any way to lock the user to only the... (1 Reply)
Discussion started by: daveisme
1 Replies

6. UNIX for Advanced & Expert Users

Determining if user is local-user in /etc/passwd or LDAP user

Besides doing some shell-script which loops through /etc/passwd, I was wondering if there was some command that would tell me, like an enhanced version of getent. The Operating system is Solaris 10 (recent-ish revision) using Sun DS for LDAP. (5 Replies)
Discussion started by: ckmehta
5 Replies

7. AIX

User access

Is there any way I can restrict a user to 1 directory when logging in but give the access to another directory? For example restrict the user to /home/user at login but also allow then to access /opt/data/user. (1 Reply)
Discussion started by: daveisme
1 Replies

8. Red Hat

New RH User - Access Denied

Hi, We were just recently given a new VM instance with Red Hat linux. The only user account that can log in successfully is the root account. I made sure that the user z021407 has access to their directory and the account can read the home directory, but I can't log in with the new account... (2 Replies)
Discussion started by: edrichard
2 Replies

9. UNIX for Dummies Questions & Answers

removing a user with hidden files

Hello, I am trying to remove an employing from our database, I have removed all her files but can't remove the directory because of the hidden files. How do I remove the user? Thanks, (1 Reply)
Discussion started by: nov_user
1 Replies

10. UNIX for Dummies Questions & Answers

FTP user access

I created a user which I would like to have access only to FTP. I am able to get FTP to the machine with that user, but I only want him to have access to two directories, and no shell access. How can I accomplish this? Thanx, Aaron (1 Reply)
Discussion started by: Spetnik
1 Replies
Login or Register to Ask a Question