Useful terminal commands for Mac OS X
As time passes with the speed of light I managed to prepare some new knowledge to share with you :) . Hope you like the new stuff and might want to share it with your friends and partners ;).
Today is the time to share some useful terminal commands for Mac OS X.
In order to use the commands you need to have opened the terminal under Mac OS X. The terminal application is like the CMD / command prompt in Windows OS versions – client or server ones ;).
In order to change the password you need to type this command and press enter:
dscl . – passwd /Users/<accountname> <oldpassword> <newpassword>
In order to join properly the AD (Active Directory) you need to have a correct time and date. Now you could ask why shall I care about this? It's very simple! Active Directory can't work correctly (or at all) if the clock is not synchronized around domain controllers/member machines.
Well, actually In order to so you can use this command and set the NTP server:
sudo systemsetup –setnetworktimeserver xxx.xxx.xxx.xxx
Please note when you use sudo command before any other you will need to have a local administrator’s password and for xxx.xxx.xxx.xxx – place the server’s IP address.
Assuming you use VNC to connect to your mac machine and need to set the VNC password. In such cases you can use this command:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart –configure –clientopts –setvnclegacy –vnclegacy yes –setvncpw –vncpwd [newpassword]
What command to use when you actually want to activate remote management? Well, you can type and use this:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart –activate
Assuming you have already joined your Mac in AD and want to add a user as local administrator on you mac. To do so use this command:
sudo dseditgroup –o edit –a domainname\\%username% -t user admin
Please note where domainname is your actual domain name and %username% the actual user.
In order to add a domain group as an administrator on the Mac:
sudo dseditgroup –o edit –a domainname\\%groupname% -t group admin. For example:
sudo dseditgroup –o edit –a domainname\\DesktopAdministrationGroup –t group admin
or sudo dseditgroup –o edit –a domainname\\”Enterprise Admins” –t group admin
Sometimes it happens that the permissions get corrupted. In order to fix this you can run the disk utility application with this helpful command:
diskutil repairPermissions “/”
If you use software for virtualization – Parallels and you want to remove any ghost virtual adapters these commands come handy:
prlsrvctl net del Shared
And prlsrvctl net del Host-Only
When it comes to improving the overall performance of your Mac you can use this command to set the automatic crash reporter to disabled:
defaults write com.apple.CrashReporter DialogType Server