jbg: Which shell does doas -s
execute, the calling user's or the target user's? And what does it set the $SHELL
environment variable to?
GPT-4: The doas -s
command is used to execute a shell with elevated privileges. When you run this command, it will execute the target user's shell, typically the root user's shell. The target user's shell is determined by their entry in the /etc/passwd
file.
The $SHELL
environment variable will be set to the target user's default shell as specified in the /etc/passwd
file. For example, if the target user's default shell is /bin/bash
, the $SHELL
variable will be set to /bin/bash
during the doas -s
session. Keep in mind that the actual behavior may vary slightly depending on the implementation of doas and the operating system you are using.
jbg: Your first paragraph is incorrect, it actually executes the shell in the calling user's SHELL
environment variable or /etc/passwd
entry.
GPT-4: You are correct, I apologize for the confusion