03-01-2007
Try this...
Assuming that the <file_name> is an open file used by a process.
who | grep $(lsof <file_name> | sed -n '2,$p'| awk '{ print $3}'|uniq)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I want to execute a script - of different user from my script.
I have tried the su command
su - username -c "scriptname"
it works but asked for password.
Is there any way for supplying the password to it thru script, not interactively.
Or is there any other way to achieve the... (5 Replies)
Discussion started by: yeheyaansari
5 Replies
2. UNIX for Advanced & Expert Users
Hi,
I have a IP address of the target machine.Is there is any way to find out whether it is a unix box or windows box without logging into it?.
Regs
Anand (5 Replies)
Discussion started by: u449064
5 Replies
3. Shell Programming and Scripting
Hi,
i;m getting a hard time on how to have this kind of script.
1. ssh on another machine and check if a specific process is running and notify in there is a problem.
SOS!!!!!!!!!!!!!
:( (2 Replies)
Discussion started by: tungaw2004
2 Replies
4. UNIX for Advanced & Expert Users
Hi all, would like to find out how can i scp a file from user A in one host to user B in another host?
i know how to get it done if its from user A in machine 1 to user A in machine 2.
1)on machine 1, generate a key pair. put the private key in the .ssh directory.
2)put the public key in... (2 Replies)
Discussion started by: new2ss
2 Replies
5. Shell Programming and Scripting
Hi All,
I wanted to know if there is any way , in which a user could be identified. I need to diffrenciate between a root user and a root like user.
Thanks!
nua7 (4 Replies)
Discussion started by: nua7
4 Replies
6. Shell Programming and Scripting
I currently have a statistics gathering script i run on my Linux servers. One of the stat i gather is total memory in the machine. The script is all perl with the exception of gathering the memory for that i use the following command:
$ram = (`cat /proc/meminfo | grep "MemTotal" | awk... (1 Reply)
Discussion started by: insania
1 Replies
7. Shell Programming and Scripting
Hi everyone! I want to be able to send a signal to another machine on the same network, and have it trigger a script on that machine. Here's the reason why I can't just ssh: I don't have a username on that machine, but there is a user that is always logged on that I can do stuff on.
So, I want... (5 Replies)
Discussion started by: declannalced
5 Replies
8. AIX
SOS Guys...
Is there any way to determine the user attributes, mainly if that userid is set as never expire?
I do not have admin rights, and I'm working on AIX 5.3
I've tried :
lsuser -f <username>
but no luck on that (2 Replies)
Discussion started by: freakygs
2 Replies
9. Cybersecurity
Please help me identify these user accounts..
bin, lp, nuucp, smbnull, mysql, tftp
Can we remove these user or disable these users?We have to apply the security policy about the user identification.Since it was settup by our vendor long time ago. We do not have these informations about these... (3 Replies)
Discussion started by: rdstkg
3 Replies
10. UNIX for Beginners Questions & Answers
Hi Team
I have created some time back a user called "iuser"
but I am not able to login with it. I am getting below error.
# su - iuser
su: user iuser does not exist
tried to unlock the user still get same error
# pam_tally2 -u iuser -r
pam_tally2: pam_get_uid; no such user iuser... (7 Replies)
Discussion started by: scriptor
7 Replies
CHSH(1) User Commands CHSH(1)
NAME
chsh - change login shell
SYNOPSIS
chsh [options] [LOGIN]
DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change
the login shell for her own account; the superuser may change the login shell for any account.
OPTIONS
The options which apply to the chsh command are:
-h, --help
Display help message and exit.
-s, --shell SHELL
The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell.
If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new
value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks.
NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser,
and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh
in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell
back to its original value.
FILES
/etc/passwd
User account information.
/etc/shells
List of valid login shells.
/etc/login.defs
Shadow password suite configuration.
SEE ALSO
chfn(1), login.defs(5), passwd(5).
User Commands 06/24/2011 CHSH(1)