I'm using macOS on Sonoma, and for as long as I remember, iTerm2 prompts me to log in with user and password each time before it loads the shell. On restart, it requires the user login again. The same does not happen with the native Terminal.
I have asked on Unix stack exchange, with no success. I have tried the solution given in the post: https://unix.stackexchange.com/a/767394/596618 using its source.
I thought the issue might have been in having the terminal installed in
~/Applications but it was not it.
Likewise, I removed
/Users/kamil/Library/Preferences/com.googlecode.iterm2.plist (copy is here) and iTerm with default configuration did not prompt the login and password, but I did not find any setting in the UI — going through them all which could have been responsible.