Score:-1

Accessing /run/user/xxxx/gvfs

US flag

I am trying to read files from the gvfs directory as root user after I start an x server with sudo xinit ./myscript -- :1.

I keep getting permission denied error. I tried allowing other users and allowing root in /etc/fuse.conf, switching to a user with su user. They didn't work. It is a fresh install of Ubuntu 18.04.

Is there a way I can access the mounted devices as root user or can I log in as a user after xinit?

If I exec whoami, I still see root even aftersu user.

#!/bin/sh
su user &

whoami &

cd ../../run/user/1000

ls gvfs

It seems it is not possible to change users from a shell script. It is possible to run commands as another user with -c flag.

So just su user -c /path/to/script.py.

Score:1
US flag

Alternative to su user -c /path/to/script.py, is to disable auto mounting and use jmtpfs or similar tools to mount the device to another directory.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.