cannot connect to red-hat linux via putty x11


I need to get putty working with xforwarding I am getting the following error

Authenticating with public key "imported-openssh-key"
Last login: Sun Nov  1 17:14:22 2015 from -------------
/usr/bin/xauth:  file /home/myusername/.Xauthority does not exist
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

On the first log-in xauth creates key file.
It is not an error at all, just normal program output.
It is the same on *ANY* linux platform.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
does it give you the same message on the second login as gheist pointed out?
look at /etc/ssh/sshd_config to make sure X11Fordwarding is enabled there.
Gerwin Jansen, EE MVETopic Advisor Commented:
Which X server / command are you trying to start? What is your goal besides enabling X forwarding?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

xauth is invoked when X11Forwarding works fine.
That line just confirms everything is well server side.
anshumaEngineeringAuthor Commented:
my apologies this works fine when I am logged in as the user that connects from putty, it fails when I am logged in as root.

I have figured out the process of getting the magic cookie and sticking it and then getting root to work

How can this work automatically as soon as I do sudo
What are you doing?
You can open xterm and then sudo.
It does not work like you imagined.
Running X11 programs as root is very insecure.
You should read "sudoers" manual page on how to preserve $HOME over sudo.
Let me repeat - this venture is really insecure
And you should not automate anything in this regard ever.
Why not A grade for explaining that there is no problem, it is just how Linux works?
anshumaEngineeringAuthor Commented:
how can I revert to grade A. I was using my cell to close the question and might have fat fingered something
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.