如題:git創(chuàng)建密匙時(shí)報(bào)錯(cuò)Too many arguments。
前幾天我遇見(jiàn)了一個(gè)問(wèn)題,git需要重新創(chuàng)建密匙,運(yùn)行命令ssh-keygen -t rsa -b 4096 -C " [email protected] "時(shí)報(bào)錯(cuò)。
Too many arguments.
usage: ssh-keygen [-q] [-b bits] [-t dsa | ecdsa | ed25519 | rsa | rsa1]
[-N new_passphrase] [-C comment] [-f output_keyfile]
ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
ssh-keygen -i [-m key_format] [-f input_keyfile]
ssh-keygen -e [-m key_format] [-f input_keyfile]
ssh-keygen -y [-f input_keyfile]
ssh-keygen -c [-P passphrase] [-C comment] [-f keyfile]
ssh-keygen -l [-v] [-E fingerprint_hash] [-f input_keyfile]
ssh-keygen -B [-f input_keyfile]
ssh-keygen -D pkcs11
ssh-keygen -F hostname [-f known_hosts_file] [-l]
ssh-keygen -H [-f known_hosts_file]
ssh-keygen -R hostname [-f known_hosts_file]
ssh-keygen -r hostname [-f input_keyfile] [-g]
ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point]
ssh-keygen -T output_file -f input_file [-v] [-a rounds] [-J num_lines]
[-j start_line] [-K checkpt] [-W generator]
ssh-keygen -s ca_key -I certificate_identity [-h] [-n principals]
[-O option] [-V validity_interval] [-z serial_number] file ...
ssh-keygen -L [-f input_keyfile]
ssh-keygen -A
ssh-keygen -k -f krl_file [-u] [-s ca_public] [-z version_number]
file ...
ssh-keygen -Q -f krl_file file ...
當(dāng)然我第一時(shí)間就去網(wǎng)上查了,網(wǎng)上有人有說(shuō)加引號(hào)包裝,我也是醉了,雖然是解決了問(wèn)題但根本沒(méi)有說(shuō)到點(diǎn)上。
問(wèn)題的解決方式和原因應(yīng)該是這樣的。
首先你會(huì)看到官方提示要你替換成你的電子郵件地址,但是如果你只是粘貼覆的話,你就錯(cuò)了
Github給的粘貼文本中有空格,如果你不小心很容易被坑到,解決方案就是:
1.你眼尖點(diǎn)動(dòng)動(dòng)手把里面的空格刪除
2.在你的郵箱地址外加一層引號(hào),目的是隔絕空格影響~