24.5 C
New York
Friday, August 29, 2025

iterm – Terminals prompting for login and never beginning correctly anymore


I’ve run right into a irritating difficulty with iTerm2 and Terminal on my work MacBook Professional (M3 Max Sequoia).

I had arrange a couple of iTerm2 profiles for SSH logins that included passwords. After failing to correctly sign off from one of many periods, each iTerm2 and the default Terminal app now immediate me for login credentials each time I open them. My regular password would not work—it looks like it’s asking for the foundation person particularly.

enter image description here

I’ve tried every little thing I may discover on-line: eradicating .zshrc, .zprofile, and the Terminal/iTerm2 preferences (plist recordsdata), restarting, and so forth., however nothing has labored thus far.

If I set the iTerm2 profile’s command to /bin/zsh, I can open a working terminal, but it surely masses with out my regular settings, surroundings variables, or profiles.

I am actually caught at this level and undecided what I am lacking. Since it is a work laptop computer, I don’t have admin/root entry, so I can not do a full reset. It looks like some setting or file is corrupted, however I haven’t been in a position to establish it. (I’ve additionally .oh-my-zsh put in if it helps)

Has anybody skilled one thing related or discovered a working resolution?

Replace

I resolved this difficulty after working with IT and needed to share an replace in case anybody runs into one thing related. It turned out the issue wasn’t associated to any recordsdata, settings, or system corruption as I initially suspected. Our firm makes use of Ubikeys for authentication, and IT defined {that a} latest macOS replace launched a bug the place the system fails to correctly acknowledge the Ubikey. This triggered login prompts to look even when authentication ought to have labored.

IT talked about they reported the difficulty to Apple, however Apple hasn’t acknowledged it but. As a workaround, they reset the foundation password and Ubikey authentication, which restored regular performance—for now, not less than, till the bug resurfaces.

Extra data

The determine beneath exhibits the profiles settings in iTerm2. There’s a setting referred to as Command that I highlighted within the crimson rectangle. I get the login immediate proven above when that is set to its default Login Shell.

enter image description here

I can change the Command setting to Command (proven beneath), and set it to /bin/zsh/, or zsh --no-rcs, or just simply zsh. On this case, it opens the terminal with out the login promot (by the best way, this solely works for iTerm2, the identical workaround doesn’t work with the terminal app for some cause).

enter image description here

The next is the output of zsh -l -v -x with my precise username changed with myusername. (Observe that I deleted ~/.zshrc and ~/.zprofile hoping that it may resolve the difficulty. That is why you is probably not seeing it within the output.)

~ % zsh -l -v -x
# System-wide profile for interactive zsh(1) login shells.

