cannot connect to red-hat linux via putty x11

anshuma
anshuma used Ask the Experts™
on
Hi,

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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015
Commented:
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.
Distinguished Expert 2017
Commented:
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
Most Valuable Expert 2016

Commented:
Which X server / command are you trying to start? What is your goal besides enabling X forwarding?
Ensure you’re charging the right price for your IT

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

Top Expert 2015

Commented:
xauth is invoked when X11Forwarding works fine.
That line just confirms everything is well server side.
anshumaEngineering

Author

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
Distinguished Expert 2017

Commented:
What are you doing?
You can open xterm and then sudo.
Top Expert 2015

Commented:
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.
Top Expert 2015

Commented:
Why not A grade for explaining that there is no problem, it is just how Linux works?
anshumaEngineering

Author

Commented:
how can I revert to grade A. I was using my cell to close the question and might have fat fingered something

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial