On Fri, Aug 9, 2019, at 11:44 AM, Alex Jia wrote:
Hi Niranjan,
default access permission is 0600 on /run/podman/io.podman directory, so you can't use non-root user
to access this listening directory, but you may modify permission before starting io.podman.socket,
good luck!
Ah thanks, Since the container was started by non-root user, when i tried with sudo it failed
Unable to connect: CannotConnect
Probably because the root user doesn't see the container .
[root@ajia-rhel-8 ajia]# ls -lad /run/podman/io.podman
srw-------. 1 root root 0 Aug 9 01:42 /run/podman/io.podman
[root@ajia-rhel-8 ajia]# cat /usr/lib/systemd/system/io.podman.socket
[Unit]
Description=Podman Remote API Socket
Documentation=man:podman-varlink(1)
[Socket]
ListenStream=/run/podman/io.podman
SocketMode=0600
[Install]
WantedBy=sockets.target
Sincerely,
Alex Jia
When i tried to change the SocketMode to 0666
[root@mniranja ~]# cat /usr/lib/systemd/system/io.podman.socket
[Unit]
Description=Podman Remote API Socket
Documentation=man:podman-varlink(1)
[Socket]
ListenStream=/run/podman/io.podman
SocketMode=0666
[Install]
WantedBy=sockets.target
[root@mniranja ~]# ls -l /var/run/podman/io.podman
srw-rw-rw-. 1 root root 0 Aug 9 11:51 /var/run/podman/io.podman
Unable to connect: CannotConnect
(venv) [mniranja@mniranja ad]$ sudo systemctl status io.podman.socket
● io.podman.socket - Podman Remote API Socket
Loaded: loaded (/usr/lib/systemd/system/io.podman.socket; enabled; vendor preset: disabled)
Active: active (listening) since Fri 2019-08-09 11:51:21 IST; 1min 12s ago
Docs: man:podman-varlink(1)
Listen: /run/podman/io.podman (Stream)
(venv) [mniranja@mniranja ad]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
(venv) [mniranja@mniranja ad]$
Even after changing the permissions to 0666, as non root user i am still unable to use varlink to access the container. Any info on how i could use varlink as non root user to access containers created using non-root user.