Sponsored Content
Full Discussion: system wide password change
Top Forums Shell Programming and Scripting system wide password change Post 98329 by Perderabo on Tuesday 7th of February 2006 11:47:39 AM
Old 02-07-2006
You had several errors. You were working only with a lists of uid's. You cannot use uid with the passwd command like that as far as I know. The man page clearly states that it wants a user name, not a uid. "typeset=i" is probably an error, but I really don't know what that is supposed to be doing. You don't say what os you are using, but it looks like SunOS. If so you probably have some system uid's above 60k that should be left alone. It is mostly personal preference, but with a powerful shell like ksh, I don't like using cat to read a file nor awk to select a field. External programs like that do consume some resources. Here it wouldn't matter much, but in some scripts, it can save hours of time.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

links working system wide

I have created symbolic links to several frequently used commands, for example: "lt" is a link to "ls -ltrgo|tail". What can I do to make these links available system-wide, or at least in the directories my coworkers are in most of the time? I have copied the link to several directories, and... (6 Replies)
Discussion started by: jpprial
6 Replies

2. UNIX for Advanced & Expert Users

System wide CDE setup

Does anyone know how to make system wide changes to the CDE's front panel icons? I dont know if it matters but im running Solaris 9. THanks (1 Reply)
Discussion started by: meyersp
1 Replies

3. UNIX for Dummies Questions & Answers

FIND function - system wide

Hi, I have a task to search for a file called 'Xstartup' in the whole system because there might be different versions of it which overrite eachother. Can anyone suggest a smart command to run this search ? The machine needs to scan every single folder beginning from root. Please help, I am... (5 Replies)
Discussion started by: DGoubine
5 Replies

4. UNIX for Dummies Questions & Answers

Server wide password enforcement rules? 90 day force change.

Using Solaris 9 and 10. What we want to do is set up global rules for our password files to restrict all users, not only new ones set up with the rules but also the ones that have been sitting on the system for years. Is there a global way to force all users to change their password every 90... (1 Reply)
Discussion started by: LordJezo
1 Replies

5. HP-UX

System wide user thread limit. does that exists :?

Hi all, Is there any system wide limit on number of user threads. I only find nkthread as a tunable parameter,apart from the `per process limit`. (1 Reply)
Discussion started by: Krsh
1 Replies

6. Linux

System wide find and sort

Hi, I need to look for a config file (ldap.conf) and pick the latest modified file. `locate` tells me there are many ldap.conf's, some in /etc, /usr, /home, etc. Is there some way I can sort them by last modified time via bash? I was thinking maybe I could pipe the output of `locate` to `ls... (4 Replies)
Discussion started by: Housni
4 Replies

7. UNIX for Advanced & Expert Users

Declaring LD_PRELOAD system wide for dynamic loading

Dear Fellows; As being new to linux, i have tried to synamically load a custom library which overrides some system calls like conncet(), socket() etc.... for custom purposes. It works well, if declaring the environment path LD_PRELOAD and execution of the application to be override... (0 Replies)
Discussion started by: mzeeshan
0 Replies

8. UNIX for Dummies Questions & Answers

[GPG] System-wide public key?

We need to have many of our users all send encrypted files to a single FTP server. The problem, if I understand how encryption/decryption works (which I don't), is that each user would normally have their own private and public key. The other end needs to be able to decrypt the file(s) using a... (6 Replies)
Discussion started by: Totengraber
6 Replies

9. Red Hat

Changing system-wide for umask

Hi everybody, How can I change the default UMASK for non root users, e.g. I want the umask for every new created user will be 0044. Thanks (6 Replies)
Discussion started by: leo_ultra_leo
6 Replies

10. Shell Programming and Scripting

System-wide search

When looking for wherever a program or a filename appears in the system, a short scrip is "findinner" which another script calls with a long parameter list consisting of path names ending with ".sh" or ".menu". "findinner" looks like this: # If not .savenn file, show name and result of grep. #... (4 Replies)
Discussion started by: wbport
4 Replies
SETUID(1)						      General Commands Manual							 SETUID(1)

NAME
setuid - run a command with a different uid. SYNOPSIS
setuid username|uid command [ args ] DESCRIPTION
Setuid changes user id, then executes the specified command. Unlike some versions of su(1), this program doesn't ever ask for a password when executed with effective uid=root. This program doesn't change the environment; it only changes the uid and then uses execvp() to find the command in the path, and execute it. (If the command is a script, execvp() passes the command name to /bin/sh for processing.) For example, setuid some_user $SHELL can be used to start a shell running as another user. Setuid is useful inside scripts that are being run by a setuid-root user -- such as a script invoked with super, so that the script can execute some commands using the uid of the original user, instead of root. This allows unsafe commands (such as editors and pagers) to be used in a non-root mode inside a super script. For example, an operator with permission to modify a certain protected_file could use a super command that simply does: cp protected_file temp_file setuid $ORIG_USER ${EDITOR:-/bin/vi} temp_file cp temp_file protected_file (Note: don't use this example directly. If the temp_file can somehow be replaced by another user, as might be the case if it's kept in a temporary directory, there will be a race condition in the time between editing the temporary file and copying it back to the protected file.) AUTHOR
Will Deich local SETUID(1)
All times are GMT -4. The time now is 02:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy