24 заметки с тегом

linux

Настройка VNC сервера в Fedora

Возникла необходимость в организации удаленного подключения к рабочей станции по проьлколу VNC.
В процессе изучения вопроса выяснилось, что VNC сервер Vino, который установлен по дефолту, слушает порт 5900, который так же слушает демон Qemu и одновременная работа двух служб на одном хосте невозможна.
Решением данной проблемы станет изменение порта по умолчанию сервера Vino через gsettings.

gsettings set org.gnome.Vino use-alternative-port true
gsettings set org.gnome.Vino alternative-port 5901
gsettings set org.gnome.Vino network-interface lo
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.Vino lock-screen-on-disconnect true

В Fedora 35 VNC активируется так:

gsettings set org.gnome.desktop.remote-desktop.vnc encryption "['none']"
sudo firewall-cmd --permanent --add-service=vnc-server
sudo firewall-cmd --reload
sudo reboot now

Описание настроек VNC сервера Vino со значениями по умолчанию

prompt-enabled — Prompt the user before completing a connection

If true, remote users accessing the desktop are not allowed
access until the user on the host machine approves the
connection. Recommended especially when access is not password
protected.
default: true

view-only — Only allow remote users to view the desktop

If true, remote users accessing the desktop are only allowed to
view the desktop. Remote users will not be able to use the mouse
or keyboard.
default: false

network-interface — Network interface for listening

If not set, the server will listen on all network interfaces.
Set this if you want to accept connections only from some specific
network interface. For example, eth0, wifi0, lo and so on.
default: ’’

use-alternative-port — Listen on an alternative port

If true, the server will listen on another port, instead of the default
(5900). The port must be specified in the “alternative-port” key.
default: false

alternative-port — Alternative port number

The port which the server will listen to if the “use-alternative-port”
key is set to true. Valid values are in the range of 5000 to 50000.
default: 5900

require-encryption — Require encryption

If true, remote users accessing the desktop are required to
support encryption. It is highly recommended that you use a
client which supports encryption unless the intervening network
is trusted.
default: true

authentication-methods — Allowed authentication methods

Lists the authentication methods with which remote users may
access the desktop.
There are two possible authentication methods; “vnc” causes the
remote user to be prompted for a password (the password is
specified by the vnc-password key) before connecting and “none”
which allows any remote user to connect.
default: [’none’]

vnc-password — Password required for “vnc” authentication

The password which the remote user will be prompted for if the
“vnc” authentication method is used. The password specified by
the key is base64 encoded.
The special value of “keyring” (which is not valid base64) means
that the password is stored in the GNOME keyring.
default: ’keyring’

mailto — E-mail address to which the remote desktop URL should be sent

This key specifies the e-mail address to which the remote
desktop URL should be sent if the user clicks on the URL in the
Desktop Sharing preferences dialog.
default: ’’

lock-screen-on-disconnect — Lock the screen when last user disconnect

If true, the screen will be locked after the last remote client
disconnects.
default: false

icon-visibility — When the status icon should be shown

This key controls the behavior of the status icon. There are
three options: “always” — the icon will always be present; “client” —
the icon will only be present when someone is connected (this is the
default behavior); “never” — the icon will not be present.
default: ’client’

disable-background — Whether to disable the desktop background when a user is connected

When true, disable the desktop background and replace it with a single
block of color when a user successfully connects.
default: false

use-upnp — Whether a UPnP router should be used to forward and open ports

If true, request that a UPnP-capable router should forward and open the
port used by Vino.
default: false

disable-xdamage — Whether we should disable the XDamage extension of X.org

If true, do not use the XDamage extension of X.org. This extension does
not work properly on some video drivers when using 3D effects.
Disabling it will make Vino work in these environments, with slower
rendering as a side effect.
default: false

notify-on-connect — Notify on connect

If true, show a notification when a user connects to the system.
default: true

Дополнительные материалы

https://wiki.archlinux.org/index.php/Vino

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/accessing-the-desktop-remotely_using-the-desktop-environment-in-rhel-8

 Нет комментариев    588   2019   linux

Обновление таймзоны в Java

В настоящее время инструмент TZUpdater совместим только с форматом данных «арьергарда», который больше не имеет встроенных двоичных файлов. IANA никогда не публиковала их, и при попытке обновлении таймзоны появится следующая ошибка.

Failed: java.lang.Exception: Failed while parsing file '/tmp/ziupdater21715634709704541231626652501292559/srcdir/asia' on line 1865 'Rule	Japan	1948	1951	-	Sep	Sat>=8	25:00	0	S'

Для создания двоичный файлов необходимо проделать следующую процедуру

