[SOLVED] Cant ssh -X to Mint 20.1

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
deepakdeshp
Level 20
Level 20
Posts: 12333
Joined: Sun Aug 09, 2015 10:00 am

[SOLVED] Cant ssh -X to Mint 20.1

Post by deepakdeshp »

Hello
I wanted to open a GUI tool like gedit on a remote machine but I get error cannot open display. Any suggestions please.

Code: Select all

 ma@mint-18-uma ~ $ ssh -X ryzen
Warning: the ECDSA host key for 'ryzen' differs from the key for the IP address '192.168.1.20'
Offending key for IP in /home/uma/.ssh/known_hosts:31
Matching host key in /home/uma/.ssh/known_hosts:23
Are you sure you want to continue connecting (yes/no)? yes
uma@ryzen's password: 

14 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

Last login: Tue May  4 19:58:27 2021 from 192.168.1.10
Can't open display localhost:10.0
xgamma:  unable to open display 'localhost:10.0'
(base) uma@uma ~ $ gedit
Unable to init server: Could not connect: Connection refused

(gedit:13693): Gtk-WARNING **: 23:45:31.510: cannot open display: localhost:10.0
(base) uma@uma ~ $ 


  
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 5 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
deepakdeshp
Level 20
Level 20
Posts: 12333
Joined: Sun Aug 09, 2015 10:00 am

Re: Cant ssh -X to Mint 20.1

Post by deepakdeshp »

On guest and client in /etc/hosts
127.0.1.1 was defined as localhost. Changed it to 127.0.0.1 and it is working now.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
deepakdeshp
Level 20
Level 20
Posts: 12333
Joined: Sun Aug 09, 2015 10:00 am

Re: Cant ssh -X to Mint 20.1

Post by deepakdeshp »

I can open gedit on remote machine but not gparted.. Dont know why.

Code: Select all

 sudo gparted
Unit boot.mount does not exist, proceeding anyway.
Unit tmp.mount does not exist, proceeding anyway.
Unit var-run.mount does not exist, proceeding anyway.
X11 connection rejected because of wrong authentication.
Unable to init server: Could not connect: Connection refused

(gpartedbin:17125): Gtk-WARNING **: 00:12:43.374: cannot open display: localhost:11.0
  
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: Cant ssh -X to Mint 20.1

Post by altair4 »

Code: Select all

sudo -E gparted
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
deepakdeshp
Level 20
Level 20
Posts: 12333
Joined: Sun Aug 09, 2015 10:00 am

Re: Cant ssh -X to Mint 20.1

Post by deepakdeshp »

altair4 wrote: Fri May 07, 2021 3:03 pm

Code: Select all

sudo -E gparted
Thank you. That solved it .Man says that -E is for preserving the environment . Only for commands requiring sudo -E is required not otherwise. I wonder why is it so.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
Locked

Return to “Networking”