Size: a a a

2020 April 02

A

Aragaer in DevOps
что именно небезопасно?
источник

N

Navern in DevOps
Dmitry Sergeev
Не люблю когда говорят что sudo и su делают одно и тоже =)
su - залогиниться под другим пользователем или выполнить команду залогинившись под другим пользователем.
sudo - выполнить команду с повышенными разрешенными тебе привелегиями (описанными в sudoers). При этом логин в другую учетку не делается.

Ключевая разница в логине. Они все таки решают разные задачи
Судо позволяет логиниться в другие учетки
источник

N

Navern in DevOps
Правда для этого тебе нужны права. А для su нужен пароль)
источник

DS

Dmitry Sergeev in DevOps
Navern
Судо позволяет логиниться в другие учетки
нет, это не логин. Это повышение привелегий. Запуск bash от имени другой учетки это не логин в эту учетку. Ты просто разрешил запускать bash от имени такого-то юзера в sudoers
источник

N

Navern in DevOps
Dmitry Sergeev
нет, это не логин. Это повышение привелегий. Запуск bash от имени другой учетки это не логин в эту учетку. Ты просто разрешил запускать bash от имени такого-то юзера в sudoers
Ты можешь именно что залогиниьься))
источник

DS

Dmitry Sergeev in DevOps
Navern
Ты можешь именно что залогиниьься))
нет
источник

N

Navern in DevOps
Девопса ответ:)
источник

A

Alexander in DevOps
Dmitry Sergeev
Не люблю когда говорят что sudo и su делают одно и тоже =)
su - залогиниться под другим пользователем или выполнить команду залогинившись под другим пользователем.
sudo - выполнить команду с повышенными разрешенными тебе привелегиями (описанными в sudoers). При этом логин в другую учетку не делается.

Ключевая разница в логине. Они все таки решают разные задачи
В чем разница между "запустить баш от рута" и "залогиниться в рута"?
источник

N

Navern in DevOps
Alexander
В чем разница между "запустить баш от рута" и "залогиниться в рута"?
Ну разница есть
источник

A

Alexander in DevOps
Navern
Ну разница есть
Я у @identw хочу узнать :)
источник

DS

Dmitry Sergeev in DevOps
Alexander
В чем разница между "запустить баш от рута" и "залогиниться в рута"?
процедурой аутентификации
источник

A

Alexander in DevOps
Dmitry Sergeev
процедурой аутентификации
И в чем разница?
источник

N

Navern in DevOps
-i [command]

   The -i (simulate initial login) option runs the shell specified by the password database entry of the target user as a login shell. This means that login-specific resource files such as .profile or .login will be read by the shell. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed. sudo attempts to change to that user's home directory before running the shell. The security policy shall initialize the environment to a minimal set of variables, similar to what is present when a user logs in. The Command Environment section in the sudoers(5) manual documents how the -i option affects the environment in which a command is run when the sudoers policy is in use.
источник

DS

Dmitry Sergeev in DevOps
Alexander
В чем разница между "запустить баш от рута" и "залогиниться в рута"?
когда ты логинишься под рутом, ты вводишь его логин и пароль.
Когда ты запускаешь bash, тебе просто разрешили запустить баш от рута и все
источник

N

Navern in DevOps
Dmitry Sergeev
когда ты логинишься под рутом, ты вводишь его логин и пароль.
Когда ты запускаешь bash, тебе просто разрешили запустить баш от рута и все
Глубоко
источник

DS

Dmitry Sergeev in DevOps
Navern
-i [command]

   The -i (simulate initial login) option runs the shell specified by the password database entry of the target user as a login shell. This means that login-specific resource files such as .profile or .login will be read by the shell. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed. sudo attempts to change to that user's home directory before running the shell. The security policy shall initialize the environment to a minimal set of variables, similar to what is present when a user logs in. The Command Environment section in the sudoers(5) manual documents how the -i option affects the environment in which a command is run when the sudoers policy is in use.
simulate initial login
runs the shell
источник

N

Navern in DevOps
su так то тоже тебе дает шелл)
источник

DS

Dmitry Sergeev in DevOps
Navern
-i [command]

   The -i (simulate initial login) option runs the shell specified by the password database entry of the target user as a login shell. This means that login-specific resource files such as .profile or .login will be read by the shell. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed. sudo attempts to change to that user's home directory before running the shell. The security policy shall initialize the environment to a minimal set of variables, similar to what is present when a user logs in. The Command Environment section in the sudoers(5) manual documents how the -i option affects the environment in which a command is run when the sudoers policy is in use.
если убрать из sudo ALL (то есть разрешения запускать все команды от пределенного пользователя), тебе даст залогиниться?
источник

DS

Dmitry Sergeev in DevOps
Navern
su так то тоже тебе дает шелл)
после процедуры аутентификации, он запускает то что у тебя в /etc/passwd указано в качестве шела, да
источник

DS

Dmitry Sergeev in DevOps
Navern
su так то тоже тебе дает шелл)
понятно что можно получить шелл двумя способоами и через su и через sudo. Но способы разные, и это не одно и тоже
источник