In this post, we’ll cover how to run a SSH server directly on Chrome OS (ie not into a Crouton chroot).
One of the first things I do on any machine (FreeBSD, Linux, Mac OS X or Windows) is to install, run and configure the SSH server. It’s always convenient to be able to scp from and to a computer, or to log in remotely. Even for workstations.
Chrome OS is a reasonable if minimal standard Linux installation offering access to iptables and sshd (and openvpn by the way), so it’s as easy to run sshd and to allow incoming traffic on port 22.
1. If it’s not already done, switch your chromebook in developer mode, so you can execute commands as root.
Do a backup of your data, as you’ll wipe your current Chrome OS partitions.
On most recent machines, restart in recovery mode (ESC + REFRESH + POWER), then when it boots, CTRL + D to enter the developer mode.
Hit enter to turn off OS verification. It will then restart. Now and everytime after, you’ll need to do a CTRL + D to boot.
It will then wipe your chromebook and reinstall a fresh Chrome OS version. The process takes 6 to 7 minutes.
Former machines require to use an hardware switch, generally located below the battery. Be gentle with this switch, it breaks easily.
2. Launch a console with the shorcut ctrl + alt + t, then write
shell to open a full bash shell (if the shell command isn’t available, you aren’t in developer mode).
Become root with
3. Setup SSH keys :
mkdir -m 0711 /mnt/stateful_partition/etc/ssh
ssh-keygen -t rsa -f ssh_host_rsa_key
ssh-keygen -t dsa -f ssh_host_dsa_key
4. Run SSH:
5. Allow world to connect to port 22:
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
6. Add your public keys to ~chronos/.ssh/authorized_keys file. Authentication by password isn’t available.
7. You’re now able to log in from the world to your chromebook.
Andrew Sutherland, cr-48 chromium os ssh server, 14 January 2011.
CentOS wiki contributors, IPTables, CentOS wiki.