How to Connect to Another Computer via Wi-Fi in Linux: 5 Working Methods

Remote control of a computer via Wi-Fi in Linux — a challenge faced by system administrators, developers, and even ordinary users who need access to files or programs on another device. Unlike Windows with its built-in RDPLinux offers a wider selection of protocols, but setting them up requires knowledge of the command line and networking features. This article covers all current connection methods, from the classic SSH to graphic solutions like VNC And RDP, and also tells how to avoid typical mistakes when working with Wi-Fi-networks.

The main difference between remote connection Wi-Fi from a wired connection - potential instability of the connection and the need to take into account the router settings (for example, NAT or firewall). We'll discuss how to ensure the security of transmitted data, which ports to open, and what to do if devices can't see each other on the local network. Particular attention will be paid to Debian/Ubuntu-based distributions And Arch Linux, but the principles apply to other systems as well.

If you need more than just transfer files (for this, SCP or SFTP), but rather work fully with a graphical interface or terminal on another PC—this guide will help you choose the optimal method. And for those who are afraid of the command line, we've prepared alternatives with graphical utilities.

1. Preparing the network: checking the connection and router settings

Before setting up a remote connection, make sure both computers are on the same network. Wi-Fi-networks and can "see" each other. This is a basic step that is often missed, causing subsequent connection attempts to fail.

