Visit Our UNIX and Linux User Community

Changing userID and Changing group and GID

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Changing userID and Changing group and GID
# 1  
Old 04-18-2007
Changing userID and Changing group and GID


I want to write a ksh script about changing UID and changing group with GID. There are multiple servers i want to perform that job.

linux5 ......

1.) How can i enter "password" in script rather asking me?

I was trying this...

ssh csmith@linux

echo 'PASSWD="xxxxx"'

2) The above job has to perform on root level how can i have machine enter su - and it password?


su -

echo 'PASSWD="xxxxx"'

# 2  
Old 04-18-2007
If you absolutely must do this thing using PASSWD, then there is no way around using expect. Programs like su won't allow you to supply the password with something as simple as input redirection.
# 3  
Old 04-18-2007
is it possible on the password prompt i enter a password by my self? then it perform other commands.


Previous Thread | Next Thread
Test Your Knowledge in Computers #813
Difficulty: Medium
The CSS RGBA alpha parameter defines the opacity as a number between 1.0 (fully transparent) and 0.0 (fully opaque).
True or False?

10 More Discussions You Might Find Interesting

1. Red Hat

Can't chgrp. Error - chgrp: changing group of `<file>': Invalid argument

I found that I cannot chgrp for some reason with error: chgrp: changing group of `<file>': Invalid argument This happens on all NFS mounted disks on client machines. We use AD (not my call) for authentication and it also provides groups. We have a NFS server running Scientific Linux 6.3... (1 Reply)
Discussion started by: venmx
1 Replies

2. Shell Programming and Scripting

perl :Changing script to only find the group

Hi scripting guru's I found this script on IBM's website and it seems to be really good only thing it gives off more info than i need. I was wondering if someone could help me modify it to only find a group instead of every user. (group is support) I believe i know how to add the line so it... (2 Replies)
Discussion started by: vpundit
2 Replies

3. Shell Programming and Scripting

changing uid,gid

Hi, I am new to scrippting need little help, I would like to change uid, gid of exisisting user, example User A current uid=1,gid=2 would like to change uid=4,gid=5 I know the command to change uid,gid but after changing I have to change permissions on folders also which are belonging... (3 Replies)
Discussion started by: manoj.solaris
3 Replies

4. UNIX for Dummies Questions & Answers

Changing rights without touching user and group?

Hello, I have a small problem and would be happy if someone could help me to find a solution: A machine ("server") makes backups of different computers ("clients") using rsync. Users and groups are keept, so that it's possible to copy them back to the client if required. The number of groups... (3 Replies)
Discussion started by: tracer
3 Replies

5. UNIX for Dummies Questions & Answers

Get the gid from a group name

Hi there, One can easily retrieve the uid from a username : id -u $username But how can we easily retrieve the gid from a group name? I mean is there a command without using sed? sed -nr "s/^$groupname:x:(+):.*/\1/p" /etc/group Thanks for your help Santiago (7 Replies)
Discussion started by: chebarbudo
7 Replies

6. UNIX for Dummies Questions & Answers

regarding changing ownership and group

i am able to change the mode using chmod and able to change permission. but i am not able to change group and ownership. getting as invalid can any one help me regarding this . (4 Replies)
Discussion started by: satheeshkr_cse
4 Replies

7. Solaris

Changing root group to group from other

Does any one know if changing root's group from “other” to “root” will cause any problems on a running system. Thanks (4 Replies)
Discussion started by: mjkroner
4 Replies

8. Filesystems, Disks and Memory

changing group ID

My current GID are all < 100, however I am having issues now with this. Does anyone know of a way to change all GID's to perhaps add 100, IE so GID now = 23 will = 123. I am running an NIS network so changing the table is easy , however finding all the files on all my filesystems and modifying... (4 Replies)
Discussion started by: frankkahle
4 Replies

9. UNIX for Advanced & Expert Users

File group ownership changing automatically

Hi everyone, Need help with an issue. The group ownership of files on my Solaris system is getting changed automatically. Could someone tell me the reason why? And how could I correct it? One more info- everytime the ownership changes, it changes to "x". Thanks :confused: (1 Reply)
Discussion started by: top_gun
1 Replies

10. UNIX for Dummies Questions & Answers

Changing the Effective Group ID

Here is my situation. On a RedHat 7.3 box, I have a user named jody. When I log in with jody and type in "id", I get the expected output: uid=1(jody) gid=1(jody) groups=1(jody), 510(test) However, I cannot figure which "id" option allows me to change the effective gid. I tried the options... (2 Replies)
Discussion started by: Jody
2 Replies

Featured Tech Videos