Solved

reset user password via cli

Posted on 2010-09-22
13
630 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:TokenHash
  • 7
  • 6
13 Comments
 
LVL 8

Expert Comment

by:nognew
ID: 33735688
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
 

Author Comment

by:TokenHash
ID: 33735792
ok show me the password to be 12345

but when I input it in vnc viewer, i get password incorrect
0
 

Author Comment

by:TokenHash
ID: 33735842
do i need to restart the vnc service?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 8

Expert Comment

by:nognew
ID: 33735957
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
 

Author Comment

by:TokenHash
ID: 33736019
newbie to cli

ip is correct

not sure how to restart the vnc via cli
0
 
LVL 8

Expert Comment

by:nognew
ID: 33736059
try that:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
0
 

Author Comment

by:TokenHash
ID: 33736240
:(

still no luck

0
 

Author Comment

by:TokenHash
ID: 33736278
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
 
LVL 8

Expert Comment

by:nognew
ID: 33736368
can you try somethnig like:
sudo passwd <username>
0
 
LVL 8

Accepted Solution

by:
nognew earned 500 total points
ID: 33736393
Actually try this:
pwpolicy -a pws_admin -u usertochange -setpassword newpassword
0
 

Author Comment

by:TokenHash
ID: 33741937
od:~ root# pwpolicy -a pws_admin -u jimbob -setpassword Pa55word
Password:
pws_admin is not a password server account.

error
0
 
LVL 8

Expert Comment

by:nognew
ID: 33741964
Hi!
you need to replace pws_admin with your pws_admin username I believe.
Cheers,
t

0
 

Author Closing Comment

by:TokenHash
ID: 33741996
Fantasic :)
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SUMMARY Enterprise backup in a heterogeneous network is a subject full of complications and restrictions. Issues such as filename & path structure, attributes and extended metadata always tend to complicate the subject to the extent where either …
We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question