# 如何在Discourse中手动添加用户？

**URL:** https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878
**Category:** Support
**Created:** [2017年九月12日 09:20 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878 "2017-09-12T09:20:23Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Jaka\_Permana](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jaka\_Permana](https://meta.discourse.org/u/Jaka_Permana)
#### Post date: [2017年九月12日 09:20 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/1 "2017-09-12T09:20:23Z")

</div>

how to create user in admin discourse ?  
plis help me, then answer step by step

thanks

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2017年九月12日 16:26 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/2 "2017-09-12T16:26:00Z")

</div>

Are you trying to add one user or one hundred?

# to invite a user

- Click your avatar,
- click gear,
- click invites
- type their email address or ou can invite a bunch of people with a CSV file

# Create an account

- log out
- create account (as the user would)
- log in as admin
- admin/users
- find the user
- activate

---

<div class="post-metadata">

### Author: ![Jaka\_Permana](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jaka\_Permana](https://meta.discourse.org/u/Jaka_Permana)
#### Post date: [2017年九月13日 01:27 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/3 "2017-09-13T01:27:06Z")

</div>

it’s working , thanks for information 👍👌

---

<div class="post-metadata">

### Author: ![consideRatio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/consideratio/32/126623_2.png) [@consideRatio](https://meta.discourse.org/u/consideRatio)
#### Post date: [2019年五月7日 12:31 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/4 "2019-05-07T12:31:33Z")

</div>

I want to create a user to act as a service account, but I’m using single sign on and would need to do quite a bit of work to actually get a service account from the underlying user provider there. In other words, I don’t know how to do the create an account step or invite step.

I understand I could create a new user by switching away from SSO for a while and then back, is that what I need to do or can I manage to create a user without doing this?

Perhaps there is a ruby related command I can run from the terminal of my virtual machine that has a /var/discourse folder with ./launcher etc in it.

Perhaps there is a SQL query I can run from somewhere?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年五月7日 12:51 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/5 "2019-05-07T12:51:42Z")

</div>

Then maybe what you want is

```
cd /var/discourse 
rake admin:create

```

In spite of the name, making the user an admin is optional.

Edit : oops left out enter app as noted below

---

<div class="post-metadata">

### Author: ![consideRatio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/consideratio/32/126623_2.png) [@consideRatio](https://meta.discourse.org/u/consideRatio)
#### Post date: [2019年五月7日 13:25 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/6 "2019-05-07T13:25:55Z")

</div>

Aha! Tank you for your help @pfaffman!

This is what I did for my docker-stacks installation that got “Command ‘rake’ not found” without adding some steps.

```plaintext
sudo -s
cd /var/discourse
./launcher enter app
rake admin:create

```

Tadaaaaaaaaa! Verified success!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年五月7日 14:33 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/7 "2019-05-07T14:33:20Z")

</div>

Oops! Sorry. I was poking on my phone before having coffee. 🙂

Glad it was enough to get you there.

---

<div class="post-metadata">

### Author: ![Martin\_Cash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin_cash/32/73218_2.png) [@Martin\_Cash](https://meta.discourse.org/u/Martin_Cash)
#### Post date: [2019年五月14日 19:34 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/9 "2019-05-14T19:34:49Z")

</div>

Has the method of inviting a single user from your User Preferences page (gear icon) changed? I see no reference to anything regarding an “invite” on that page. Thanks.

Nevermind. I see where invites are disabled with SSO

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2024年六月8日 12:37 UTC](https://meta.discourse.org/t/how-to-manually-add-user-in-discourse/69878/12 "2024-06-08T12:37:11Z")

</div>

该主题在 2461 天后自动关闭。不再允许回复。
