Setting up SSH access to a local server

← Back

Setting up SSH access to a local server

To install the IPTVPORTAL software on a local server and its further support, you must provide access to the server via SSH.

To grant access, you need to create iptvportal_support user without a password, with the ability to execute commands as root via sudo without entering a password, and add our public key to it to connect via SSH.


To automatically configure access (create a user and add a key), you can use the script.
Run two commands on the local server as root:
apt update && apt install -y curl
curl -s | bash

Tell us the server’s IP address (and the SSH port if it’s different from the default).
The SSH port must be accessible from all of our IP addresses.


To configure access manually, you must perform the following actions on the local server:

1. Connect to your server as root user:
ssh root@server
(where server is the ip address of your server) and enter the password for the root user, then press the Enter key

2. Update the package list and install the sudo and curl programs:
apt update && apt install -y sudo curl

3. Create user iptvportal_support without password:
adduser --disabled-password --gecos 'iptvportal_support' iptvportal_support

4. Add the iptvportal_support user to the sudo group:
usermod -aG sudo iptvportal_support

5. Add the ability for the iptvportal_support user to execute commands using sudo without entering a password:
echo "iptvportal_support ALL=(ALL,ALL) NOPASSWD: ALL" >> /etc/sudoers

6. Proceed to execute commands on behalf of the iptvportal_support user:
su iptvportal_support

7. Create a directory for placing keys and set permissions for it:
[ -d ~iptvportal_support/.ssh ] || (mkdir -p ~iptvportal_support/.ssh; chmod 711 ~iptvportal_support/.ssh)

8. Download and add our public key for the iptvportal_support user:
curl -s -o - >> ~iptvportal_support/.ssh/authorized_keys

9. Set the permissions for the ~iptvportal_support/.ssh/authorized_keys file:
chmod 600 ~iptvportal_support/.ssh/authorized_keys