Link to home
Start Free TrialLog in
Avatar of TokenHash
TokenHash

asked on

reset user password via cli

I have forgoten the VNC password but can log in via ssh.

1) How do I reset a user account password via CLI

2) How do I reset the VNC password and restart the vnc service

running tiger on an apple xserve
Avatar of nognew
nognew
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi there!
 try this:
To show existing password:
$ sudo cat /Library/Preferences/com.apple.VNCSettings.txt
7F513D02E4A8C5E2FF1C39567390ADCA
$ sudo cat /Library/Preferences/com.apple.VNCSettings.txt | perl -wne 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; chomp; @p = unpack "C*", pack "H*", $_; foreach (@k) { printf "%c", $_ ^ (shift @p || 0) }; print "\n"'
hello
$

Cheers,
t.
Avatar of TokenHash
TokenHash

ASKER

ok show me the password to be 12345

but when I input it in vnc viewer, i get password incorrect
do i need to restart the vnc service?
if you have changed the password recently you may try to restart the service. Are you sure you are connecting to the right VNC server (screen)? I have feeling this is some sort of user error here.
Cheesr,
t.
newbie to cli

ip is correct

not sure how to restart the vnc via cli
try that:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
:(

still no luck

or if you know how to view a list of user account in the workgroup manager ? and reset a users password in the workgroup? via cli
can you try somethnig like:
sudo passwd <username>
ASKER CERTIFIED SOLUTION
Avatar of nognew
nognew
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
od:~ root# pwpolicy -a pws_admin -u jimbob -setpassword Pa55word
Password:
pws_admin is not a password server account.

error
Hi!
you need to replace pws_admin with your pws_admin username I believe.
Cheers,
t

Fantasic :)