summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Sjölund <erik.sjolund@gmail.com>2022-03-07 20:23:33 +0100
committerErik Sjölund <erik.sjolund@gmail.com>2022-03-09 08:55:36 +0100
commitdb30102793e1c86e1295da929497f96f4b5e8278 (patch)
tree5c545bbf3eff9e2866c9432114fa019bcb2c2daf
parent2873f089f7de04cadc345f36bf405ae813a60765 (diff)
downloadpodman-db30102793e1c86e1295da929497f96f4b5e8278.tar.gz
podman-db30102793e1c86e1295da929497f96f4b5e8278.tar.bz2
podman-db30102793e1c86e1295da929497f96f4b5e8278.zip
[CI:DOCS] troubleshooting.md: mention "podman unshare chown 0:0 path"
* Mention the command "podman unshare chown 0:0 dir1/a" that changes file ownership to the regular user's UID and GID on the host. Co-authored-by: Tom Sweeney <tsweeney@redhat.com> Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
-rw-r--r--troubleshooting.md15
1 files changed, 9 insertions, 6 deletions
diff --git a/troubleshooting.md b/troubleshooting.md
index 93f716e00..32f14c1ee 100644
--- a/troubleshooting.md
+++ b/troubleshooting.md
@@ -991,12 +991,15 @@ less: dir1/a: Permission denied
#### Solution
-If you want to read or remove such a file, you can do so by entering a user namespace.
-Instead of running commands such as `less dir1/a` or `rm dir1/a`, you would need to
-prepend the command-line with `podman unshare`, i.e.,
-`podman unshare less dir1/a` or `podman unshare rm dir1/a`. To be able to use Bash
-features, such as variable expansion and globbing, you need to wrap the command with
-`bash -c`, e.g. `podman unshare bash -c 'ls $HOME/dir1/a*'`.
+If you want to read, chown, or remove such a file, enter a user
+namespace. Instead of running commands such as `less dir1/a` or `rm dir1/a`, you
+need to prepend the command-line with `podman unshare`, i.e.,
+`podman unshare less dir1/a` or `podman unshare rm dir1/a`. To change the ownership
+of the file _dir1/a_ to your regular user's UID and GID, run `podman unshare chown 0:0 dir1/a`.
+A file having the ownership _0:0_ in the user namespace is owned by the regular
+user on the host. To use Bash features, such as variable expansion and
+globbing, you need to wrap the command with `bash -c`, e.g.
+`podman unshare bash -c 'ls $HOME/dir1/a*'`.
Would it have been possible to run Podman in another way so that your regular
user would have become the owner of the file? Yes, you can use the options