2022-06-25 11:35:23 +02:00
|
|
|
---
|
|
|
|
title: RDP
|
2022-11-19 15:25:20 +01:00
|
|
|
visible: true
|
2022-06-25 11:35:23 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
[toc]
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:35:23 +02:00
|
|
|
## Linux Server
|
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
`# apt install xrdp`
|
|
|
|
|
|
|
|
`# systemctl enable xrdp`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Put the desktop environment you want to start in `.xsession`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
_Example_
|
|
|
|
`xfce4-session`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
`# systemctl restart xrdp`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
### Change port
|
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Edit `/etc/xrdp/xrdp.ini`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Change the value of `port` to what you want
|
|
|
|
|
|
|
|
`# systemctl restart xrdp`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
## Windows Server
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:35:23 +02:00
|
|
|
### Windows Server Edition
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:35:23 +02:00
|
|
|
Go to `Local Server` in the Server manager.
|
|
|
|
There should be an option called `Remote Desktop`. Click on it and allow remote connections.
|
2023-02-23 14:48:51 +01:00
|
|
|
If you refresh the view now, `Remote Desktop` should show as enabled.
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
#### Allow unlimited RDP sessions
|
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Enter `gpedit` in the search bar
|
|
|
|
|
|
|
|
Go to `Administrative Templates>Windows Components>Remote Desktop Services>Remote Desktop Session Host>Connections`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Disable `Limit number of connections`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Disable `Restrict Remote Desktop Services users to a single Remote Desktop Services session`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Reboot the Server
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
### Windows Pro Edition
|
2023-02-23 14:48:51 +01:00
|
|
|
|
|
|
|
Go to `Remotedesktop` in the settings under `System`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
#### Change port
|
2023-02-23 14:48:51 +01:00
|
|
|
|
|
|
|
_PowerShell as admin_
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
Check port in use currently:
|
2023-02-23 14:48:51 +01:00
|
|
|
`Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber"`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
Change port:
|
2023-02-23 14:48:51 +01:00
|
|
|
`Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value (port)`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
Firewall exception:
|
2023-02-23 14:48:51 +01:00
|
|
|
`New-NetFirewallRule -DisplayName 'RDPPORTLatest' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort (port)`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Reboot the PC
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
## Linux Client
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:35:23 +02:00
|
|
|
### Installation
|
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Use Remmina as client and install freerdp to get support for RDP.
|
|
|
|
|
|
|
|
`# pacman -S remmina freerdp`
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
### Configuration
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:35:23 +02:00
|
|
|
Example configuration:
|
|
|
|
![rdp-linux-client-pic1-example.png](/rdp-linux-client-pic1-example.png)
|
|
|
|
|
|
|
|
#### Set different port
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:35:23 +02:00
|
|
|
![rdp-linux-client-pic2-port.png](/rdp-linux-client-pic2-port.png)
|
|
|
|
|
|
|
|
## Windows Client
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:35:23 +02:00
|
|
|
Enter `Remote Desktop Connection` in Windows search.
|
|
|
|
The target computer can be specified by IP or name
|
2023-02-23 14:48:51 +01:00
|
|
|
After clicking on `connect` the user will be asked to insert the username and password.
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
### Use different port
|
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
![rdp-winpro-client-pic1-example-port.png](/rdp-winpro-client-pic1-example-port.png)
|
2022-06-25 11:35:23 +02:00
|
|
|
|
|
|
|
## References
|
2023-02-23 14:48:51 +01:00
|
|
|
|
|
|
|
- [ArchWiki Remmina](https://wiki.archlinux.org/index.php/Remmina)
|
|
|
|
- [Azure RDP configuration](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/use-remote-desktop)
|
|
|
|
- [ArchWiki xrdp](https://wiki.archlinux.org/index.php/Xrdp)
|