Skip to content

Error occuring when trying to clone github repo with SSH credentials using rugged #347

@gabriel403

Description

@gabriel403

When trying to clone a remote repo with Rugged, I keep getting the error
Failed to authenticate SSH session: Unable to open public key file

I add my ssh credentials fine, but when I come to doing the clone the above error occurs.

cred = Rugged::Credentials::SshKey.new({username: 'gabriel403', publickey: publickey, privatekey: privatekey})
Rails.logger.debug cred

Where publickey and privatekey are string holding the keys.

repo = Rugged::Repository.clone_at('[email protected]:gabriel403/dotfiles.git', '/tmp/dotfiles', {credentials: cred})
Rails.logger.debug repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions