Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Add support for SSH publickey authentication #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lamhoangtung
Copy link

Hi, thanks for the great tools.

Since I hate to copy paste password to login to the server and also hate to mange many SSH key. I usually use my default SSH key to authenticate. That's why submitted this PR so everyone like me can just authenticate instantly without any hassle.

Hope you could merge this :P. Thanks a lot again

@demotomohiro
Copy link
Owner

Public key authentication is allowed in default and the default value of AuthorizedKeysFile is ".ssh/authorized_keys".
You can use public key authentication by adding code that save your public key to .ssh/authorized_keys.

For example:

!pip install git+https://github.com/demotomohiro/remocolab.git
import remocolab
remocolab.setupSSHD()

!mkdir /home/colab/.ssh
with open("/home/colab/.ssh/authorized_keys", 'w') as f:
  f.write("Content of my public key")
!chown colab /home/colab/.ssh /home/colab/.ssh/authorized_keys
!chmod 700 /home/colab/.ssh
!chmod 600 /home/colab/.ssh/authorized_keys

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants