Permanently adding Xhost as root

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
0
down vote

favorite












I'm a newbie Ubuntu user. Every time I log in to my OS, I always add:



xhost +si:localuser:root


How can I add Xhost to root permanently?



My kernel version is 4.13.0-46-generic.



I have tried this suggestion on the Arch wiki, to edit something in /etc/pam.d/..., but this doesn't work for me.







share|improve this question

















  • 2




    Please explain why you believe you need this. In modern Ubuntu this is not the best method as it is insecure and exploitable. There are probably better methods to get done what you want. And the xhost command does not need to be run as root since you are the owner of the X session. Still bad but a lot better would be to do this: xhost + && sudo gedit && xhost - you achieve the same for a limited amount of time.
    – Rinzwind
    10 hours ago











  • @Rinzwind i think your right about insecure and exploitable, but i always need it every time to edit .txt. if i do "xhost + && sudo gedit && xhost -" it's just one time to edit .txt.
    – abu-ahmed al-khatiri
    9 hours ago






  • 1




    Why do you believe you need to use xhost to edit text files? If you own it vim file.txt otherwise sudo vim file.txt. You do not want to use graphical tools to edit txt files from command line since those also tend to change ownership. If you don't like vim, use nano :)
    – Rinzwind
    9 hours ago






  • 1




    Not a good idea but see askubuntu.com/questions/961967/…. nano is easier for most new users than vim. sudo nano text.file
    – Panther
    9 hours ago







  • 1




    Possible duplicate of Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?
    – N0rbert
    9 hours ago
















up vote
0
down vote

favorite












I'm a newbie Ubuntu user. Every time I log in to my OS, I always add:



xhost +si:localuser:root


How can I add Xhost to root permanently?



My kernel version is 4.13.0-46-generic.



I have tried this suggestion on the Arch wiki, to edit something in /etc/pam.d/..., but this doesn't work for me.







share|improve this question

















  • 2




    Please explain why you believe you need this. In modern Ubuntu this is not the best method as it is insecure and exploitable. There are probably better methods to get done what you want. And the xhost command does not need to be run as root since you are the owner of the X session. Still bad but a lot better would be to do this: xhost + && sudo gedit && xhost - you achieve the same for a limited amount of time.
    – Rinzwind
    10 hours ago











  • @Rinzwind i think your right about insecure and exploitable, but i always need it every time to edit .txt. if i do "xhost + && sudo gedit && xhost -" it's just one time to edit .txt.
    – abu-ahmed al-khatiri
    9 hours ago






  • 1




    Why do you believe you need to use xhost to edit text files? If you own it vim file.txt otherwise sudo vim file.txt. You do not want to use graphical tools to edit txt files from command line since those also tend to change ownership. If you don't like vim, use nano :)
    – Rinzwind
    9 hours ago






  • 1




    Not a good idea but see askubuntu.com/questions/961967/…. nano is easier for most new users than vim. sudo nano text.file
    – Panther
    9 hours ago







  • 1




    Possible duplicate of Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?
    – N0rbert
    9 hours ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm a newbie Ubuntu user. Every time I log in to my OS, I always add:



xhost +si:localuser:root


How can I add Xhost to root permanently?



My kernel version is 4.13.0-46-generic.



I have tried this suggestion on the Arch wiki, to edit something in /etc/pam.d/..., but this doesn't work for me.







share|improve this question













I'm a newbie Ubuntu user. Every time I log in to my OS, I always add:



xhost +si:localuser:root


How can I add Xhost to root permanently?



My kernel version is 4.13.0-46-generic.



I have tried this suggestion on the Arch wiki, to edit something in /etc/pam.d/..., but this doesn't work for me.









share|improve this question












share|improve this question




share|improve this question








edited 3 hours ago









Zanna

47.5k13115226




47.5k13115226









asked 11 hours ago









abu-ahmed al-khatiri

43




