forked from linux/documentation
118 lines
5.2 KiB
Markdown
118 lines
5.2 KiB
Markdown
# Remote Access with RDP
|
|
|
|
This guide shows how to access a Red Hat Enterprise Linux system with RDP.
|
|
|
|
## Configure RDP Remote Access
|
|
|
|
Ask your computer administrator to allow it (for details see the [configuration guide](../admin-guide/configuration/desktop/xrdp)
|
|
|
|
## Access from Windows
|
|
|
|
Start the `Remote Desktop Connection` tool:
|
|
|
|

|
|
|
|
First enter the destination host name you want to connect to, then adapt the user name for the logn. For this go to `Show Options`:
|
|
|
|

|
|
|
|
Enable the `Always ask for credentials` checkbox and remove the Windows domain part (`PSICH\`) from your login name:
|
|
|
|

|
|
|
|
Then press `Connect`. Now on the first time it will ask to accept the certificate of the device you try to connect to:
|
|
|
|

|
|
|
|
and finally you get to the login screen:
|
|
|
|

|
|
|
|
## Access from Linux
|
|
|
|
There is a number of GUI-clients like `Remmina`, `Vinagre` or `KRDC`, but it can also be connected from the terminal with `xfreerdp`:
|
|
|
|
```
|
|
xfreerdp /u:$USER /v:$REMOTE_RDP_SERVER /sec:tls +clipboard +fonts +bitmap-cache +glyph-cache /dynamic-resolution
|
|
```
|
|
Adapt `$USER` (not needed if the user is the same as on the client machine) and `$REMOTE_RDP_SERVER` as required.
|
|
|
|
The keyboard layout can be set by an additional parameter `/kbd:0x0409` (US) or `/kbd:0x0807` (Swiss German).
|
|
|
|
If you connect to an real desktop session (see "Access Existing Desktop Session" below) I recommend to remove the `/dynamic-resolution` parameter.
|
|
|
|
Also here you need to accept the certificate on first connect.
|
|
|
|
## Virtual Remote Session
|
|
|
|
The default option when you connect is `remote session (new or existing)` which will create a new virtual desktop session or attach again to an existing one.
|
|
|
|
Note that if there is already a local desktop session, it is not possible to create a virtual desktop session and the connection will simply close without error message when this is tried.
|
|
|
|
## Access Existing Desktop Session
|
|
|
|
This will give access to the desktop session which is running on the local screen. But this does not work automatically, that needs a bit of preparation. To be able to connect, the desktop session needs to be accessible with VNC on port 5900.
|
|
|
|
### Gnome Desktop Sharing
|
|
A user-friendly way to achieve this is to use the Gnome Desktop Sharing feature. But you need to prepare that while working locally connected on the real attached screen and keyboard.
|
|
|
|
Open the `Settings` tool and therein `Sharing`:
|
|
|
|

|
|
|
|
and then click on `Screen Sharing`:
|
|
|
|

|
|
|
|
Then switch to `ON` on the top, set `require a password` and set a password. There are only 8 characters allowed. But it is important else everyone with access to your RDP port can access also the session.
|
|
|
|
When connecting with RDP, then select on the login screen `local desktop session (existing only)` and enter the password you set before:
|
|
|
|

|
|
|
|
|
|
### `x11vnc`
|
|
|
|
Another option is to use `x11vnc` to share the desktop. This tool is run from the terminal and can be used to share also other desktop environments like XFCE or KDE. It can also be started on demand from remote if an `ssh` connection to the host can be established. It will use your normal password to authenticate the connection.
|
|
|
|
The suggested way to start it is:
|
|
```
|
|
UNIXPW_DISABLE_SSL=1 x11vnc -extra_fbur 5 -forever -shared -loop -find -localhost -rfbport 5900 -unixpw $USER
|
|
```
|
|
and keep it running somewhere in the background as long as you need remote access.
|
|
|
|
When connecting with RDP, then select on the login screen `local desktop session (existing only)` go on without entering the password (it will be ignored):
|
|
|
|

|
|
|
|
|
|
Then you get to a login black screen where you need to hit the Enter key first:
|
|
|
|

|
|
|
|
Now it is possible to set your user name:
|
|
|
|

|
|
|
|
And after the normal password:
|
|
|
|

|
|
|
|
it authenticates and connects.
|
|
|
|
|
|
|
|
Note that `xvnc11` does not support non-US keyboard layouts very well. If you want to connect and use e.g. the Swiss German keyboard, it works best if you switch the desktop keyboard layout to English (there seams to be some double conversion in place ...).
|
|
|
|
## Tunnelling
|
|
|
|
You can easily tunnel an RDP connection via SSH. This can be done like this:
|
|
|
|
```bash
|
|
ssh -L 3389:x02da-vcons-test-01:3389 x02da-gw
|
|
```
|
|
|
|
Afterwards remember to point your RDP client to `localhost` instead of the remote host you specified with the -L statement.
|
|
|
|
This also works from Windows with a PowerShell. However usually you are not able to open a local port on 3389. So here you need to use a different port like the default RDP port.
|