1 00:00:00,000 --> 00:00:10,120 In this video, you'll learn about remote access protocols. 2 00:00:10,120 --> 00:00:13,400 So X-Forwarding is a remote access protocol. 3 00:00:13,400 --> 00:00:19,440 Now the thing with this is that it is old, because X-Forwarding is only useful in X11 4 00:00:19,440 --> 00:00:20,440 based environments. 5 00:00:20,440 --> 00:00:25,000 In these environments, you could forward graphical applications remotely and show their screens 6 00:00:25,000 --> 00:00:30,600 on the current host using SSH minus UPSCORE-X, followed by the IP address and the name of 7 00:00:30,600 --> 00:00:33,680 the applications that you wanted to run. 8 00:00:33,680 --> 00:00:37,799 On Wayland, that doesn't work anymore, because Wayland doesn't include a built-in network 9 00:00:37,799 --> 00:00:39,119 protocol. 10 00:00:39,119 --> 00:00:43,639 And also for security reasons, it doesn't allow remote applications to draw screens 11 00:00:43,639 --> 00:00:45,680 on it by default. 12 00:00:45,680 --> 00:00:51,360 As a solution for backward compatibility, the XORG X11 server XWayland package can be 13 00:00:51,360 --> 00:00:56,480 installed on the local machine to provide a local X server within Wayland. 14 00:00:56,480 --> 00:01:00,639 Because without X server, there is no way that the graphical application can draw its 15 00:01:00,639 --> 00:01:02,599 screens. 16 00:01:02,599 --> 00:01:07,800 On the remote server, the XORG X11 XALT package needs to be installed to handle the forwarding 17 00:01:07,800 --> 00:01:09,620 correctly. 18 00:01:09,620 --> 00:01:15,279 And also ensure that in secure shell configuration, the options forward X11 is yes and forward 19 00:01:15,279 --> 00:01:20,400 X11 trusted is yes are set on the client as well as on the remote. 20 00:01:20,440 --> 00:01:26,320 Notice that X forwarding only works on applications that are developed for X11, and not for Wayland 21 00:01:26,320 --> 00:01:27,320 applications. 22 00:01:27,320 --> 00:01:31,000 And that means that depending on your distribution current configuration, you may have a hard 23 00:01:31,000 --> 00:01:34,000 time finding the right application. 24 00:01:34,000 --> 00:01:38,639 Some classical X11 applications are XICE and GNOME terminals, so that is what you could 25 00:01:38,639 --> 00:01:39,639 try. 26 00:01:39,639 --> 00:01:43,639 All right, I'm going to show you how to forward graphical sessions. 27 00:01:43,639 --> 00:01:45,120 So I have two servers. 28 00:01:45,120 --> 00:01:46,120 One of them is remote. 29 00:01:46,120 --> 00:01:49,040 That's where the graphical application is installed. 30 00:01:49,040 --> 00:01:54,239 This is where you need dnf install XORG X11 server XWayland. 31 00:01:54,239 --> 00:01:58,040 That is going to install the X11 compatible server for Wayland. 32 00:01:58,040 --> 00:02:05,360 Next, you need to tweak sshd-config, the secure shell server configuration, with the parameter 33 00:02:05,360 --> 00:02:07,919 X11 forwarding yes. 34 00:02:07,919 --> 00:02:11,039 Don't forget to restart the sshd process. 35 00:02:11,039 --> 00:02:17,039 And then on local, you need to install XORG X11 XALT, because otherwise the remote client 36 00:02:17,039 --> 00:02:21,600 is not authorized to draw its screens on the local machine. 37 00:02:21,600 --> 00:02:30,339 Make sure you set forward X11 yes and forward X11 trusted also to yes in etc ssh ssh-config. 38 00:02:30,339 --> 00:02:36,720 And then from local, you can use ssh-y user at remote server GNOME calculator. 39 00:02:36,720 --> 00:02:42,119 To be considered, at the moment that I'm recording this, GNOME calculator is still an X11 compatible 40 00:02:42,119 --> 00:02:43,520 application. 41 00:02:43,520 --> 00:02:49,800 It is very important that you have an X11 compatible application and not a Wayland application, 42 00:02:49,800 --> 00:02:51,880 because they won't work. 43 00:02:51,880 --> 00:03:01,279 So here we have the remote server where I'm going to use sudo dnf install XORG-X11-server 44 00:03:01,279 --> 00:03:05,279 and XWayland. 45 00:03:05,279 --> 00:03:12,600 And next, I need to go into etc ssh sshd-config to apply. 46 00:03:12,600 --> 00:03:20,520 Then we need to tweak the sshd-config and make sure it has X11 forwarding set to yes. 47 00:03:20,520 --> 00:03:27,460 Now systemctl restart sshd to restart the ssh server, and we should be OK. 48 00:03:27,460 --> 00:03:29,880 So now we are on the local host. 49 00:03:29,880 --> 00:03:38,520 And on the local host, I need sudo dnf install XORG-X11-XALT, which is taking care of proper 50 00:03:38,559 --> 00:03:39,559 authentication. 51 00:03:42,759 --> 00:03:51,559 Next, I need to take care of the SSH client configuration in etc ssh ssh-config, not to be 52 00:03:51,559 --> 00:03:56,559 confused with sshd-config, which is for the server. 53 00:03:56,559 --> 00:04:00,320 And then we have forward X11. 54 00:04:00,320 --> 00:04:07,520 Well, forward X11 needs to be set to yes. 55 00:04:07,520 --> 00:04:21,399 Next, I also need forward X11 truss set is yes. 56 00:04:21,399 --> 00:04:26,760 And we don't have to install anything because it's the SSH client installation. 57 00:04:26,760 --> 00:04:37,480 I'm going to use ssh-y, student at remote, and let's use GNOME calculator. 58 00:04:37,480 --> 00:04:43,679 So I need to authenticate as user student, enter the password, and there we go. 59 00:04:43,679 --> 00:04:45,799 We can see the GNOME calculator. 60 00:04:45,799 --> 00:04:51,880 And that is how you forward graphical applications in the old X11 compatible way.