urxvt запускает два процесса

Да, вы правы. Посмотрите справочную страницу ufw, используя man ufw. В разделе ДИСТАНЦИОННОЕ УПРАВЛЕНИЕ говорят:

When running ufw enable or starting ufw via its initscript, ufw will flush its chains. This is required so ufw can maintain a consistent state, but it may drop existing connections (eg ssh). ufw does support adding rules before enabling the firewall, so administrators can do:

ufw allow proto tcp from any to any port 22

before running 'ufw enable'. The rules will still be flushed, but the ssh port will be open after enabling the firewall. Please note that once ufw is 'enabled', ufw will not flush the chains when adding or removing rules (but will when modifying a rule or changing the default policy). By default, ufw will prompt when enabling the firewall while running under ssh. This can be disabled by using 'ufw --force enable'.

1
25.10.2020, 12:24
1 ответ

urxvtзапускает setuid/setgid для работы сutmp/wtmp(функцией, позволяющей использовать командыwhoиlast). Выполнение этого напрямую считается потенциальной уязвимостью.xtermобычно использует uttempter , чтобы защититься от этого.stне имеет прямой поддержки дляutmp/wtmp. Согласно часто задаваемым вопросам, вы можете сделать это с помощью другой программы :

.
## Why does st not handle utmp entries?

Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task

Документация urxvt объясняет форк по-другому:

I need to make it setuid/setgid to support utmp/ptys on my OS, is this safe?

It should be, starting with release 7.1. You are encouraged to properly install urxvt with privileges necessary for your OS now.

When rxvt-unicode detects that it runs setuid or setgid, it will fork into a helper process for privileged operations (pty handling on some systems, utmp/wtmp/lastlog handling on others) and drop privileges immediately. This is much safer than most other terminals that keep privileges while running (but is more relevant to urxvt, as it contains things as perl interpreters, which might be "helpful" to attackers).

This forking is done as the very first within main(), which is very early and reduces possible bugs to initialisation code run before main(), or things like the dynamic loader of your system, which should result in very little risk.

Один из простых способов узнать, поддерживает ли терминал utmp/wtmp, — запустить команду w. Результирующий вывод покажет эту команду w, если терминал поддерживает эту функцию. Я вижу это вxterm:

 09:57:14 up  2:34,  5 users,  load average: 0.05, 0.01, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
tom      pts/1    192.168.1.8:S.0  07:24    5:45   7.49s  7.46s vile
tom      pts/2    192.168.1.8:S.1  07:25   42:02   0.13s  0.10s ded /usr/build/
tom      pts/3    192.168.1.8:S.2  09:15    7:45   0.41s  0.38s ded rpmbuild//S
tom      pts/4    192.168.1.8:S.3  09:51   12.00s  0.16s  0.00s sh -c uxterm-de
tom      pts/5    localhost:10.0   09:57    0.00s  0.04s  0.00s w

и это вst:

 09:59:07 up  2:36,  4 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
tom      pts/1    192.168.1.8:S.0  07:24    7:38   7.58s  7.55s vile
tom      pts/2    192.168.1.8:S.1  07:25   43:55   0.13s  0.10s ded /usr/build/
tom      pts/3    192.168.1.8:S.2  09:15    9:38   0.41s  0.38s ded rpmbuild//SOURCES/
tom      pts/4    192.168.1.8:S.3  09:51   27.00s  0.39s  0.00s sh -c stterm
1
18.03.2021, 22:54

Теги

Похожие вопросы