To check the connection, use the command ping in the terminal. On the target computer (the one you'll be connecting to), run:

ip a

Remember its local IP address (For example, 192.168.1.105). Then, from another device on the same network, run:

ping 192.168.1.105

If the packets do not pass (100% packet loss), the problem may be in:

  • 🔌 Firewall on the target PC (check ufw or firewalld).
  • 📡 Router settings (function disabled AP Isolation?).
  • 🖥️ Power saving mode Wi-Fi adapter (especially relevant for laptops).

If the computers are on different subnets (for example, one is connected to the router via cable, the other via Wi-Fi with the other IP-range), adjustment may be required STATIC ARP or port forwarding. For home networks, it's easiest to use one router and disable guest Wi-Fi mode.

📊 Which protocol do you most often use for remote access?
SSH
VNC
RDP
TeamViewer/AnyDesk
Another

2. Method 1: Connecting via SSH (terminal)

SSH (Secure Shell) is the most reliable and secure way to remotely control Linux-machine over the network. It allows you to work with the terminal, transfer files, and even run graphical applications through X11 Forwarding.

To set up an SSH server on the target computer:

  1. Install the package openssh-server:
    sudo apt install openssh-server # For Debian/Ubuntu
    

    sudo pacman -S openssh # For Arch Linux

  2. Start the service and add it to startup:
    sudo systemctl enable --now ssh
  3. Check the status:
    sudo systemctl status ssh

Now connect from another computer using the command:

ssh username@192.168.1.105

Where username — the user name on the target PC, and 192.168.1.105 - his local IP.

If the connection fails, check:

  • 🔑 Correct password (or set it up SSH keys for secure login without a password).
  • 🚪 Port 22 must be opened in the firewall:
    sudo ufw allow 22
  • 🌐 If you're connecting from another network, set up port forwarding on your router.

The openssh-server package is installed.

SSH service started (systemctl status ssh)

Port 22 is open in the firewall

The IP address of the target PC is correct

-->

How to generate SSH keys for secure login?

On the client PC, run:

ssh-keygen -t ed25519

Copy the public key to the server:

ssh-copy-id username@192.168.1.105

Now you can log in without a password, which is convenient for scripts and automation.

3. Method 2: Graphical access via VNC

If you need not only a terminal, but also a full-fledged graphical interface (GNOME, KDE, XFCE), use VNC (Virtual Network Computing). This protocol transmits a screen image over a network, allowing remote desktop control.

For setup VNC servers on the target PC:

  1. Install tigervnc-standalone-server (or x11vnc for an existing session):
    sudo apt install tigervnc-standalone-server
  2. Run the server with permission 1920x1080 and color depth 24:
    vncserver -geometry 1920x1080 -depth 24

    When you first launch it, you will be asked to set a password (maximum 8 characters!).

  3. Connect from another PC using the client Remmina, TigerVNC Viewer or RealVNC, indicating IP:5901 (Where 5901 — the default port for the first desktop).

Important nuances:

  • 🖼️ VNC Without encryption, it is vulnerable to traffic interception. Use SSH tunnel:
    ssh -L 5901:localhost:5901 username@192.168.1.105

    Then connect to localhost:5901.

  • 🔄 For permanent access, add vncserver to startup (see systemd).
  • 🎨 If you use Wayland instead of X11, VNC may not work - will be required Xorg or alternatives like NoMachine.

4. Method 3: RDP (xrdp) for Windows compatibility

Protocol RDP (Remote Desktop Protocol) is more commonly associated with Windows, but in Linux it can be configured using xrdpThis is convenient if you need to connect to a Linux machine from Windows-client or vice versa.

Installation xrdp on the target PC:

sudo apt install xrdp

sudo systemctl enable --now xrdp

To connect with Windows use the standard application Remote Desktop Connection (mstsc), indicating IP- the address of the Linux machine. This will work for connecting from another Linux PC. Remmina (select protocol RDP).

Important: By default, xrdp uses port 3389, which is often blocked by ISPs. If the connection isn't working, check your firewall and router settings.

Protocol Port Encryption Graphics Difficulty of setup
SSH 22 ✅ Yes ❌ Terminal only (or X11 Forwarding) Low
VNC 5900+ ❌ No (if without an SSH tunnel) ✅ Full desktop Average
RDP (xrdp) 3389 ✅ Yes ✅ Full desktop High
NoMachine 4000 ✅ Yes ✅ Optimized for multimedia Low

5. Method 4: NoMachine - an alternative for multimedia

If you need not only to control a remote PC, but also to broadcast video, sound or 3D graphics (for example, for Blender or Gimp), standard VNC/RDP will slow down. In this case, it is better to use NoMachine — proprietary, but free for personal use software.

Installation on the target PC:

  1. Download .deb or .rpm-package with official website.
  2. Install it:
    sudo dpkg -i nomachine_*.deb # For Debian/Ubuntu
    

    sudo rpm -i nomachine_*.rpm # For Fedora/OpenSUSE

  3. Start the service:
    sudo /etc/NX/nxserver --startup

Advantages NoMachine:

  • 🎥 Hardware acceleration support (including NVIDIA CUDA).
  • 🔊 Bidirectional audio transmission.
  • 🖱️ Low input lag (critical for gaming or design).

Use the client to connect NoMachine on another PC, specifying IP-server address. The protocol uses the default port 4000.

6. Solving typical problems

Even with proper setup, the connection may not work. Here are the most common errors and their solutions:

Problem 1: "Connection refused" when connecting via SSH/VNC.

  • 🔌 Check if the service is running (sudo systemctl status ssh).
  • 🚪 Make sure the port is open in your firewall (sudo ufw status).
  • 📡 If you're connecting from a different network, set up port forwarding on your router.

Problem 2: Slow work VNC or artifacts on the screen.

  • 🎨 Reduce color depth (-depth 16) or screen resolution.
  • 🔄 Use SSH tunnel to encrypt traffic.
  • 🖥️ Disable visual effects in the graphical shell (for example, Compiz V Ubuntu).

Problem 3: It doesn't work RDP through xrdp.

  • 🖼️ Check what is used Xorg, and not Wayland (in the file /etc/gdm3/custom.conf uncomment the line WaylandEnable=false).
  • 🔄 Restart the service:
    sudo systemctl restart xrdp

7. Security: How to secure your remote connection

Remote computer access is a potential gateway for attackers. Follow these guidelines to minimize the risks:

  • 🔑 Disable password login V SSH, use only the keys:
    sudo nano /etc/ssh/sshd_config
    

    Replace with:

    PasswordAuthentication no

  • 🔄 Change the default port For SSH (for example, on 2222):
    Port 2222

    Don't forget to open the new port in your firewall!

  • 🛡️ Restrict access By IP V /etc/hosts.allow:
    sshd: 192.168.1.0/24
  • 🔍 Update your software regularly:
    sudo apt update && sudo apt upgrade -y

Public Network Warning: Never open ports SSH/RDP/VNC directly to the Internet (for example, through forwarding on a router), if you have white IPThis will make your PC vulnerable to brute-force attacks. Use VPN (For example, WireGuard) or SSH tunnel.

How to set up WireGuard for secure access?

1. Install WireGuard on the server and client:

sudo apt install wireguard

2. Generate keys:

wg genkey | tee privatekey | wg pubkey > publickey

3. Set up the config /etc/wireguard/wg0.conf on the server and client.

4. Connect to VPN, then use local IP for SSH/VNC.

8. Alternatives: TeamViewer, AnyDesk, RustDesk

If the setting SSH/VNC/RDP If this seems complicated, you can use cross-platform solutions with a graphical interface:

  • 🌍 TeamViewer — simple, but requires registration for commercial use.
  • 🖥️ AnyDesk - fast, supports file and audio transfer.
  • 🦀 RustDesk — an open, self-hosted alternative to TeamViewer.

Installation RustDesk (recommended for privacy):

wget https://github.com/rustdesk/rustdesk/releases/download/1.2.3/rustdesk-1.2.3-x86_64.deb

sudo dpkg -i rustdesk-*.deb

The advantages of such solutions:

  • ⚡ No need to configure ports or router.
  • 🔒 Built-in traffic encryption.
  • 📱 Mobile device support (control from phone).

Flaws:

  • 🕵️ Closed source code (except RustDesk).
  • 📶 Dependency on the developer's servers (may lag on poor internet).

FAQ: Frequently Asked Questions

Is it possible to connect to Linux from Android/iOS?

Yes. For Android use applications JuiceSSH (For SSH) or bVNC (For VNC). On iOS will do Termius (SSH) or VNC Viewer. For RDP both platforms have it Microsoft Remote Desktop.

For NoMachine And RustDesk There are also mobile clients.

How to connect to Linux from another network (not local)?

There are several ways:

  1. Port forwarding on the router (for example, port 22 For SSH or 5901 For VNC). Dangerous, if you have a white IP, it is better to combine with fail2ban.
  2. VPN (For example, WireGuard or OpenVPN). The safest option.
  3. Cloud service like Ngrok:
    ngrok tcp 22

    Will give you a public URL to access SSH.

For TeamViewer/AnyDesk No additional settings are needed - they work through their own servers.

Why is VNC slow while SSH is fast?

VNC transmits screen image, which requires a lot of network bandwidth. SSH transmits only text commands, so it works even on a slow connection.

To speed up VNC:

  • Reduce the screen resolution on the server.
  • Disable wallpaper and animations in the graphical shell.
  • Use SSH tunnel to compress traffic.

It's better suited for working with graphics. NoMachine or RDP.

How to transfer files between computers?

File transfer methods:

  • Via SSH:
    scp file.txt user@192.168.1.105:/path/on/server
  • Via SFTP (graphically): use FileZilla or WinSCP (for Windows).
  • Via VNC/RDP: Most clients have a built-in file transfer function (for example, in Remmina or NoMachine).
  • Via Samba: set up a network folder:
    sudo apt install samba
    

    sudo smbpasswd -a username

Is it possible to control a Linux computer without a graphical interface?

Yes, if you only need a terminal. For this, it is enough SSH. If you need to run graphical applications (for example, Firefox or GIMP), use X11 Forwarding:

ssh -X user@192.168.1.105

firefox

In this case, the application will open on your local PC, but will run on the remote one.

For Wayland (instead of X11) will be required XWayland or alternative solutions like NoMachine.