Solved

reset user password via cli

Posted on 2010-09-22
13
633 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 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