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
Misconceptions About Falling Objects
Now I want you to make a prediction: in my left hand I have a standard size basketball, and in my right hand a 5 kg medicine ball. If I drop them both at exactly the same time, which one will hit the ground first? Ah, this is a trick one, isn’t it? The h…
Marx: the Burden of What Has Been | Logan Lancing
When Mark says human beings are creative, he means we see something in the world, like a stick, and we’ve got a vision in our head of what we want to turn that stick into. We’ve got a vision in our head of what we want the world to look like. So maybe I …
Application of the fundamental laws (solve) | Electrical engineering | Khan Academy
So in the last video, we did our circuit analysis. We set up the four equations that we needed to solve in order to figure out all the voltages and currents in our example circuit. And so now we’re going to solve it. This is a matter of doing the algebra …
The Beginner's Guide To Stoic Travel
When studying the ancient scriptures, we discover a love-hate relationship between the Stoics and travel. So, is there a Stoic way to travel? And how can Stoicism benefit those who engage in traveling? In this video, I want to present you the beginner’s g…
Trudeau, Women, & Minorities: the Brutal Reality | Celina Caesar-Chavannes | EP 493
Hello everybody! So my wife and I are going back out on tour from my new book, “We Who Wrestle With God.” I’m going to be walking through a variety of biblical stories now. The postmodern types and the Neo-Marxists, they think the story is one of power an…
What Karl Marx Thought About Religion | Dr. Paul Kengor
Right now, you remember in, uh, when Christ is out in the desert and tempted by Satan after the 40 days of isolation after the baptism that the third Temptation of Satan, which is, I would say, the ultimate temptation, is one of power. Right now, it’s ver…