Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete user via terminal

I'm having some issues installing Postgres and have been trying a few different approaches. I eventually followed this approach which meant I had to run the following command in terminal...

sudo dscl . -create /Users/postgres UserShell /bin/sh
sudo dscl . -create /Users/postgres NFSHomeDirectory /Library/PostgreSQL

However, this did not resolve issue I'm having with installing Postgres.

I then attempted to added postgres users via system preference but ran into the error of "Name already used by another user". However I cannot see this users!

enter image description here.

How can I effectively delete the postgres user created in the above command? The goal is to add the users via system preferences instead.

I can see the hidden user by using this command:

dscl . -list /Users  
like image 452
Samuel Avatar asked Sep 18 '25 22:09

Samuel


1 Answers

I figured it out.

sudo /usr/bin/dscl . -delete "/Users/postgres"
like image 70
Samuel Avatar answered Sep 21 '25 17:09

Samuel