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
TokenHashAsked:
Who is Participating?
 
nognewConnect With a Mentor Commented:
Actually try this:
pwpolicy -a pws_admin -u usertochange -setpassword newpassword
0
 
nognewCommented:
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.
0
 
TokenHashAuthor Commented:
ok show me the password to be 12345

but when I input it in vnc viewer, i get password incorrect
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
TokenHashAuthor Commented:
do i need to restart the vnc service?
0
 
nognewCommented:
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.
0
 
TokenHashAuthor Commented:
newbie to cli

ip is correct

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

still no luck

0
 
TokenHashAuthor Commented:
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
0
 
nognewCommented:
can you try somethnig like:
sudo passwd <username>
0
 
TokenHashAuthor Commented:
od:~ root# pwpolicy -a pws_admin -u jimbob -setpassword Pa55word
Password:
pws_admin is not a password server account.

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

0
 
TokenHashAuthor Commented:
Fantasic :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.