yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Edit, Add, And Delete Users With Terminal


3m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

Hey guys, this is Mads 101. Today I'm going to show you how to do a few things involving user accounts through Terminal. First of all, I'm going to be showing you how to add a user account in Terminal, and yes, I am logged in as root to do this.

First of all, you want to type dscl space dot space create space /users/ and then I'll make the username test. uid 701, sorry about that, spelled create wrong. Okay, I'll put this command along with the others I'm about to type in the description. You can change the uid to be any number you want; it has to be a unique number that no other user account has, so I'm going to make it 700.

Okay, you also want to type the GID, so you want to type the same thing, except replace GID and uid with GID. Okay, then you want to type instead of GID, whatever you want to type shell space /bin/bash. In this case, hit enter.

Let me think. Um, you want to get rid of shell and everything after shell, then you can type home. I'm going to do /users/test. Okay, then you want to type real name, and all of these commands I will put out in the description of this video. So don't try to get what I'm saying or try to look at the video; just do it this way.

Then real name space "test user". Close quote. Okay, and there's just one more thing we have to do. Okay, GID, I already did the GID. Um, passwd space backslash*, and we hit enter.

Okay, so now you want to type passwd space and then the username test new password, and I'll just make the password password. Okay, so now I've basically added the user called test. Here's all the code I've done to do this, and I'm zooming in, of course. But um, I will put all this code in the description of this video, and I will have a website with all this code, so you can just click the link in the description of this video to go to download the code. I've typed the exact terminal output.

Okay, so now what we want to do is basically make a new home folder for this user. So basically, you want to say, and this is pretty simple: cp -R "SL system/Library/ususer template/english.PR" then close quote. Then you want to type /users/ and then the username we created. I'll do test.

Okay, so now, in the login window, there will be a new user called test. Um, so basically now, what you want to do is you want to say chown and then the username colon the username again. I'll do test:test test:/users/test. Oops, sorry, okay. So right here, we've um, here's the actual command: chown test:sl user:test.

So now when we type su test, if we're not an admin, um then yeah. But basically, here's the default username test. So I'll just um, here's how to delete a user as well. You type ds space . space delete space /users/ and then the username test.

Okay, and that's deleted the user test. And um, so yeah, um here's also um how to, sorry, I just deleted the user test. How to grant a user administrator privileges. You want to type ds space . space merge space /groups/admin space users space and then the username. I'm going to make Mac heads 101 an admin.

Okay, so now Mac heads 101 is an administrator. Um, let me just test out this. Okay, so all this code will be in the description of this video, all the code I used to make the user test and to make a user basically not an administrator. Um, so this is pretty simple.

Okay, so now all you have to do is this code and it'll add, delete, or change users' passwords. I'll have all the code in the description of this video, so um just look at that code. Don't try to figure out what I said, just look at the code because it's more complicated than what I was talking about. So basically, just that's how to add a new user account on the computer.

So um, thank you for watching Mads 101, and subscribe, and goodbye!

More Articles

View All
What I Wish I Knew When I Was Younger
Welcome to beautiful Vancouver, British Columbia. This is actually where I grew up, just across that water. And I remember when I was a teenager here I wanted to be a film maker. And so what did I do? Well, I found a film director with a strange name who …
Why You Keep Failing At Self-Discipline
There’s a widely-held belief that self-discipline means being able to do something when you don’t actually want to do it. People who believe this think that self-discipline means going to the gym, reading books, or eating chicken and broccoli when you don…
Bobi Wine performs live in Central Park | National Geographic
Thank you. [Music] Thank you. Thank you. [Music] [Applause] [Music] Thank you. Foreign. [Music] [Applause] [Music] Thank you. [Music] Thank you. Foreign. [Music] [Applause] [Music] Foreign. [Music] Thank you. [Music] Thank you. [Music] Ladies and gentleme…
When Cities Were Cesspools of Disease | Nat Geo Explores
Imagine living in darkness. You’re in a roof the size of a closet with your entire family. I can’t see a thing, but you can hear and smell everything—every breath, every sneeze, every cough that hits your face. This is life in a 19th-century city. There’…
Ray Dalio & Bill Belichick on Picking People: Part 1
So, picking people, that’s what we’re on. Tell me about it. Well, I think that’s the number one thing, is to try to get it right on the way in the door. Um, and you know, understanding what you need, um, and what you’re looking for. So, um, as we like to…
Sam Altman's Method for Clear Thinking
Speaker: No, I’m a huge notetaker. Oh, tell me about that—there’s all these like fancy notebooks in the world, yeah, you don’t want those, um, you definitely want a spiral notebook because one thing that’s important is you can rip Pages out frequently, an…