Snap LXC only accepts commands via sudo (openSUSE host)

Continuing the discussion from Lxd via snap on openSUSE - lxd: command not found:

not 100% sure whether this is related but …

host: openSUSE 15.0
lxd: 3.6 (snap package)

I can not execute lxc commands without being sudo (I assume I’ll be creating priviledged containters likewise, which I prefer not to do).

any idea what can be done about this?

It could be a $PATH issue.
Are you familiar on how to check this?
Likely the path is only updated for root but not the users.

I suspected something along those lines. Never really got how to handle $PATH matters.
What I’ve noted is that the /snap/bin entry on my PATH` exists twice though

echo $PATH
/home/[username]/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin:/snap/bin:/snap/bin:/var/lib/snapd/snap/bin

however removing that duplicate (export PATH=/home/[username]/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin:/snap/bin:/var/lib/snapd/snap/bin) does not change anything.

the links in /snap/bin/ are rwxrwxrwx root:root, could this be the problem (even though everyone is rwx)? If so, what would be the correct way

On Ubuntu, the $PATH for the snaps is set in /etc/profile.d/apps-bin-path.sh.
Also, /etc/sudoers has a setting that adds /snap/bin to the secure_path of sudoers.

I do not know the details of the packaging for OpenSUSE, so you would need to check these manually.

To help you, here are the config files for Ubuntu,

$ cat apps-bin-path.sh 
# shellcheck shell=sh

# Expand $PATH to include the directory where snappy applications go.
snap_bin_path="/snap/bin"
if [ -n "${PATH##*${snap_bin_path}}" -a -n "${PATH##*${snap_bin_path}:*}" ]; then
    export PATH=$PATH:${snap_bin_path}
fi

# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
if [ -z "$XDG_DATA_DIRS" ]; then
    export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi

# Desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for
# snappy applications' desktop files.
snap_xdg_path="/var/lib/snapd/desktop"
if [ -n "${XDG_DATA_DIRS##*${snap_xdg_path}}" -a -n "${XDG_DATA_DIRS##*${snap_xdg_path}:*}" ]; then
    export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${snap_xdg_path}"
fi

And sudoers:

Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"