From: "Thomaiyar, Richard Marian" <richard.marian.thomaiyar@linux.intel.com>
To: Joseph Reynolds <jrey@linux.ibm.com>,
openbmc <openbmc@lists.ozlabs.org>, Ed Tanous <ed@tanous.net>
Subject: Re: User-manager default group roles
Date: Tue, 17 Nov 2020 22:51:49 +0530 [thread overview]
Message-ID: <f22719fc-1851-eac9-50ee-fe95dace291a@linux.intel.com> (raw)
In-Reply-To: <8031d32c-9dd2-a72a-7751-8784fe9d2d99@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 2470 bytes --]
Hi Joseph,
For SSH to work fine, user must be part of priv-admin and must have
command/shell as /bin/sh under /etc/passwd file instead of /bin/nologin.
Note: There is no direct group called ssh under /etc/group, instead it
is just emulated one from phosphor-user-manager to add corresponding
shell binary to the user.
usermod --shell /bin/sh -G priv-admin ${USER}
If requirement is SSH to be allowed based on group and allowed for all
user privileges, then user shell can be updated using usermod --shell
/bin/sh itself, but need to remove EXTRA_ARGS from the dropbear.default
<https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-core/dropbear/dropbear/dropbear.default>
Regards,
Richard
On 11/17/2020 3:49 AM, Joseph Reynolds wrote:
>
> What is the right way to assign default phosphor-user-manager "group
> roles" to dynamically created users?
>
> Background: Currently, when a new local user is created via Redfish
> API POST /redfish/v1/AccountService/Accounts you have to specify a
> Redfish RoleId. BMCWeb maps the RoleId to a phosphor user manager
> "Privilege Role" [1] and assigns ALL of the "group roles" to the new
> user [2]. Per [3] this is not intended, and I need to fix this for my
> use case.
>
usermod --shell /bin/sh -G priv-admin ${USER} is the correct command for
per[3].
> IMHO, the correct approach is for the project to define a mapping from
> "role" to "privilege role" that can be used when dynamically creating
> a new user. For example, the admin role maps to "ssh ipmi redfish
> web" whereas the readonly role maps to "ipmi redfish web" (omits
> "ssh"). Then images can customize this as needed.
>
> But where should this mapping be applied? Does it belong in BMCWeb or
> in phosphor-user-manager [4]? Should we have another D-Bus property
> [5] to give this mapping?
As of today, we are not separating user groups. All users created in
OpenBMC belongs to the build time configured groups.
>
> - Joseph
>
> [1]:
> https://github.com/openbmc/docs/blob/master/architecture/user-management.md
> [2]:
> https://github.com/openbmc/bmcweb/blob/929d4b57f10bc4200e16b71fbcf32521d8cc23c1/redfish-core/lib/account_service.hpp#L1435
> [3]: https://github.com/openbmc/openbmc/issues/3643
> [4]:
> https://github.com/openbmc/phosphor-user-manager/blob/master/user_mgr.hpp
> [5]:
> https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/User/Manager.interface.yaml
>
[-- Attachment #2: Type: text/html, Size: 4014 bytes --]
next prev parent reply other threads:[~2020-11-17 17:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 22:19 User-manager default group roles Joseph Reynolds
2020-11-17 17:21 ` Thomaiyar, Richard Marian [this message]
2020-11-17 19:17 ` Joseph Reynolds
2020-11-18 7:11 ` Thomaiyar, Richard Marian
2020-11-18 16:53 ` Joseph Reynolds
2020-11-19 11:49 ` Thomaiyar, Richard Marian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f22719fc-1851-eac9-50ee-fe95dace291a@linux.intel.com \
--to=richard.marian.thomaiyar@linux.intel.com \
--cc=ed@tanous.net \
--cc=jrey@linux.ibm.com \
--cc=openbmc@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.