OC-ADM-POLICY-ADD-SCC-TO-USER(1)
π oc adm policy add-scc-to-user
okay bestie, welcome to the oc adm policy add-scc-to-user page β this is from the Openshift CLI User Manuals and it's gonna be SO good, i promise π«Ά
β¨ NAME
oc adm policy add-scc-to-user β hand a security context constraint to users or to a service account. that's the whole vibe. π«
π SYNOPSIS
oc adm policy add-scc-to-user [OPTIONS]
πΈ DESCRIPTION
Add a security context constraint to users or a service account.
like... literally what it says. you got a security context constraint, you got some users (or a service account), and this command is the matchmaker π
π¦ OPTIONS
--allow-missing-template-keys=trueβ set this to true and any errors in templates (missing field or missing map key in the template) just get ignored, no drama. heads up tho: it only applies to golang and jsonpath output formats. periodt.--dry-run="none"β must be"none","server", or"client". if it's the client strategy, it only prints the object that would be sent β no sending, just peeking π. if it's the server strategy, it submits a server-side request without actually persisting the resource. no cap.-o,--output=""β the output format, bestie. one of:json,yaml,kyaml,name,go-template,go-template-file,template,templatefile,jsonpath,jsonpath-as-json,jsonpath-file.-z,--serviceaccount=[]β service account in the current namespace to use as a user. yup, the current namespace. π--show-managed-fields=falseβ if true, keep themanagedFieldswhen printing objects in JSON or YAML format.--template=""β template string, or path to a template file, used when you're doing-o=go-templateor-o=go-template-file. the template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. iykyk π§
π OPTIONS INHERITED FROM PARENT COMMANDS
these are the heirlooms, the hand-me-downs, the main character options you get for free π
--as=""β username to impersonate for the operation. can be a regular user or a service account in a namespace.--as-group=[]β group to impersonate for the operation. repeatable, so you can specify multiple groups fr fr.--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation. also repeatable, so you can specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β default cache directory. that path is not a typo, that's literally it π--certificate-authority=""β path to a cert file for the certificate authority.--client-certificate=""β path to a client certificate file for TLS.--client-key=""β path to a client key file for TLS.--cluster=""β the name of the kubeconfig cluster to use.--context=""β the name of the kubeconfig context to use.--disable-compression=falseβ if true, opt out of response compression for all requests to the server.--insecure-skip-tls-verify=falseβ if true, the server's certificate will not be checked for validity. β οΈ bestie this makes your HTTPS connections insecure, so like... know that going in.--kubeconfig=""β path to the kubeconfig file to use for CLI requests.--kuberc=""β path to the kuberc file to use for preferences. you can disable this by exporting theKUBECTL_KUBERC=falsefeature gate, or by turning off the feature withKUBERC=off.--match-server-version=falseβ require the server version to match the client version.-n,--namespace=""β if present, the namespace scope for this CLI request.--profile="none"β name of the profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex).--profile-output="profile.pprof"β name of the file to write the profile to.--request-timeout="0"β how long to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). a value of zero means don't timeout requests. give it zero and it'll wait forever, iconic but risky π-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. if it's not provided, the hostname used to contact the server is used.--token=""β bearer token for authentication to the API server.--user=""β the name of the kubeconfig user to use.--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code. stern but slay π
β EXAMPLE
# Add the 'restricted' security context constraint to user1 and user2
oc adm policy add-scc-to-user restricted user1 user2
# Add the 'privileged' security context constraint to serviceaccount1 in the current namespace
oc adm policy add-scc-to-user privileged -z serviceaccount1
see how clean that is?? two users, one line. service account, one -z. ate. π₯
π SEE ALSO
π HISTORY
June 2016, Ported from the Kubernetes man-doc generator.
okay that's the whole page bestie, you're officially educated π β¨ this was OpenShift / Openshift CLI User Manuals, dated June 2016 β now go add some security context constraints and be the main character of your cluster ππ«Ά
π¦ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms