You are not logged in.
From what I saw unshare needs to be executed as root...
% sudo unshare -n -- id
uid=0(root) gid=0(root) groups=0(root) ...
% unshare -n -- id
unshare: unshare failed: Operation not permitted
However, I would like to start an application as normal user because otherwise it saves all its files in the /root directory. Is there a way?
Last edited by ezzetabi (2015-11-19 13:29:06)
Offline
Please provide more details about what you want to do with noshare, maybe we can get misconceptions out of the way.
Offline
I want to execute a program as normal user unsharing the network namespace.
What misconceptions are you thinking?
Offline
Check this out (if "ezzetabi" is your username):
sudo unshare -n sudo -u ezzetabi bash -c 'echo Hello, my name is $USER; echo My home is $HOME; echo; echo Here is the output of "id":; id; echo; echo I can see these networks:; ip a'
Last edited by Ropid (2015-11-19 14:04:35)
Offline
I want to execute a program as normal user unsharing the network namespace.
What misconceptions are you thinking?
I was puzzled about somebody who knew enough about namespaces to have a use case for them didn't know about how to run a program as another user. Ropid provided a solution.
Last edited by Awebb (2015-11-19 14:20:39)
Offline