跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Linux] 关于 Linux 系统 uid、gid 及 mysql 部署的相关问题求解

发表于

求助各位大佬~

按照《 MySQL 8.0 安全部署指南》官方文档中给出的命令,为什么在创建用户和用户组的时候使用了以下命令

groupadd -g 27 -o -r mysql
useradd -M -N -g mysql -o -r -d datadir -s /bin/false -c "MySQL Server" -u 27 mysql

想问下为什么在创建用户组和用户的时候使用了非唯一 uid 和 gid ?比如本来有个用户组的 gid 已经是 27 了,不就不太好了吗?文件和目录权限可能会不安全?

一直不太理解 Linux 系统中,non-unique uid 和 gid 的使用场景是什么?

还有个问题是如果直接使用 useradd 命令创建用户的时候,如果不存在同名用户组,会自动创建一个同名的用户组。但有时候创建出来的 user 和 group 随机分配的 uid 和 gid 会不一样...而指定 uid 和 gid 时,因为无法知道系统中是否已经存在该 uid 和 gid ,可能会导致创建用户和组失败,是不是基于这个原因,使用了 non-unique uid 和 gid ?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.