Methods to change root password on macOS Unix utilizing terminal


Get real time updates directly on you device, subscribe now.

I am a brand new consumer of macOS Unix operating on MacBook Professional and Mac mini server. I want to alter the password for root consumer account on macOS. How do I modify the basis password on macOS Unix utilizing command line choices?

Introduction – You’ll want to use the passwd command. It’s used to replace the consumer’s authentication token(s) i.e. password. Allow us to see tips on how to change the basis consumer password on macOS Unix.

Methods to change root password on macOS Unix

The process for altering the password of root is as follows:

First, log in to the macOS Unix server utilizing ssh or console or terminal appOpen a shell immediate/terminal app and sort the passwd command to alter root password in macOS UnixThe precise command to alter the password for root on macOS Unix is sudo passwd root

NOTE: Please word that mbp:~ vivek$ is my shell immediate. You’ll want to sort instructions after the $ immediate.

macOS Unix change root password command

I’m going to log in to my macOS based mostly mac mini server utilizing the ssh command:
ssh vivek@macmini-server
In case you are utilizing a macbook/MBP, simply open the terminal app. As soon as logged in enter the command passwd as follows:
mbp:~ vivek$ sudo passwd root
First it’s good to sort the password for vivek consumer. After that the passwd command asks for the brand new password, which you’ll have to enter two instances:
Changing root account passwords on an RHEL based systemAltering root account passwords on macOS
The following time you log in to a macOS Unix server/workstation, use the brand new password for root consumer.

Barely totally different process for altering passwords in macOS Unix terminal

One can use the next process too:
mbp:~ vivek$ ssh consumer@your-mbp-macmini
Grow to be a root consumer through the su command or sudo command:
your-mbp-macmini:~ vivek$ sudo -i
Lastly change your root consumer password:

Extra on passwd command

The passwd command modifications the consumer’s password. For instance, change your personal password utilizing the Terminal app, run:
To vary password for consumer named jerry, run:
sudo passwd jerry


This web page defined the method for altering the password of root consumer utilizing the passwd command on a macOS Unix system. For extra info see the passwd command man web page by typing the next man command:
man 1 passwd
man 5 passwd

Posted by: Vivek Gite

The writer is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a coach for the Linux working system/Unix shell scripting. Get the newest tutorials on SysAdmin, Linux/Unix and open supply matters through RSS/XML feed or weekly electronic mail publication.

Source link

Leave A Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More