Home  >  Q&A  >  body text

linux - 一个uid可以对应多个用户名吗?

如果可以如何添加同一uid下的多个用户名?

迷茫迷茫2745 days ago1458

reply all(5)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 15:19:30

    useradd
    -u user number specifies the uid. If the -o option is also present, the uid of other users can be reused.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 15:19:30

    Isn’t this design unreasonable? Why does one uid need multiple users? If you want to design it as one account that can add sub-accounts, then the uid is still unique, and you need to add a pid, pointing to the uid of the parent account

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:19:30

    You should build a relationship table, one-to-many
    A table:
    id uid

    B table (relationship table):
    A.id userName(1,2...)

    reply
    0
  • 迷茫

    迷茫2017-04-17 15:19:30

    Yes, the kernel ultimately identifies the user based on uid.

    reply
    0
  • 阿神

    阿神2017-04-17 15:19:30

    Wouldn’t it be enough to set each username into a field, such as username1, username2...

    reply
    0
  • Cancelreply