Skip to content

Instantly share code, notes, and snippets.

@davglass
Created December 21, 2010 01:13
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davglass/749325 to your computer and use it in GitHub Desktop.
Save davglass/749325 to your computer and use it in GitHub Desktop.
Setting up ssh keys and ssh-agent on ChromeOS in developer mode
## Developer Mode must be enabled..
## Hit "Ctrl + Atl + Right Arrow" (Right arrow is where F2 should be)
## Login with chronos
qemacs .profile
##Add this to your .profile
alias ll='ls -la'
alias ssh='ssh -F ~/.ssh/config -i ~/.ssh/id_rsa'
SSH_ENV=~/.ssh/environment
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add ~/.ssh/id_rsa;
}
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
## Ctrl + X S; Ctrl + X C (to save and close)
mkdir ~/.ssh
cd .ssh
## Now SSH your keys into this directory
qemacs config
## Add this to your config
User davglass (Use your username)
## This is needed because we are logged into the machine as chronos, this tells ssh to use this username as default when starting a connection.
## There are 2 terminals in ChromeOS and they both act differently..
## One is (Ctrl + Alt + =>) the other is (Ctrl + Alt + T)
## This will work for the C+A+> terminal, but not C+A+T.
## So let's fix that (partly)
cd /home/chronos
rm -rRf .ssh
rm .profile
ln -s user/.ssh ./
ln -s user/.profile ./
## Now, when you log in with Ctrl + Alt + T you will be in the crosh shell. From here, type "shell"
## This shell doesn't source your profile and your home dir is screwed up, so you need to do that each time you open this shell
cd && source .profile
## All done!
## Now you can just `ssh server`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment