Git asks for ssh password all the time

This is not technically a question about Manjaro, but Manjaro is the one and only system where I ever had that experience.
Git asks me about my password for SSH constantly. Every single time I make push or pull.
I cannot stop this behaviour.
I tried everything.

eval $(ssh-agent) 
ssh-add

I even put this into my sshconfig file:

Host *
   AddKeysToAgent yes
   UseKeychain yes
   IdentityFile ~/.ssh/id_rsa

Is there anybody who knows how to solve this?

may you post the output of

systemctl status sshd

Interesting. Its dead.

○ sshd.service - OpenSSH Daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; preset: disabled)
     Active: inactive (dead)

I just restarted it and now its:

● sshd.service - OpenSSH Daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; preset: disabled)
     Active: active (running) since Sat 2023-07-15 13:24:47 CEST; 36s ago
   Main PID: 16243 (sshd)
      Tasks: 1 (limit: 38413)
     Memory: 2.0M
        CPU: 4ms
     CGroup: /system.slice/sshd.service
             └─16243 "sshd: /usr/bin/sshd -D [listener] 0 of 10-100 startups"

Jul 15 13:24:47 Mycroft systemd[1]: Started OpenSSH Daemon.
Jul 15 13:24:47 Mycroft sshd[16243]: Server listening on 0.0.0.0 port 22.
Jul 15 13:24:47 Mycroft sshd[16243]: Server listening on :: port 22.

Now, it is possible to push and pull without passphrase but only in the terminal window / tab where I just reactivated it. If I open a new one, it still asks me again. Weird.

okay please try this

sudo systemctl enable sshd
sudo systemctl start sshd

to be bulletproof reboot and try

otherwise you can always revert it with

sudo systemctl stop sshd
sudo systemctl disable sshd

I don’t see a user associated with it. Mine is:

Host minikeeper
    HostName 10.0.0.254
        User mirdarthos
            IdentityFile /home/mirdarthos/.ssh/id_rsa

I just restarted the system and it still asks for the key password every single time.
But its still enabled and running though.

@Mirdarthos
I am not sure about this, but I recently tried this one as well, which wasnt working either:

Host github.com
   HostName github.com
   PreferredAuthentications publickey
   User myusername
   IdentityFile ~/.ssh/id_rsa

This shouldn’t make a difference, but just for thoroughness sake, try changing

…to the absolute path…

sshd is not the same as ssh-agent

https://wiki.archlinux.org/title/SSH_keys

You need to start the ssh-agent together with your gui, so it is persistent between terminal sessions.

This depends on the DE you use.


  1. Please read the information behind this link. It will help you to post necessary information.
  1. Please press the three dots below your post and then press the :pencil2:
  • If you give us information about your system, we can see what we’re talking about and make better suggestions.
  • You can do this by using inxi in a terminal or in console.
