0

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.

Zanna
  • 70,465
  • 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 Aug 04 '18 at 14:03
  • @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 Aug 04 '18 at 14:13
  • 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 Aug 04 '18 at 14:21
  • 1
    Not a good idea but see https://askubuntu.com/questions/961967/why-dont-gksu-gksudo-or-launching-a-graphical-application-with-sudo-work-with-w. nano is easier for most new users than vim. sudo nano text.file – Panther Aug 04 '18 at 14:23
  • @Rinzwind i'm not experience for vim and nano sir, like i do copy and paste. perhaps you have any tricks do it permanently sir? – abu-ahmed al-khatiri Aug 04 '18 at 14:24
  • @N0rbert I don't used gksu/gksudo sir, i have been try this for permanently Xhost, but this not works to me sir – abu-ahmed al-khatiri Aug 04 '18 at 15:10

0 Answers0