# Setup person particular overrides for this in ~/.zprofile. See zshbuiltins(1)
# and zshoptions(1) for extra particulars.

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi
+/and so forth/zprofile:6> [ -x /usr/libexec/path_helper ']'
+/and so forth/zprofile:7> /usr/libexec/path_helper -s
+/and so forth/zprofile:7> eval 'PATH="/usr/native/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.safety.cryptexd/codex.system/bootstrap/usr/native/bin:/var/run/com.apple.safety.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.safety.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Functions/iTerm.app/Contents/Assets/utilities";' export 'PATH;'
+(eval):1> PATH=/usr/native/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.safety.cryptexd/codex.system/bootstrap/usr/native/bin:/var/run/com.apple.safety.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.safety.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Functions/iTerm.app/Contents/Assets/utilities
+(eval):1> export PATH
# System-wide profile for interactive zsh(1) shells.

# Setup person particular overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for extra particulars.

# Accurately show UTF-8 with combining characters.
if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
    setopt COMBINING_CHARS
fi
+/and so forth/zshrc:7> [[+/etc/zshrc:7> locale LC_CTYPE
+/etc/zshrc:7> [[ UTF-8 == UTF-8 ]]
+/and so forth/zshrc:8> setopt COMBINING_CHARS

# Disable the log builtin, so we do not battle with /usr/bin/log
disable log
+/and so forth/zshrc:12> disable log

# Save command historical past
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
+/and so forth/zshrc:15> HISTFILE=/Customers/myusername/.zsh_history
HISTSIZE=2000
+/and so forth/zshrc:16> HISTSIZE=2000
SAVEHIST=1000
+/and so forth/zshrc:17> SAVEHIST=1000

# Beep on error
setopt BEEP
+/and so forth/zshrc:20> setopt BEEP

# Use keycodes (generated by way of zkbd) if current, in any other case fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then
    supply ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR}
else
    typeset -g -A key

    [[ -n "$terminfo[kf1]" ]] && key[F1]=$terminfo[kf1]
    [[ -n "$terminfo[kf2]" ]] && key[F2]=$terminfo[kf2]
    [[ -n "$terminfo[kf3]" ]] && key[F3]=$terminfo[kf3]
    [[ -n "$terminfo[kf4]" ]] && key[F4]=$terminfo[kf4]
    [[ -n "$terminfo[kf5]" ]] && key[F5]=$terminfo[kf5]
    [[ -n "$terminfo[kf6]" ]] && key[F6]=$terminfo[kf6]
    [[ -n "$terminfo[kf7]" ]] && key[F7]=$terminfo[kf7]
    [[ -n "$terminfo[kf8]" ]] && key[F8]=$terminfo[kf8]
    [[ -n "$terminfo[kf9]" ]] && key[F9]=$terminfo[kf9]
    [[ -n "$terminfo[kf10]" ]] && key[F10]=$terminfo[kf10]
    [[ -n "$terminfo[kf11]" ]] && key[F11]=$terminfo[kf11]
    [[ -n "$terminfo[kf12]" ]] && key[F12]=$terminfo[kf12]
    [[ -n "$terminfo[kf13]" ]] && key[F13]=$terminfo[kf13]
    [[ -n "$terminfo[kf14]" ]] && key[F14]=$terminfo[kf14]
    [[ -n "$terminfo[kf15]" ]] && key[F15]=$terminfo[kf15]
    [[ -n "$terminfo[kf16]" ]] && key[F16]=$terminfo[kf16]
    [[ -n "$terminfo[kf17]" ]] && key[F17]=$terminfo[kf17]
    [[ -n "$terminfo[kf18]" ]] && key[F18]=$terminfo[kf18]
    [[ -n "$terminfo[kf19]" ]] && key[F19]=$terminfo[kf19]
    [[ -n "$terminfo[kf20]" ]] && key[F20]=$terminfo[kf20]
    [[ -n "$terminfo[kbs]" ]] && key[Backspace]=$terminfo[kbs]
    [[ -n "$terminfo[kich1]" ]] && key[Insert]=$terminfo[kich1]
    [[ -n "$terminfo[kdch1]" ]] && key[Delete]=$terminfo[kdch1]
    [[ -n "$terminfo[khome]" ]] && key[Home]=$terminfo[khome]
    [[ -n "$terminfo[kend]" ]] && key[End]=$terminfo[kend]
    [[ -n "$terminfo[kpp]" ]] && key[PageUp]=$terminfo[kpp]
    [[ -n "$terminfo[knp]" ]] && key[PageDown]=$terminfo[knp]
    [[ -n "$terminfo[kcuu1]" ]] && key[Up]=$terminfo[kcuu1]
    [[ -n "$terminfo[kcub1]" ]] && key[Left]=$terminfo[kcub1]
    [[ -n "$terminfo[kcud1]" ]] && key[Down]=$terminfo[kcud1]
    [[ -n "$terminfo[kcuf1]" ]] && key[Right]=$terminfo[kcuf1]
fi
+/and so forth/zshrc:24> [[ -r /Users/myusername/.zkbd/xterm-256color-apple ]]
+/and so forth/zshrc:27> typeset -g -A key
+/and so forth/zshrc:29> [[ -n $'C-[OP' ]]
+/and so forth/zshrc:29> key[F1]=$'C-[OP'
+/etc/zshrc:30> [[ -n $'C-[OQ' ]]
+/and so forth/zshrc:30> key[F2]=$'C-[OQ'
+/etc/zshrc:31> [[ -n $'C-[OR' ]]
+/and so forth/zshrc:31> key[F3]=$'C-[OR'
+/etc/zshrc:32> [[ -n $'C-[OS' ]]
+/and so forth/zshrc:32> key[F4]=$'C-[OS'
+/etc/zshrc:33> [[ -n $'C-[[15~' ]]
+/and so forth/zshrc:33> key[F5]=$'C-[[15~'
+/etc/zshrc:34> [[ -n $'C-[[17~' ]]
+/and so forth/zshrc:34> key[F6]=$'C-[[17~'
+/etc/zshrc:35> [[ -n $'C-[[18~' ]]
+/and so forth/zshrc:35> key[F7]=$'C-[[18~'
+/etc/zshrc:36> [[ -n $'C-[[19~' ]]
+/and so forth/zshrc:36> key[F8]=$'C-[[19~'
+/etc/zshrc:37> [[ -n $'C-[[20~' ]]
+/and so forth/zshrc:37> key[F9]=$'C-[[20~'
+/etc/zshrc:38> [[ -n $'C-[[21~' ]]
+/and so forth/zshrc:38> key[F10]=$'C-[[21~'
+/etc/zshrc:39> [[ -n $'C-[[23~' ]]
+/and so forth/zshrc:39> key[F11]=$'C-[[23~'
+/etc/zshrc:40> [[ -n $'C-[[24~' ]]
+/and so forth/zshrc:40> key[F12]=$'C-[[24~'
+/etc/zshrc:41> [[ -n $'C-[[1;2P' ]]
+/and so forth/zshrc:41> key[F13]=$'C-[[1;2P'
+/etc/zshrc:42> [[ -n $'C-[[1;2Q' ]]
+/and so forth/zshrc:42> key[F14]=$'C-[[1;2Q'
+/etc/zshrc:43> [[ -n $'C-[[1;2R' ]]
+/and so forth/zshrc:43> key[F15]=$'C-[[1;2R'
+/etc/zshrc:44> [[ -n $'C-[[1;2S' ]]
+/and so forth/zshrc:44> key[F16]=$'C-[[1;2S'
+/etc/zshrc:45> [[ -n $'C-[[15;2~' ]]
+/and so forth/zshrc:45> key[F17]=$'C-[[15;2~'
+/etc/zshrc:46> [[ -n $'C-[[17;2~' ]]
+/and so forth/zshrc:46> key[F18]=$'C-[[17;2~'
+/etc/zshrc:47> [[ -n $'C-[[18;2~' ]]
+/and so forth/zshrc:47> key[F19]=$'C-[[18;2~'
+/etc/zshrc:48> [[ -n $'C-[[19;2~' ]]
+/and so forth/zshrc:48> key[F20]=$'C-[[19;2~'
+/etc/zshrc:49> [[ -n $'C-H' ]]
+/and so forth/zshrc:49> key[Backspace]=$'C-H'
+/and so forth/zshrc:50> [[ -n $'C-[[2~' ]]
+/and so forth/zshrc:50> key[Insert]=$'C-[[2~'
+/etc/zshrc:51> [[ -n $'C-[[3~' ]]
+/and so forth/zshrc:51> key[Delete]=$'C-[[3~'
+/etc/zshrc:52> [[ -n $'C-[OH' ]]
+/and so forth/zshrc:52> key[Home]=$'C-[OH'
+/etc/zshrc:53> [[ -n $'C-[OF' ]]
+/and so forth/zshrc:53> key[End]=$'C-[OF'
+/etc/zshrc:54> [[ -n $'C-[[5~' ]]
+/and so forth/zshrc:54> key[PageUp]=$'C-[[5~'
+/etc/zshrc:55> [[ -n $'C-[[6~' ]]
+/and so forth/zshrc:55> key[PageDown]=$'C-[[6~'
+/etc/zshrc:56> [[ -n $'C-[OA' ]]
+/and so forth/zshrc:56> key[Up]=$'C-[OA'
+/etc/zshrc:57> [[ -n $'C-[OD' ]]
+/and so forth/zshrc:57> key[Left]=$'C-[OD'
+/etc/zshrc:58> [[ -n $'C-[OB' ]]
+/and so forth/zshrc:58> key[Down]=$'C-[OB'
+/etc/zshrc:59> [[ -n $'C-[OC' ]]
+/and so forth/zshrc:59> key[Right]=$'C-[OC'

# Default key bindings
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
+/and so forth/zshrc:63> [[ -n $'C-[[3~' ]]
+/and so forth/zshrc:63> bindkey $'C-[[3~' delete-char
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
+/and so forth/zshrc:64> [[ -n $'C-[OH' ]]
+/and so forth/zshrc:64> bindkey $'C-[OH' beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
+/and so forth/zshrc:65> [[ -n $'C-[OF' ]]
+/and so forth/zshrc:65> bindkey $'C-[OF' end-of-line
[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search
+/and so forth/zshrc:66> [[ -n $'C-[OA' ]]
+/and so forth/zshrc:66> bindkey $'C-[OA' up-line-or-search
[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search
+/and so forth/zshrc:67> [[ -n $'C-[OB' ]]
+/and so forth/zshrc:67> bindkey $'C-[OB' down-line-or-search

# Default prompt
PS1="%n@%m %1~ %# "
+/etc/zshrc:70> PS1='%n@%m %1~ %# '

# Useful support for interacting with Terminal.app or other terminal programs
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/and so forth/zshrc_$TERM_PROGRAM"
+/and so forth/zshrc:73> [ -r /etc/zshrc_iTerm.app ']'


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles