how to Remote Reset Password for User ?


 
Thread Tools Search this Thread
Operating Systems Solaris how to Remote Reset Password for User ?
# 1  
Old 07-29-2010
how to Remote Reset Password for User ?

Hello, everyone i have a little scenario and would like help ,
SCENARIO
OS : SunOS 5.10
Shell: KSH
UserName 1 connects to Server1 .He should run a little command or somthing to server2 that Resets the password of user2.
i have tried this :
Code:
 ssh user@server2 '/usr/local/bin/sudo passwd user2'

it doesn't work because of the permission, the user that i try to connect to the remote server hase permission of ALL in the SUDOERS on the remote server so when i connect directly to the server and do SUDO it works, remotly it does not

pleazzzz



if there is any other way to remote adduser and resetpassword it will also ok
just in KSH is required
# 2  
Old 07-29-2010
This should work :

Code:
ssh -t $loginuser@$target "/usr/local/bin/sudo passwd $targetuser"

Can you send the error message ?

Last edited by pludi; 07-29-2010 at 10:04 AM.. Reason: code tags, please...
# 3  
Old 08-02-2010
thanks alot m put somehow when i try the command with useradd instead of passwd it doesn't work.
Code:
#Alredy connected to Server1
read $serial
read $Name
ssh -t Username1@server2 '/usr/loca/bin/sudo useradd -u $serial -g 123456 -s /bin/tcsh -d /home/$Name $Name'

it gives to enter the password of the username1 to open session to SERVER2
but then give ERROR "Serial: Undefined Variable"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies

2. UNIX for Beginners Questions & Answers

Giving password reset access to non-root user, in LDAP

Hi, We have two LDAP servers. Whenever we get a ticket to reset the password, we login to LDAP primary server and reset the password. For below example, I logged into primary LDAP server and resetting password to john to Welcome123# We are giving this work to tier-1 team, so that they can reset... (1 Reply)
Discussion started by: ron323232
1 Replies

3. Red Hat

User password reset

Hello - I want to reset user password in multiple server via root ID. I have passwordless authentication for root between all the servers. I an use loop to reset the password. I am using below command in loop echo mypassword | passwd username --stdin However, if anyone sees history - he... (5 Replies)
Discussion started by: saurabh84g
5 Replies

4. UNIX for Dummies Questions & Answers

Need to reset password on remote host

I have access to a variety of hosts. I need to be able to reset my password on 400+ hosts every 80 days due to password expiration. I connect to these servers across the country using an ssh telnet terminal. I am a Security Administrator, but I don't manage the Unix machines on our network. Is... (1 Reply)
Discussion started by: XtremeRevolutio
1 Replies

5. UNIX for Dummies Questions & Answers

ssh to remote machine with 2nd user and password

Hi all, Really hope someone can help me, i have been trying lots of things and just cant seem to nail it - and for something that seems straight forward.... Anyway, scenario is I need to log onto a second machine (remote server) from main workstation. Once logged in I need to run a batch... (2 Replies)
Discussion started by: Hopper_no1
2 Replies

6. Shell Programming and Scripting

how to Remote Reset Password for User ?

Hello, everyone i have a little scenario and would like help , SCENARIO OS : SunOS 5.10 Shell: KSH UserName 1 connects to Server1 .He should run a little command or somthing to server2 that Resets the password of user2. i have tried this : ssh user@server2 '/usr/local/bin/sudo passwd... (0 Replies)
Discussion started by: shatztal
0 Replies

7. Shell Programming and Scripting

[SSH] Need to connect to remote server as different user and without password

I have a task requiring that USER_A run a script, which connects to HOST_B as USER_B and does not ask for a password. If I am logged in on HOST_A as USER_B, I can connect to HOST_B without a password, no problem. However, if I try running ssh with the command line "ssh USER_B@HOST_B" while... (3 Replies)
Discussion started by: Totengraber
3 Replies

8. Solaris

LDAP user password reset script

Hey all, I'm looking for a script to auto-generate a password for users that forget their password. Currently, we are using a perl script (with cgi-bin) where users update their password, but would like to add to this and make it so that the users can also request a password reset and a... (1 Reply)
Discussion started by: em23
1 Replies

9. Solaris

unable to reset user password

hi, i am unable to reset one of my server user password. whenever i make a "passwd username" i get the following error ======================================== New Password: Re-enter new Password: Permission denied ======================================== please advise.thanks... (6 Replies)
Discussion started by: cromohawk
6 Replies

10. Shell Programming and Scripting

Is it possible to write a script to reset user's password?

Is there anyway that I can reset user's password using a script/ssh command? ie. emulate passwd command with a default password of abc123 or even null value? > ssh server1 pwdadm user1 < /dev/null or > ssh server1 passwd user1 < /dev/null neither worked for me.. but you know what I... (1 Reply)
Discussion started by: pdtak
1 Replies
Login or Register to Ask a Question