Merge lp:~saviq/phablet-tools/shell-no-mangle-keys into lp:phablet-tools

Proposed by Michał Sawicz
Status: Needs review
Proposed branch: lp:~saviq/phablet-tools/shell-no-mangle-keys
Merge into: lp:phablet-tools
Diff against target: 25 lines (+9/-6)
1 file modified
phablet-shell (+9/-6)
To merge this branch: bzr merge lp:~saviq/phablet-tools/shell-no-mangle-keys
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+232787@code.launchpad.net

Commit message

[shell] Only mangle the authorized_keys file if it doesn't exist already

Description of the change

When someone manages their authorized_keys manually, phablet-shell didn't help with overwriting them all the time.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

295. By Michał Sawicz

[shell] Only mangle the authorized_keys file if it doesn't exist already

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'phablet-shell'
--- phablet-shell 2014-05-28 11:59:44 +0000
+++ phablet-shell 2014-08-30 11:08:33 +0000
@@ -76,12 +76,15 @@
76# (it changes every time the device is reflashed and this is expected)76# (it changes every time the device is reflashed and this is expected)
77ssh-keygen -f ~/.ssh/known_hosts -R [localhost]:$PORT77ssh-keygen -f ~/.ssh/known_hosts -R [localhost]:$PORT
7878
79# Copy your ssh id down to the device so you never need a password.79# Only mangle the authorized_keys file if it doesn't exist already
80NEWEST_KEY=$(ls -t ~/.ssh/*.pub | grep -v -- -cert.pub | head -1)80if ! adb pull /home/phablet/.ssh/authorized_keys /dev/null; then
81adb push $NEWEST_KEY /home/phablet/.ssh/authorized_keys81 # Copy your ssh id down to the device so you never need a password.
82adb shell chown phablet:phablet -R /home/phablet/.ssh/82 NEWEST_KEY=$(ls -t ~/.ssh/*.pub | grep -v -- -cert.pub | head -1)
83adb shell chmod 700 /home/phablet/.ssh83 adb push $NEWEST_KEY /home/phablet/.ssh/authorized_keys
84adb shell chmod 600 /home/phablet/.ssh/authorized_keys84 adb shell chown phablet:phablet -R /home/phablet/.ssh/
85 adb shell chmod 700 /home/phablet/.ssh
86 adb shell chmod 600 /home/phablet/.ssh/authorized_keys
87fi
8588
86# Copy your bash config down to the device so you get the benefit of your89# Copy your bash config down to the device so you get the benefit of your
87# colourful $PS1 prompt and any bash aliases that you may be used to from your90# colourful $PS1 prompt and any bash aliases that you may be used to from your

Subscribers

People subscribed via source and target branches