Passing password when changing the user account


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Passing password when changing the user account
Prev   Next
# 1  
Old 06-24-2010
Passing password when changing the user account

Hi All,

I have one requirment..

I need to change my id to some sudo account in a server.. Actually our username/passwd will be stored in one gip file like below...

$cat .a.gz #It's hidden file
username
passwd
$

So I tried the below script to pass the password when i sudo to another id.

Code:
 
#!/usr/bin/bash
 
id=`id | awk '{print $1}' | awk -F"(" '{print $2}' | tr -d ")" ""`
#Here, 'id' will give the user id.
gzcat /home/$id/.a.gz | tail -1 > /home/$id/passwd
chmod 700 /home/$id/passwd
sudo su vobadmin < /home/$id/passwd


When i try this script, i got below error

Code:
Invoking "/usr/bin/pbrun su vobadmin" for you
You need to authenticate yourself. Running kinit...
Password for illindva@SWISSBANK.COM:
kinit(v5): Password incorrect while getting initial credentials
You did not kinit successfully.

Can anyone please advice on this issue?

Please let me know if you need any more details on this to resolve.

Thanks in advance.

Regards,
VRN

Last edited by pludi; 06-25-2010 at 02:29 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

block user account after failed password

hi guys I have Centos 5.4 The idea is lock the user account for 3 minutes after he has entered his password incorrectly 3 times. I've modified /etc/pam.d/system-auth auth required pam_tally.so onerr=fail per_user deny=3 account required pam_tally.so resetbesides... (3 Replies)
Discussion started by: kopper
3 Replies

2. Shell Programming and Scripting

Create new user account and password in shell script

I am trying to create a shell script that will: check if a specific user already exists if not, create a specific group and create the user in that group assign a password to that user, where the password is passed in as a parameter to the script The problem that I need help with is 3 on... (4 Replies)
Discussion started by: killuane
4 Replies

3. Solaris

Solaris user changing password

i created 1 user . Now its passwd time period get expired. Now how can I set password for that user. Also how can I set a condition such a way that after every 3 months user must change his passwd. (5 Replies)
Discussion started by: ajitkraj
5 Replies

4. Linux

Problem changing user password

Hi all, I'm having an issue resetting an Linux user password. As root, I type 'passwd <username>, enter the new password, but the user is still Access Denied. Can someone assist me in figuring this one out? The box is running "Linux trm62 2.4.21-15.ELsmp #1 SMP Thu Apr 22 00:18:24 EDT 2004... (6 Replies)
Discussion started by: bbbngowc
6 Replies

5. Debian

password less login to root from a user account

hello friends, one user is created named "user1" I login as "user1" . Now when i do "su -" to be root user I have to give password for root . Is there any way through which we can skip giving the password to root. i.e. user1@work:~$ su - Password: xxxxxx work:~$ I don't want that... (1 Reply)
Discussion started by: pradeepreddy
1 Replies

6. AIX

changing unix user password using script

Hi sir, i need help in scripting.. i have 30 users like below eda01 eda02 eda03 eda04 ..... ...... eda30 I want to reset all users password start with eda01 until eda30 to default password 1234 how do i do this using script, i dunt want system prompt me for password.. i am... (5 Replies)
Discussion started by: mani_um
5 Replies

7. AIX

changing user password

I have 02 servers: - Linux RHEL AS 3 (server1) - AIX 5.2 (server2) Running the command rsh server2 passwd derje from the server1 to change derje user password on server2, give me this error: 3004-709 Error while changing the password for "derje" Can somebody help me ? (0 Replies)
Discussion started by: mayge
0 Replies

8. Solaris

how can I change user name and password , of account ?

passwd only changes the password but i need to change the user name tnx (5 Replies)
Discussion started by: umen
5 Replies
Login or Register to Ask a Question