Accessing RStudio Server on LAN

One thing you can check is the firewall running on the Centos 9 machine. By default Centos 9 enables and starts firewalld. It allows all localhost access but only remote ssh access by default. You can check this by running the following command:

sudo systemctl status firewalld

You should get a status similiar to:

● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2024-02-15 19:23:43 CST; 1 weeks 2 days ago

If firewalld is enabled, you can check the firewall configuration by running:

sudo firewall-cmd --list-all

You should get something similar to the following (probably without http and https as services though) :

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources:
  services:  http https ssh
  ports: 8787/tcp
  protocols:
  forward: no
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

If you don't see ports: 8787/tcp you can add it with the following command:

sudo firewall-cmd --add-port=8787/tcp --permanent
sudo firewall-cmd --add-port=8787/tcp

The first make the rule permanent (beyond a reboot) and the second makes the rule active immediately.
You should then be able to connect to the port from a remote computer.

1 Like