[greengrass] What is the set password of ggc_user

0

system: Linux 22.04

set a core device: sudo -S -E java -Droot="/greengrass/v2" -Dlog.store=FILE -jar ./GreengrassInstaller/lib/Greengrass.jar --aws-region us-east-1 --thing-name $sn --thing-group-name *** --component-default-user ggc_user:ggc_group --provision true --setup-system-service true --deploy-dev-tools true

want to do: deploy a component that can copy the contents of the current component to the directory of another user on the device

blocking point: Error will be reported when copying directly without sudo:“permission deny” use sudo -S, error report: "Password input error"

question: What is the set password of "--component-default-user ggc_user:ggc_group"

asked a year ago583 views
1 Answer
2
Accepted Answer

Why are you using -S option for sudo? "read password from standard input"

Just run sudo -E <command>.

The sudo command that you are using will not be running as ggc_user, it will run as root.

I do not understand how your desire "deploy a component that can copy" relates to the problem that you are having. Based on the command that you provided, you haven't yet even installed Greengrass, is that right? So really your desire right now is just to install and provision Greengrass I believe.

To run a component as root, do not use sudo. Update your component recipe to specify RequiresPrivilege. https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html

For example

Lifecycle:
  Run:
    Script: cp a_to_b b
    RequiresPrivilege: true
AWS
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions