Connect to a Windows server over RDP
Connect to your Windows server with Remote Desktop (RDP) from Windows, macOS or Linux: credentials, certificate, security and fixes for common errors.
On this page
Your values
Enter them once and the commands in this guide update.
The Remote Desktop Protocol (RDP) displays your Windows server's desktop on your computer. You use it with your mouse and keyboard, as if the machine were in front of you.
By the end of this guide, you will be connected to your server from Windows, macOS or Linux, and you will know how to fix the most frequent errors.
Prerequisites
- A VPS or dedicated server running Windows Server, already installed. If it is not, follow Install Windows on a VPS, including the initial setup
- The server's IP address, the login and the password
- A computer running Windows, macOS or Linux
Step 1: find your connection details
They are in the email sent to the address of your HostMyServers account, in the Information de connexion (Connection information) section:
| Information | Example or location |
|---|---|
| IPv4 | Also shown in your client area, Vue générale (Overview) tab of the service |
| Login | For example Administrateur |
| Mot de passe (Password) | In the email |
| Port RDP (RDP port) | 3389 |
If you cannot find this email, check your spam folder, then open a ticket from your client area.
In this guide, replace YOUR_SERVER_IP with the IPv4 address and YOUR_USER with your login.
Step 2: connect
Follow the section that matches your computer.
From Windows
The Remote Desktop Connection app is already installed.
- Press
Windows+R, typemstsc, then confirm. - In Computer, enter
YOUR_SERVER_IP. - Click Show Options, then enter your login in User name.
- Click Connect and enter the password.
- If Windows suggests your local account, click More choices, then Use a different account.
You can also start the connection from PowerShell:
mstsc /v:YOUR_SERVER_IPIf the port has been changed, add it after the address, for example YOUR_SERVER_IP:3390.
From macOS
Microsoft provides Windows App, which replaces the former Microsoft Remote Desktop app.
- Install Windows App from the Mac App Store, then open it.
- In the Devices tab, click +, then Add PC.
- In PC Name, enter
YOUR_SERVER_IP. - Click Add.
- Double-click the server, then enter your login and password.
From Linux with Remmina
Remmina is a graphical application. On Debian or Ubuntu:
sudo apt install remmina remmina-plugin-rdp- Open Remmina and click + to create a profile.
- In Protocol, choose RDP.
- In Server, enter
YOUR_SERVER_IP:3389. - Fill in Username. If you leave Password empty, Remmina asks for it when connecting.
- Click Save, then double-click the profile.
From Linux with FreeRDP
FreeRDP runs from the command line. On Debian 13 or Ubuntu 24.04:
sudo apt install freerdp3-x11
xfreerdp3 /v:YOUR_SERVER_IP /u:YOUR_USER /cert:tofu /size:1600x900On Debian 12 or Ubuntu 22.04:
sudo apt install freerdp2-x11
xfreerdp /v:YOUR_SERVER_IP /u:YOUR_USER /cert:tofu /size:1600x900Enter the password when prompted rather than writing it in the command, where it would stay in your history. The /cert:tofu option accepts the certificate on the first connection, then refuses the connection if it changes.
Step 3: accept the certificate
On the first connection, a warning says that the server's identity cannot be verified. This is usual: by default, Windows Server uses a certificate it signed itself.
For a full check, compare the fingerprint displayed with the one on the server. On a VPS, read it from the NoVNC console. If your plan does not include this console, ask support how to obtain it.
- In your client area, open your service page and click the terminal-shaped icon at the top right.
- Choose NoVNC Console graphique (NoVNC graphical console), confirm with Ok, then click Connecter (Connect).
- Sign in, open PowerShell as administrator, then run:
Get-CimInstance -Namespace root\cimv2\TerminalServices -ClassName Win32_TSGeneralSetting | Select-Object TerminalName, SSLCertificateSHA1Hash- On Windows, in the warning, click View certificate, open the Details tab, then compare the Thumbprint field.
If the values match, accept the connection. Otherwise, refuse it and check the IP address.
Step 4: check the connection
The server's Windows desktop appears. Open PowerShell on the server and run:
whoami
hostname
query userThese commands display your account, the server name and the open sessions.
Closing the RDP window leaves your session open on the server, with your programs still running. To end it, open the Start menu, click your account, then Sign out.
Secure access
The RDP port is exposed to the Internet and attracts automated login attempts.
- Change the password you received by following Change a user password.
- Keep Network Level Authentication (NLA) enabled. It requires your credentials before a session is opened.
- Restrict the RDP port to your IP address, if it is static. Labels follow the server's language:
- On the server, press
Windows+R, typewf.msc, then confirm. - Open Inbound Rules.
- Double-click the Remote Desktop - User Mode (TCP-In) rule. On a French-language Windows, its name starts with Bureau à distance - Mode utilisateur.
- In the Scope tab, under Remote IP address, select These IP addresses, click Add, then enter
YOUR_IP. - Do the same for the UDP rule.
- On the server, press
Troubleshooting
Test the RDP port
Start with this test: it tells you whether the problem comes from the network or from the Windows session.
From Windows:
Test-NetConnection -ComputerName YOUR_SERVER_IP -Port 3389The line TcpTestSucceeded : True means that the port responds.
From macOS or Linux:
nc -vz YOUR_SERVER_IP 3389"Remote Desktop can't connect to the remote computer" or code 0x204
If the port test fails, check the following, in order:
- The IP address and port you entered.
- The server status in your client area.
- Your network: some corporate networks and public Wi-Fi block this port. Try from a mobile hotspot.
- The server itself, from the NoVNC console, in PowerShell opened as administrator:
qwinsta
Get-Service TermService
netstat -ano | findstr 3389The rdp-tcp line must be in the Listen state (Écouter on a French-language Windows), the service must be Running, and port 3389 must appear as listening.
If that is not the case, re-enable Remote Desktop and its firewall rules:
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0
Get-NetFirewallRule -DisplayGroup "Bureau à distance" | Set-NetFirewallRule -Enabled True
Restart-Service TermService -ForceOn an English-language Windows, the group is called Remote Desktop.
"Your credentials did not work"
- Retype the password by hand: one space copied by mistake is enough to get it rejected.
- Check your keyboard layout.
- If you changed the password, the one in the email is no longer valid.
- Indicate that this is a local account by writing the login as
.\Administrateur.
If Windows says the account is locked, wait before trying again, or sign in from the NoVNC console.
"An authentication error has occurred" with a mention of CredSSP
Your computer or the server is missing the CredSSP security updates. Install Windows updates on both sides, then restart. On the server, use the NoVNC console. Avoid disabling this protection.
The type of logon is restricted
If Windows says the system administrator has restricted the type of logon, the account you are using is not allowed to connect remotely. From an administrator session, add it to the Remote Desktop users group:
net localgroup "Utilisateurs du Bureau à distance" YOUR_USER /addOn an English-language Windows, the group is called Remote Desktop Users.
No Remote Desktop license server available
This message appears when the Remote Desktop Session Host role is installed without valid licenses. Connect with an administration session:
mstsc /v:YOUR_SERVER_IP /adminThen add the required licenses. If you do not need more than two simultaneous connections, you can remove this role.
Another session disconnects you
Without the Session Host role, Windows Server accepts two simultaneous remote connections, and a given account resumes its existing session. List the sessions, then close the one no longer in use, replacing 2 with its ID:
query user
logoff 2Unsaved work in that session will be lost.
The server shuts down by itself or reports an expired license
The instance may be at the end of its trial period. See Renew your Windows license.
The certificate warning appears again
This is expected after a reinstallation or a certificate change. In any other case, compare the fingerprint as in step 3 before accepting.
Contact support
If the problem persists, open a ticket from your client area. Include the server's IP address, the time of the attempt, the exact error message and the result of the port test, and never include a password.