sudo inxi --admin --verbosity=7 --filter --no-host --width
  • Personally identifiable information such as serial numbers and MAC addresses are filtered out by this command
  • Presenting the information in this way allows everyone to be familiar with the format and quickly find the items they need without missing anything.
  1. Copy the output from inxi (including the command) and paste it into your post.
  • To make it more readable, add 3 backticks ``` on an extra line before and after the pasted text.

Have you already :mag: for your problem in the forum ? (Wisdom lies in asking → listening → reading :wink: )


What does printenv tell ?

printenv|grep ssh
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXxQxL95/agent.1918537
SSH_KEY_PATH=~/.ssh/rsa_id

I am using Gnome together with zsh.

Maybe it is a good idea to put something like this into the .zshrc?
eval $(ssh-agent) && ssh-add ~/.ssh/id_rsa &>/dev/null
But this all seems weird to me, this is the first and only operating system where this wasnt working by default.

System:
  Kernel: 6.1.38-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-6.1-x86_64
    root=UUID=0d01ed0a-7107-4643-800a-2773dc961698 rw rootflags=subvol=@ quiet
    cryptdevice=UUID=42bff48f-65a3-4aa1-981e-20b01eb11185:luks-42bff48f-65a3-4aa1-981e-20b01eb11185
    root=/dev/mapper/luks-42bff48f-65a3-4aa1-981e-20b01eb11185 splash
    apparmor=1 security=apparmor
    resume=/dev/mapper/luks-38ae6655-ae99-452e-b2ee-52199fdd7cac
    udev.log_priority=3
  Desktop: GNOME v: 44.3 tk: GTK v: 3.24.38 wm: gnome-shell dm: GDM v: 44.1
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: Gigabyte model: B550M AORUS ELITE v: x.x serial: N/A
    UEFI: American Megatrends LLC. v: F13a date: 01/27/2021
Battery:
  Message: No system battery data found. Is one present?
Memory:
  System RAM: total: 32 GiB available: 31.29 GiB used: 5.11 GiB (16.3%)
  Array-1: capacity: 128 GiB slots: 4 modules: 2 EC: None
    max-module-size: 32 GiB note: est.
  Device-1: DIMM 0 type: no module installed
  Device-2: DIMM 1 type: DDR4 detail: synchronous unbuffered (unregistered)
    size: 16 GiB speed: 2666 MT/s volts: curr: 1.2 min: 1.2 max: 1.2
    width (bits): data: 64 total: 64 manufacturer: G.Skill
    part-no: F4-3600C18-16GVK serial: N/A
  Device-3: DIMM 0 type: no module installed
  Device-4: DIMM 1 type: DDR4 detail: synchronous unbuffered (unregistered)
    size: 16 GiB speed: 2666 MT/s volts: curr: 1.2 min: 1.2 max: 1.2
    width (bits): data: 64 total: 64 manufacturer: G.Skill
    part-no: F4-3600C18-16GVK serial: N/A
CPU:
  Info: model: AMD Ryzen 5 5600X socket: AM4 bits: 64 type: MT MCP arch: Zen 3+
    gen: 4 level: v3 note: check built: 2022 process: TSMC n6 (7nm)
    family: 0x19 (25) model-id: 0x21 (33) stepping: 0 microcode: 0xA201009
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB L3: 32 MiB
    desc: 1x32 MiB
  Speed (MHz): avg: 2450 high: 3700 min/max: 2200/4650 boost: enabled
    base/boost: 3700/4650 scaling: driver: acpi-cpufreq governor: schedutil
    volts: 1.1 V ext-clock: 100 MHz cores: 1: 3700 2: 2200 3: 2200 4: 2200
    5: 2200 6: 2200 7: 2200 8: 2200 9: 2200 10: 2200 11: 3700 12: 2200
    bogomips: 88668
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
    constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total
    cqm_occup_llc cr8_legacy cx16 cx8 de decodeassists erms extapic
    extd_apicid f16c flushbyasid fma fpu fsgsbase fsrm fxsr fxsr_opt ht
    hw_pstate ibpb ibrs ibs invpcid irperf lahf_lm lbrv lm mba mca mce
    misalignsse mmx mmxext monitor movbe msr mtrr mwaitx nonstop_tsc nopl npt
    nrip_save nx ospke osvw overflow_recov pae pat pausefilter pclmulqdq
    pdpe1gb perfctr_core perfctr_llc perfctr_nb pfthreshold pge pku pni popcnt
    pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a rdtscp rep_good sep sha_ni
    skinit smap smca smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor
    svm svm_lock syscall tce topoext tsc tsc_scale umip v_spec_ctrl
    v_vmsave_vmload vaes vgif vmcb_clean vme vmmcall vpclmulqdq wbnoinvd wdt
    xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU116 [GeForce GTX 1650] vendor: Gigabyte driver: nvidia
    v: 535.54.03 alternate: nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-07) arch: Turing code: TUxxx
    process: TSMC 12nm FF built: 2018-22 pcie: gen: 2 speed: 5 GT/s lanes: 16
    link-max: gen: 3 speed: 8 GT/s bus-ID: 07:00.0 chip-ID: 10de:2188
    class-ID: 0300
  Device-2: Logitech Webcam C310 driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-1:2 chip-ID: 046d:081b
    class-ID: 0102 serial: <filter>
  Display: server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.2
    compositor: gnome-shell driver: X: loaded: nvidia gpu: nvidia display-ID: :1
    screens: 1
  Screen-1: 0 s-res: 5120x1440 s-size: <missing: xdpyinfo>
  Monitor-1: DP-0 pos: right res: 2560x1440 hz: 60 dpi: 118
    size: 553x311mm (21.77x12.24") diag: 634mm (24.98") modes: N/A
  Monitor-2: HDMI-0 pos: primary,left res: 2560x1440 hz: 60 dpi: 118
    size: 553x311mm (21.77x12.24") diag: 634mm (24.98") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 535.54.03 renderer: NVIDIA GeForce GTX
    1650/PCIe/SSE2 direct-render: Yes
Audio:
  Device-1: NVIDIA TU116 High Definition Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 07:00.1 chip-ID: 10de:1aeb class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 09:00.4 chip-ID: 1022:1487 class-ID: 0403
  Device-3: Logitech Webcam C310 driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-1:2 chip-ID: 046d:081b
    class-ID: 0102 serial: <filter>
  API: ALSA v: k6.1.38-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 0.3.73 status: n/a (root, process) tools: pw-cli
  Server-3: PulseAudio v: 16.1 status: active (root, process)
    with: pulseaudio-alsa type: plugin tools: pacat,pactl
Network:
  Device-1: Intel Wi-Fi 6 AX210/AX211/AX411 160MHz driver: iwlwifi v: kernel
    pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 8086:2725
    class-ID: 0280
  IF: wlp4s0 state: down mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: f000 bus-ID: 06:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel AX210 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-7:5 chip-ID: 8087:0032
    class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 2 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
  Device-1: luks-42bff48f-65a3-4aa1-981e-20b01eb11185 maj-min: 254:0
    type: LUKS dm: dm-0 size: 922.41 GiB
  Components:
  p-1: nvme1n1p2 maj-min: 259:6 size: 922.42 GiB
  Device-2: luks-38ae6655-ae99-452e-b2ee-52199fdd7cac maj-min: 254:1
    type: LUKS dm: dm-1 size: 8.8 GiB
  Components:
  p-1: nvme1n1p3 maj-min: 259:7 size: 8.8 GiB
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 1.36 TiB used: 259.64 GiB (18.6%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: SSD 970 EVO Plus 500GB size: 465.76 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 2B2QEXM7 temp: 36.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:1 vendor: Samsung
    model: SSD 970 EVO Plus 1TB size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 2B2QEXM7 temp: 39.9 C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 922.41 GiB size: 922.41 GiB (100.00%)
    used: 259.64 GiB (28.1%) fs: btrfs block-size: 4096 B dev: /dev/dm-0
    maj-min: 254:0 mapped: luks-42bff48f-65a3-4aa1-981e-20b01eb11185 label: N/A
    uuid: 0d01ed0a-7107-4643-800a-2773dc961698
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 752 KiB (0.2%) fs: vfat block-size: 512 B dev: /dev/nvme1n1p1
    maj-min: 259:5 label: N/A uuid: F2E3-4409
  ID-3: /home raw-size: 922.41 GiB size: 922.41 GiB (100.00%)
    used: 259.64 GiB (28.1%) fs: btrfs block-size: 4096 B dev: /dev/dm-0
    maj-min: 254:0 mapped: luks-42bff48f-65a3-4aa1-981e-20b01eb11185 label: N/A
    uuid: 0d01ed0a-7107-4643-800a-2773dc961698
  ID-4: /var/cache raw-size: 922.41 GiB size: 922.41 GiB (100.00%)
    used: 259.64 GiB (28.1%) fs: btrfs block-size: 4096 B dev: /dev/dm-0
    maj-min: 254:0 mapped: luks-42bff48f-65a3-4aa1-981e-20b01eb11185 label: N/A
    uuid: 0d01ed0a-7107-4643-800a-2773dc961698
  ID-5: /var/log raw-size: 922.41 GiB size: 922.41 GiB (100.00%)
    used: 259.64 GiB (28.1%) fs: btrfs block-size: 4096 B dev: /dev/dm-0
    maj-min: 254:0 mapped: luks-42bff48f-65a3-4aa1-981e-20b01eb11185 label: N/A
    uuid: 0d01ed0a-7107-4643-800a-2773dc961698
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 8.8 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/dm-1 maj-min: 254:1
    mapped: luks-38ae6655-ae99-452e-b2ee-52199fdd7cac label: swap
    uuid: 5ca8ef2a-4fb0-46d1-b921-f91756e81df0
Unmounted:
  ID-1: /dev/nvme0n1p1 maj-min: 259:2 size: 512 MiB fs: vfat label: N/A
    uuid: 6767-C67B
  ID-2: /dev/nvme0n1p2 maj-min: 259:3 size: 4 GiB fs: swap label: N/A
    uuid: 4bea963b-6f67-4eab-8b89-df3f32ed597c
USB:
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 10 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 1-1:2 info: Logitech Webcam C310 type: video,audio
    driver: snd-usb-audio,uvcvideo interfaces: 4 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 power: 500mA
    chip-ID: 046d:081b class-ID: 0102 serial: <filter>
  Device-2: 1-5:3 info: Logitech G631 Keyboard type: keyboard,mouse,HID
    driver: hid-generic,usbhid interfaces: 3 rev: 2.0 speed: 12 Mb/s (1.4 MiB/s)
    lanes: 1 mode: 1.1 power: 98mA chip-ID: 046d:c53d class-ID: 0300
  Hub-2: 1-6:4 info: Realtek RTS5411 Hub ports: 4 rev: 2.1
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 0bda:5411
    class-ID: 0900
  Device-1: 1-7:5 info: Intel AX210 Bluetooth type: bluetooth driver: btusb
    interfaces: 2 rev: 2.0 speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1
    power: 100mA chip-ID: 8087:0032 class-ID: e001
  Device-2: 1-10:6 info: Integrated Express RGB LED Controller type: HID
    driver: hid-generic,usbhid interfaces: 1 rev: 2.0 speed: 12 Mb/s (1.4 MiB/s)
    lanes: 1 mode: 1.1 power: 100mA chip-ID: 048d:5702 class-ID: 0300
  Hub-3: 2-0:1 info: super-speed hub ports: 4 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-4: 3-0:1 info: hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-5: 4-0:1 info: super-speed hub ports: 4 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-6: 5-0:1 info: hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-7: 6-0:1 info: super-speed hub ports: 4 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 49.5 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 378 Uptime: 20h 13m wakeups: 2 Init: systemd v: 253
  default: graphical tool: systemctl Compilers: gcc: 13.1.1 clang: 15.0.7
  Packages: pm: pacman pkgs: 1449 libs: 398
  tools: gnome-software,pamac,trizen,yay pm: flatpak pkgs: 0 Shell: Zsh (sudo)
  v: 5.9 default: Bash v: 5.1.16 running-in: gnome-terminal inxi: 3.3.28

Mine gives no result.

Mine contains :

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
    common-aliases
    git
    compleat
    perms
    systemd
    ssh-agent
    history-substring-search
)

Here we go. Plugins=( ssh-agent)
I did not know that this would exist.
This is actually a good temporary solution.
It just annoys me that it then asks for the ssh password every single time I open a terminal tab…

The printenv command outputs this single line:
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXDCNvJC/agent.28639

cat ~/.ssh/config
ControlMaster auto
ControlPath /home/$YourName/.ssh/tmp/%h_%p_%r
ControlPersist 1h
VisualHostKey yes
AddKeysToAgent yes

It is also possible to load an ssh-agent at GUI-startup
image

If the agent is loaded early, it may be shared between terminals

1 Like

Hey,
Thanks for your help.

The config change is fantastic. This actually works amazing.

Thank you

Please do not forget to create /home/$YourUserName/.ssh/tmp to get the full benefit :wink:

Thanks for reminding me. I did that after I got an error message when first running this :smiley:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.