Github multiple accounts one computer always sees one account

Возможно, это не ошибка; я прочитал много подобных проблем на StackOverflow, но не этот вопрос.

Я пытаюсь использовать несколько учетных записей git на Ubuntu Linux, и всякий раз, когда я пытаюсь выполнить push со второй учетной записи, он думает, что я все еще использую имя пользователя первой учетной записи.

$ git push -u origin master
ERROR: Permission to <act2>/<repo>.git denied to <act1>.

Сначала я попробовал метод с несколькими SSH-ключами. Когда я получил вышеуказанную ошибку, я создал совершенно нового пользователя на своей локальной машине, вошел в систему под этим пользователем, заново создал локальное репо (его первый push) и повторил попытку. Та же ошибка. Мой локальный .config показывает пользователя как и мой ~/.gitconfig.

Есть идеи?

Я делаю: ssh @localhost затем ssh -vvv -T git@github.com

Я получаю интересный результат. Кажется, что он идет и находит ключ в моей учетной записи. Но каким-то образом он использует ключ в моей учетной записи, к которому у него не должно быть доступа.


debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home//.ssh/known_hosts:1
debug2: bits set: 513/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: Wrote 16 bytes for a total of 1015
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug3: Wrote 48 bytes for a total of 1063
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key:  
debug2: key:  
debug2: key: /home//.ssh/identity ((nil))
debug2: key: /home//.ssh/id_rsa ()
debug2: key: /home//.ssh/id_dsa ((nil))
debug3: Wrote 64 bytes for a total of 1127
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,gssapi,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: 
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 368 bytes for a total of 1495
debug1: Authentications that can continue: publickey
debug1: Offering public key: 
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 368 bytes for a total of 1863
debug1: Remote: Forced command: gerve 
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp 
debug3: sign_and_send_pubkey
debug3: Wrote 640 bytes for a total of 2503
debug1: Remote: Forced command: gerve 
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug3: Wrote 128 bytes for a total of 2631
debug2: callback start
...
7
задан AndrewStone 2 November 2011 в 19:44
поделиться