Dominique Meeùs
Dernière modification le   
retour à la table des matières — à l’index — à ma page de départ

Connecter son téléphone Ubuntu Touch en SSH

Up: Ubuntu Touch Previous: Accepter un appel téléphonique Next: Gestion des applications

D’après Ask Ubuntu : how-can-i-access-my-ubuntu-phone-over-ssh. À domicile, l’ordinateur et le téléphone, connecté en WiFi, appartiennent au même réseau local.

  1. If you don’t already have an ssh keypair, type ssh-keygen on your computer and follow the instructions to generate one.
  2. Install the Terminal app on the phone from the App Store.
  3. Open a terminal on the phone and type (this is easier with the phone in a landscape orientation) :
    sudo android-gadget-service-enable ssh
    mkdir -pm700 ~/.ssh
    ip addr | grep inet
    nc -l 1234 > ~/.ssh/authorized_keys
    (the last command will hang ; this is expected ; leave it waiting for step 5)
  4. Look for your phone’s IP address in the Terminal as returned by the ip addr command above.
  5. On your computer, type (replacing 192.0.2.1 with your phone’s IP address from above and id_rsa.pub with the filename of your public key) :
    nc 192.0.2.1 1234 < ~/.ssh/id_rsa.pub
    If successful, the last command on your phone’s Terminal will now succeed.
  6. On your computer, type (again replacing 192.0.2.1 with your phone’s IP address from above) :
    ssh phablet@192.0.2.1
  7. If your phone’s IP address changes, you will need to use ip addr in the Terminal app on your phone again and adjust your ssh command accordingly.

On peut alors, par exemple, parcourir les fichiers avec Nautilus ou Nemo : Se connecter à un serveur… en SSH comme utilisateur phablet.

Ces détours relativement compliqués ne sont que pour la première fois. Ensuite, le PC et le smartphone se reconnaissent et on se connecte immédiatement. Sur un autre PC, il faudra recopier la clef et, à la première connexion, en introduire le mot de passe. Sur un réseau où l’adresse IP peut changer, il faudra réutiliser la commande ip addr | grep inet au terminal du téléphone.

Up: Ubuntu Touch Previous: Accepter un appel téléphonique Next: Gestion des applications