LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I merged .Xauthority between my root and user accounts, not sure how to undo it. (https://www.linuxquestions.org/questions/linux-newbie-8/i-merged-xauthority-between-my-root-and-user-accounts-not-sure-how-to-undo-it-4175475769/)

slacker_ 09-03-2013 05:05 PM

I merged .Xauthority between my root and user accounts, not sure how to undo it.
 
So, I followed this:
Code:

echo $DISPLAY                  # you'll be needing this value 3 lines below
sudo -i                        # or "su -" on older Slackwares
xauth merge ~alien/.Xauthority # use your own username here instead of "alien"
export DISPLAY=:0.0            # use the value of DISPLAY you've seen 3 lines before

But I can't figure out how to unmerge them.

slacker_ 09-03-2013 10:28 PM

Update: checked a few things, discovered that .Xauthority in my user's directory is owned by root, and has no read, write, or executable permissions. I tried chown [my user] .Xauthority and it changed the ownership to myself, then sudo chmod -0755 .Xauthority and it didn't change anything. Changed to su, and ran it again, and it still didn't work. I'm back to square one.

jdkaye 09-04-2013 01:06 AM

I'm not clear what you are trying to accomplish and why you would want to share your .Xauthority with root. I hope it isn't to run your gui as root. Anyway, on my machine .Xauthority looks like this:
Code:

~$ ls -l .Xauthority
-rw------- 1 jdkaye jdkaye 168 set  2 09:11 .Xauthority

What does yours look like at the moment?
jdk

pan64 09-04-2013 01:28 AM

yes, probably there is a much better way to accomplish what do you really need.

slacker_ 09-04-2013 01:35 AM

Quote:

Originally Posted by jdkaye (Post 5021342)
I'm not clear what you are trying to accomplish and why you would want to share your .Xauthority with root. I hope it isn't to run your gui as root. Anyway, on my machine .Xauthority looks like this:
Code:

~$ ls -l .Xauthority
-rw------- 1 jdkaye jdkaye 168 set  2 09:11 .Xauthority

What does yours look like at the moment?
jdk

Mine looks like this:

Code:

~$ ls -l .Xauthority
---------- 1 slacker_ root 103 sep 2 10:54 .Xauthority

I think this means it's part of group root. I don't know how to adjust groups on individual files.

Quote:

Originally Posted by pan64 (Post 5021357)
yes, probably there is a much better way to accomplish what do you really need.

I'm building a new kernel, and according to the slackbook article I linked to in my first post, it was to allow launching of X applications from su.

unSpawn 09-04-2013 01:38 AM

Quote:

Originally Posted by slacker_ (Post 5021296)
sudo chmod -0755 .Xauthority and it didn't change anything.

What should that accomplish?..


Quote:

Originally Posted by slacker_ (Post 5021172)
I can't figure out how to unmerge them.

0) 'man xauth', # find out the options
1) 'xauth -f ~/.Xauthority list', # list contents
2) 'xauth -f ~/.Xauthority remove some.host.name:0', # remove entry for "some.host.name:0".

slacker_ 09-04-2013 01:48 AM

Quote:

Originally Posted by unSpawn (Post 5021366)
What should that accomplish?..



0) 'man xauth', # find out the options
1) 'xauth -f ~/.Xauthority list', # list contents
2) 'xauth -f ~/.Xauthority remove some.host.name:0', # remove entry for "some.host.name:0".

It was to apply read write execute permission for me, and read execute for all others. Honestly this is the first I've ever had to deal with these tools so I'm confused


step 1) didn't produce anything. I'm assuming it was supposed list the contents of the file.

unSpawn 09-04-2013 06:09 PM

Quote:

Originally Posted by slacker_ (Post 5021368)
It was to apply read write execute permission for me, and read execute for all others.

What I'm trying to convey is one shouldn't change perms unless one understands why and the implications of doing so. In this case nobody suggested it and besides it's an authorization database so it would never require exec perms in the first place.


Quote:

Originally Posted by slacker_ (Post 5021368)
step 1) didn't produce anything. I'm assuming it was supposed list the contents of the file.

OK. So what does this return:
Code:

stat ~/.Xauthority; strings ~/.Xauthority

slacker_ 09-04-2013 09:34 PM

Quote:

Originally Posted by unSpawn (Post 5021887)
What I'm trying to convey is one shouldn't change perms unless one understands why and the implications of doing so. In this case nobody suggested it and besides it's an authorization database so it would never require exec perms in the first place.

Well I suppose I should do deeper research before just following the guides and trying thinga. I didn't realize it didn't require perms.


Quote:

Originally Posted by unSpawn (Post 5021887)
OK. So what does this return:
Code:

stat ~/.Xauthority; strings ~/.Xauthority

stat .Xauthority returns
Code:

  File: '.Xauthority'
  Size: 103          Blocks: 8          IO Blocks: 4096    regular file
Device: 801h/2049d    Inode: 1333802    Links: 1
Access: (0000/----------)  Uid: ( 1000/      ra)  Gid: (    0/    root)
Access: 2013-09-04 02:39:29.000000000 +0400
Modify: 2013-09-02 10:54:00.000000000 +0400
Change: 2013-09-03 23:25:05.000000000 +0400
 Birth: -

and strings .Xauthority returns
Code:

        ra-laptop
MIT-MAGIC-COOKIE-1
MIT-MAGIC-COOKIE-1

Now what does this mean?

unSpawn 09-05-2013 01:03 PM

'stat' shows the file is still owned by group root instead of your user and has zero access perms instead of octal 0600. 'strings' shows two authorization cookies but only one hostname so that can't be right. Maybe it would be quicker to just generate a new file.

slacker_ 09-05-2013 05:21 PM

Quote:

Originally Posted by unSpawn (Post 5022487)
Maybe it would be quicker to just generate a new file.

And how would one do that?

John VV 09-05-2013 08:53 PM

as a normal user run
Code:

mv ~/.Xauthority ~/.Xauthority.old
reboot

or as root
Code:

mv /home/slacker_/.Xauthority /home/slacker_/.Xauthority.old
also you might want to remove that underscore from your user name
it might cause all kinds of problems

jpollard 09-05-2013 08:57 PM

Quote:

Originally Posted by John VV (Post 5022718)
Code:

mv ~/.Xauthority ~/.Xauthority.old
reboot


No need to reboot.

Just delete the file, logout, and login again. The GUI login will create another one.

And don't merge Xauthority files. You are far more likely to destroy the key you need to keep.

slacker_ 09-06-2013 02:47 AM

Quote:

Originally Posted by jpollard (Post 5022722)
No need to reboot.

Just delete the file, logout, and login again. The GUI login will create another one.

And don't merge Xauthority files. You are far more likely to destroy the key you need to keep.

Well ok then, thanks! I'll have to remember not to follow along to guides word for word then.

jdkaye 09-06-2013 03:25 AM

Quote:

Originally Posted by slacker_ (Post 5022881)
Well ok then, thanks! I'll have to remember not to follow along to guides word for word then.

Two factors about guides:
A. Their age. How recent is the guide?
B. There's more than one way to skin a potato.
jdk


All times are GMT -5. The time now is 07:36 PM.