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
Humans Need Not Apply
Every human used to have to hunt or gather to survive. But humans are smart…ly lazy so we made tools to make our work easier. From sticks to plows, to tractors we’ve gone from everyone needing to make food to modern agriculture with almost no one needing …
I BOUGHT MY DREAM CAR!
Well guys, I finally did it! After years and years and years of literally, I’d, I’ve never owned my own car. After years of just riding a motorcycle and just bashing that around to get from A to B, and riding in the rain and all those horrible things, I …
Everest Weather - Data is in the Clouds | National Geographic
Everest is one of the most extreme environments on the planet, and nobody has ever fully quantified the climate conditions up there. We’re going to be pushing the envelope, attempting to install the highest weather station in the world to improve our unde…
Simulations and repetition | Intro to CS - Python | Khan Academy
I’m running a coin flip experiment and I want to find out how likely each outcome is: heads or tails. So I flip a coin once, twice, 100 times. Once I’ve repeated that experiment enough times, I see that about 50% of my flips are heads and 50% are tails. …
IPFS, CoinList, and the Filecoin ICO with Juan Benet and Dalton Caldwell
Hey, this is Craig Cannon, and you’re listening to Y Combinator’s podcast. Today’s episode is with Dalton Caldwell, who’s a partner at YC and Wamba Net, who’s the founder of Protocol Labs, a YC company that’s working on IPFS, Filecoin, and CoinList. If y…
What VCs Look for When Investing in Bio and Healthcare
Right, so welcome back. In this next panel features bio and Healthcare investors from Andreessen Horowitz, Coastal Adventures, and Ben Rock. They are some of the most respected firms out there. So, before we bring them up on stage, I wanted to introduce y…