This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 270
Ubuntu Android Guide android setup
Harsh Shandilya edited this page Apr 26, 2020
·
2 revisions
sudo apt-get install openssh-client openssh-server
git init --bare ~/pass-repo
pass git init
pass git remote add origin ssh://oren@localhost:/home/oren/pass-repo
pass git push origin master
Explanation: these commands create a git repository that stores the encrypted passwords. The repository is located at ~/pass-repo
and is needed in order to allow your phone to pull and push passwords.
ssh-keygen -t rsa -b 4096
Enter file in which to save the key (/home/msfjarvis/.ssh/id_rsa): pass_store
Explanation: this command create two files: pass_store and pass_store.pub. Those are SSH keys that allow your phone to authenticate with your laptop
cat pass_store.pub >> ~/.ssh/authorized_keys
Explanation: adding the public ssh key to the authorized_keys file will allow your phone (which will have the private key) to authenticate with your laptop
- Enable USB Debugging on your phone (google for it. It depends on your Android)
- Connect a USB cable from your phone to your laptop
- Pick 'Transfer files' on the phone
sudo apt-get install android-tools-adb
adb push pass_store /sdcard/
adb shell chmod 644 /sdcard/pass_store
Explanation: adb push
copy the private SSH key to your phone. /sdcard/ on Android is a symlink to internal storage so you can push to it without needing to poke into /mnt
- Open the Password Store app on your phone
- Click on the three dots at the top right -> Settings -> Import SSH key
- Click on the three dots at the top right -> Show internal storage -> Click on the three horizontal lines on the top left -> Click on your phones icon
- Find the pass_store file and click it. Notice the message: 'SSH file imported'
Remove the key from your phone
adb shell rm /sdcard/pass_store
- Open the Password Store app on your phone
- Click on the three dots at the top right -> Settings -> 'Edit git server settings'
Fill-in the server info:
Username: my laptop's user
Server URL: my laptop's url
repo path: pass-repo
- Click 'SAVE'
- Click the left arrow at the top left
- Click on the three dots at the top right -> 'pull from remote'