|
|
||
.Xauthority—Day 45© Copyright Darrell Anderson. I found some helpful scripts written by somebody called The Geekster. The scripts are good only for Slackware and are available at www.linuxquestions.org. The three scripts enhance the Slackware package management system by providing command line information about Slackware packages. At this stage of my development the scripts are not something I use dialy, but I see value in the scripts. I tested them all on my box and they work great. To quote a popular computer writer, recommended! I am at a major crossroad in my migration journey. Although one never fully learns all there is to know about a ’nix operating environment, I nonetheless want to establish a reasonable foundation as I travel my way. At this point I need to investigate Thunderbird as my email client and also spend time tinkering with WINE so I can install Word 97. I have been tinkering with the latter, but thus far have been unfruitful. In between however, I have been busy and productive fine-tuning and tweaking my box. One of the problems I encountered after creating my mortal user account was trying to run X-based programs as root from within the mortal user’s login. For example, I am comfortable using Kate or KWrite to edit configuration files. Thus, I would open a command line shell, “su” to root and then run Kate or KWrite. This did not work. I am not going to listen or entertain counter arguments that I should never run X-based programs as root. I long ago in this journal declared that I have no use for priesthood jabber. This is my box, a personal computer, not a mission critical server. Yes, eventually one day I’ll learn how to use a console based editor, but for now I will use Kate or KWrite. The problem with running X-based programs in such a manner is X creates a security lock on that display session and will not allow others to use that display. That is all well and good, but Iknew from my aging Mandrake 9.2 setup that I could run X-based programs after su-ing to root. I hit the web once again. Many people in discussion groups recommended manually typing xhost + to termporarily unlocking the display session. Clunky. I also knew the solution was incorrect because for as many times as I found this solution, I also found warnings not to do this because of the potential security risk. Well, again, we’re talking about single personal computers but I nonetheless appreciated the priesthood warnings. Yet, the security is not what bothered me. I knew there had to be a better solution. Eventually, after a long hard search, I found a script that did what I wanted. I then looked at my Mandrake 9.2 configuration and found a similar script. Aha! Now I was on track! After comparing the two scripts I decided the Mandrake script made more sense for possible future growth in how I might use my system. So I copied /etc/profile.d/xhost.sh to the same location in my Slackware partition. I verified the file was executable. # Export Xauthority for users not for root. if [ ! -z "$DISPLAY" -a -z "$SSH_TTY" ];thenif [ "`id -u`" -gt 14 ];then if [ -z $XAUTHORITY ];then export XAUTHORITY=$HOME/.Xauthority fi fi fi I then exited X and manually deleted the .Xauthority files from my root and user accounts because experimenting with the xhost command had contaminated the files. I rebooted (I am not yet up to speed on how to restart various services without rebooting—I’m getting there, however!). I logged in with my mortal user account and su’d to root. I then ran Kate with no problem. Problem solved! I recommend the Slackware maintainer consider adding this script to the profile.d collection. Related to this adventure, I then added a Kicker icon to launch the KDE file manager as root. The tool is really nothing but an icon to launch Konqueror using the file mangement profile, but prepends the launch command with kdesu—the KDE super user command. When I lauch Konqueror in this manner I am prompted with a password dialog box and then Konqueror opens as though logged in as root. I can open configuration files from this single sessions and use Kate or KWrite to edit. I really like this simple additional tool! Of course, when I get in a bind and do not want to deal with root tasks in this manner, I merely open a second X session and log in as root. I love the true multi-user abilities of this environment. Oh, of course, I could care less what the priesthood has to say about logging into an X session as root! Finis. |
||