v10.45 (build: Nov 10 2024)

Установка на удаленные машины (Linux)

Установочный пакет необходимо загрузить отсюда.

Установить пакет на удаленный компьютер можно через OpenSSH. На удаленном компьютере предварительно должен быть установлен и настроен OpenSSH-сервер. Документация по установке и настройке OpenSSH можно найти на сайте wiki.debian.org
На локальном компьютере должен быть установлен клиент SSH. Под Windows можно использовать PuTTY в качестве SSH клиента.

Установка .deb-пакета (Ubuntu, Linux Mint, Astra Linux):

Пример batch скрипта для Windows для установки deb пакетов на удаленный компьютер:

rem Setup address and port of remote PC
set HOST_IP=192.168.1.10
set HOST_PORT=22
rem Setup administrator's name for the remote PC
set HOST_USERNAME=root
rem Name of the deb-package in the current folder
set PACKAGE_NAME=stkh-client_1.10_amd64.deb
rem Setup complex server address
set STKH_SERVER_ADDRESS=192.168.1.2

rem Copy package to the remote PC
"C:\Program Files\PuTTY\pscp.exe" -scp -P "%HOST_PORT%" "%PACKAGE_NAME%" %HOST_USERNAME%@%HOST_IP%:/tmp
rem Execute package installation
"C:\Program Files\PuTTY\plink.exe" -ssh %HOST_USERNAME%@%HOST_IP% -P "%HOST_PORT%" "DEBIAN_FRONTEND=noninteractive dpkg --install /tmp/%PACKAGE_NAME%; apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -fy"
rem Setup server address on the remote PC for the client
"C:\Program Files\PuTTY\plink.exe" -ssh %HOST_USERNAME%@%HOST_IP% -P "%HOST_PORT%" "stkh-client --server=%STKH_SERVER_ADDRESS%"
rem Delete package from the remote PC
"C:\Program Files\PuTTY\plink.exe" -ssh %HOST_USERNAME%@%HOST_IP% -P "%HOST_PORT%" "rm /tmp/%PACKAGE_NAME%"

Пример bash скрипта для Linux для установки deb пакетов на удаленный компьютер:

# Setup address and port of remote PC
HOST_IP=192.168.1.10
HOST_PORT=22
# Setup administrator's name for the remote PC
HOST_USERNAME=root
# Name of the deb-package in the current folder
PACKAGE_NAME=stkh-client_1.10_amd64.deb
# Setup complex server address
STKH_SERVER_ADDRESS=192.168.1.2

# Copy package to the remote PC
scp -p "$HOST_PORT" "$PACKAGE_NAME" $HOST_USERNAME@$HOST_IP:/tmp
# Execute package installation
ssh -p "$HOST_PORT" $HOST_USERNAME@$HOST_IP "DEBIAN_FRONTEND=noninteractive dpkg --install /tmp/$PACKAGE_NAME; apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -fy"
# Setup server address on the remote PC for the client
ssh -p "$HOST_PORT" $HOST_USERNAME@$HOST_IP "stkh-client --server=$STKH_SERVER_ADDRESS"
# Delete package from the remote PC
ssh -p "$HOST_PORT" $HOST_USERNAME@$HOST_IP "rm /tmp/$PACKAGE_NAME"

Установка .rpm-пакета (CentOS, РЕД ОС, Rosa Linux(*)):

Пример batch скрипта для Windows для установки rpm пакетов на удаленный компьютер:

rem Setup address and port of remote PC
set HOST_IP=192.168.1.10
set HOST_PORT=22
rem Setup administrator's name for the remote PC
set HOST_USERNAME=root
rem Name of the rpm-package in the current folder
set PACKAGE_NAME=stkh-client-1.10-0.x86_64.rpm
rem Setup complex server address
set STKH_SERVER_ADDRESS=192.168.1.2

rem Copy package to the remote PC
"C:\Program Files\PuTTY\pscp.exe" -scp -P "%HOST_PORT%" "%PACKAGE_NAME%" %HOST_USERNAME%@%HOST_IP%:/tmp
rem Execute package installation
"C:\Program Files\PuTTY\plink.exe" -ssh %HOST_USERNAME%@%HOST_IP% -P "%HOST_PORT%" "yum -y localinstall /tmp/%PACKAGE_NAME%"
rem Setup server address on the remote PC for the client
"C:\Program Files\PuTTY\plink.exe" -ssh %HOST_USERNAME%@%HOST_IP% -P "%HOST_PORT%" "stkh-client --server=%STKH_SERVER_ADDRESS%"
rem Delete package from the remote PC
"C:\Program Files\PuTTY\plink.exe" -ssh %HOST_USERNAME%@%HOST_IP% -P "%HOST_PORT%" "rm /tmp/%PACKAGE_NAME%"

Пример bash скрипта для Linux для установки rpm пакетов на удаленный компьютер:

# Setup address and port of remote PC
HOST_IP=192.168.1.10
HOST_PORT=22
# Setup administrator's name for the remote PC
HOST_USERNAME=root
# Name of the rpm-package in the current folder
PACKAGE_NAME=stkh-client-1.10-0.x86_64.rpm
# Setup complex server address
STKH_SERVER_ADDRESS=192.168.1.2

# Copy package to the remote PC
scp -p "$HOST_PORT" "$PACKAGE_NAME" $HOST_USERNAME@$HOST_IP:/tmp
# Execute package installation
ssh -p "$HOST_PORT" $HOST_USERNAME@$HOST_IP "yum -y localinstall /tmp/$PACKAGE_NAME"
# Setup server address on the remote PC for the client
ssh -p "$HOST_PORT" $HOST_USERNAME@$HOST_IP "stkh-client --server=$STKH_SERVER_ADDRESS"
# Delete package from the remote PC
ssh -p "$HOST_PORT" $HOST_USERNAME@$HOST_IP "rm /tmp/$PACKAGE_NAME"
(*) Для Rosa Linux вместо yum -y localinstall использовать urpmi

© СТАХАНОВЕЦ