yum install lzip
mkdir ./tmp ; cd ./tmp
wget https://cdn.azul.com/tools/ziupdater1.0.2.2-jse8+7-any_jvm.tar.gz
tar -xzvf ziupdater1.0.2.2-jse8+7-any_jvm.tar.gz
wget https://data.iana.org/time-zones/releases/tzdb-2019b.tar.lz
lzip -d tzdb-2019b.tar.lz && tar xvf tzdb-2019b.tar && cd tzdb-2019b
make rearguard_tarballs
/usr/java/java8/bin/java -jar ../ziupdater-1.0.2.2.jar -v -l file:./tzdata2019b-rearguard.tar.gz

http://qaru.site/questions/18068758/update-to-tzdata2019b-is-failing

 Нет комментариев    466   2019   java   linux

MTProto Proxy на CentOS7

Решил попробовать использовать вместо 3proxy вышедшей не так давно MTProto Proxy, собрал пакет для 7 CentOS. Из зависимостей требует zlib, openssl и curl. В процессе установки автоматически генерируется секретный ключ авторизации, загружаются список серверов и ключ для доступа.
Установка сводится к следующим действиям

yum localinstall mtproto-proxy-20824f5-1.el7.x86_64.rpm
systemctl enable mtproto-proxy
systemctl start mtproto-proxy
firewall-cmd --permanent --zone=external --add-service=mtproto-proxy

По умолчанию сервер запускается на порту 8443. Если это необходимо изменить, то основные настройки вынесены в /etc/sysconfig/mtproto-proxy. Так же придется отредактировать и /etc/firewalld/services/mtproto-proxy.xml.

Теперь для подключения, в приложении, необходимо перейти по ссылке.

https://t.me/proxy?server=<SERVER_IP>&port=<PORT>&secret=<SECRET_KEY>

где:

SERVER_IP - ip адрес сервера mtproto-proxy
PORT - порт на котором запущен mtproto-proxy
SECRET_KEY - секретный ключ, который был создан в процессе установки

Для страждущих паранойей src.rpm пакет, для самостоятельной сборки, можно скачать здесь.

 Нет комментариев    457   2018   centos   linux   web
 Нет комментариев    34   2018   bash   linux

Настройка SOCKS5 прокси на CentOS7

В свете последних событий, понадобился SOCKS5 прокси с авторизацией.
Поискав в интернете остановил свой выбор на 3proxy от z3APA3A, как наиболее легковесном, функциональном и активно развивающемся, последний релиз которого состоялся 18.04.2018.
К сожалению актуальной версии пакета в репозиториях CentOS не нашлось, поэтому пришлось переписать spec-файл для текущей версии 0.8.12.

Для начала необходимо скачать 3proxy, после чего можно приступать к его установки.

yum localinstall 3proxy-0.8.12-1.el7.centos.x86_64.rpm

Так как меня интересует именно SOCKS-прокси, то конфигурационный файл будет иметь следующий вид. Если нужен дополнительный функционал, то можно почитать 3proxy.cfg.example или wiki проекта на github.com

vim /etc/3proxy/3proxy.cfg
daemon
setgid 99
setuid 99

nscache 65536
nserver 127.0.0.1

timeouts 1 5 30 60 180 1800 15 60

external 0.0.0.0
internal 0.0.0.0

config /etc/3proxy/3proxy.cfg
monitor /etc/3proxy/3proxy.cfg
monitor /etc/3proxy/counters
monitor /etc/3proxy/passwd
monitor /etc/3proxy/bandlimiters

log /var/log/3proxy/3proxy.log
logformat "L%o %d %H:%M:%S      %U | %C | %R:%r | %O | %I | %n"
archiver gz /bin/gzip %F
rotate 7

users $/etc/3proxy/passwd

include /etc/3proxy/counters
include /etc/3proxy/bandlimiters

auth strong
flush
socks -p81080

Теперь добавляем пользователей, для этого выполним скрипт add3proxyuser.sh

/etc/3proxy/add3proxyuser.sh username password day_limit bandwidth

где:
username — имя пользователя
password — пароль
day_limit — лимит трафика в Мегабайтах в день
bandwidth — полоса пропускания в битах в секунду

Для примера заведем пользователя с логином и паролем admin, лимитом трафика в 100 Мегабайт в день и полосой пропускания в 1 Мегабит.

/etc/3proxy/add3proxyuser.sh admin admin 100 1048576

Теперь в файле, /etc/3proxy/passwd, появилась запись с логином и MD5-хешем пароля

admin:CR:$1$10216$EvIj9vLnQi/zydUXJXYa60

Активируем и запускаем сервис

systemctl enable 3proxy
systemctl start 3proxy

Добавляем правило в Firewall разрешающее внешнее подключение к прокси

firewall-cmd --permanent --zone=external --add-port=81080/tcp

Теперь можно применять настройки прокси перейдя по ссылке следующего содержания:

https://t.me/socks?server=my.server.org&port=81080&user=admin&pass=admin

Для страждущих паранойей src.rpm пакет, для самостоятельной сборки, можно скачать здесь.

 Нет комментариев    130   2018   centos   linux
Ранее Ctrl + ↓