43







  • 2




    Please explain why you believe you need this. In modern Ubuntu this is not the best method as it is insecure and exploitable. There are probably better methods to get done what you want. And the xhost command does not need to be run as root since you are the owner of the X session. Still bad but a lot better would be to do this: xhost + && sudo gedit && xhost - you achieve the same for a limited amount of time.
    – Rinzwind
    10 hours ago











  • @Rinzwind i think your right about insecure and exploitable, but i always need it every time to edit .txt. if i do "xhost + && sudo gedit && xhost -" it's just one time to edit .txt.
    – abu-ahmed al-khatiri
    9 hours ago






  • 1




    Why do you believe you need to use xhost to edit text files? If you own it vim file.txt otherwise sudo vim file.txt. You do not want to use graphical tools to edit txt files from command line since those also tend to change ownership. If you don't like vim, use nano :)
    – Rinzwind
    9 hours ago






  • 1




    Not a good idea but see askubuntu.com/questions/961967/…. nano is easier for most new users than vim. sudo nano text.file
    – Panther
    9 hours ago







  • 1




    Possible duplicate of Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?
    – N0rbert
    9 hours ago












  • 2




    Please explain why you believe you need this. In modern Ubuntu this is not the best method as it is insecure and exploitable. There are probably better methods to get done what you want. And the xhost command does not need to be run as root since you are the owner of the X session. Still bad but a lot better would be to do this: xhost + && sudo gedit && xhost - you achieve the same for a limited amount of time.
    – Rinzwind
    10 hours ago











  • @Rinzwind i think your right about insecure and exploitable, but i always need it every time to edit .txt. if i do "xhost + && sudo gedit && xhost -" it's just one time to edit .txt.
    – abu-ahmed al-khatiri
    9 hours ago






  • 1




    Why do you believe you need to use xhost to edit text files? If you own it vim file.txt otherwise sudo vim file.txt. You do not want to use graphical tools to edit txt files from command line since those also tend to change ownership. If you don't like vim, use nano :)
    – Rinzwind
    9 hours ago






  • 1




    Not a good idea but see askubuntu.com/questions/961967/…. nano is easier for most new users than vim. sudo nano text.file
    – Panther
    9 hours ago







  • 1




    Possible duplicate of Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?
    – N0rbert
    9 hours ago







2




2




Please explain why you believe you need this. In modern Ubuntu this is not the best method as it is insecure and exploitable. There are probably better methods to get done what you want. And the xhost command does not need to be run as root since you are the owner of the X session. Still bad but a lot better would be to do this: xhost + && sudo gedit && xhost - you achieve the same for a limited amount of time.
– Rinzwind
10 hours ago





Please explain why you believe you need this. In modern Ubuntu this is not the best method as it is insecure and exploitable. There are probably better methods to get done what you want. And the xhost command does not need to be run as root since you are the owner of the X session. Still bad but a lot better would be to do this: xhost + && sudo gedit && xhost - you achieve the same for a limited amount of time.
– Rinzwind
10 hours ago













@Rinzwind i think your right about insecure and exploitable, but i always need it every time to edit .txt. if i do "xhost + && sudo gedit && xhost -" it's just one time to edit .txt.
– abu-ahmed al-khatiri
9 hours ago




@Rinzwind i think your right about insecure and exploitable, but i always need it every time to edit .txt. if i do "xhost + && sudo gedit && xhost -" it's just one time to edit .txt.
– abu-ahmed al-khatiri
9 hours ago




1




1




Why do you believe you need to use xhost to edit text files? If you own it vim file.txt otherwise sudo vim file.txt. You do not want to use graphical tools to edit txt files from command line since those also tend to change ownership. If you don't like vim, use nano :)
– Rinzwind
9 hours ago




Why do you believe you need to use xhost to edit text files? If you own it vim file.txt otherwise sudo vim file.txt. You do not want to use graphical tools to edit txt files from command line since those also tend to change ownership. If you don't like vim, use nano :)
– Rinzwind
9 hours ago




1




1




Not a good idea but see askubuntu.com/questions/961967/…. nano is easier for most new users than vim. sudo nano text.file
– Panther
9 hours ago





Not a good idea but see askubuntu.com/questions/961967/…. nano is easier for most new users than vim. sudo nano text.file
– Panther
9 hours ago





1




1




Possible duplicate of Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?
– N0rbert
9 hours ago




Possible duplicate of Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland?
– N0rbert
9 hours ago















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062317%2fpermanently-adding-xhost-as-root%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062317%2fpermanently-adding-xhost-as-root%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491