SSH to your Odroid U3+

If you have set your Odroid to auto-connect to an ad-hoc connection, then you'd be able to SSH to your Odroid (host) through another computer (client).

Connect

From the client:

  1. In order to connect to the ad-hoc connection, first create a shell script file:

    gedit connect.sh
    

    And put the following contents in it:

    #!/bin/sh
    service network-manager stop
    ifconfig wlp2s0 down
    iwconfig wlp2s0 mode ad-hoc
    iwconfig wlp2s0 essid "odroid"
    iwconfig wlp2s0 key 1234567890
    ifconfig wlp2s0 192.168.1.2
    ifconfig wlp2s0 up
    
    
    echo "Connected to ODROID\n"
    
    
    ssh root@192.168.1.1
    

    Where wlp2s0 is my wireless interface. So you must change wlp2s0 and all the variables as you set them up in auto-connect to an ad-hoc connection.

  2. Change the execution bit on the file to make it executable:

    chmod +x connect.sh
    

    And run it:

    ./connect.sh
    

    It might not SSH on the first try, try to run it again if it failed.

Disconnect
  1. To disconnect the client from the ad-hoc connection, create a shell script file:

    gedit disconnect.sh
    

    And put the following contents in it:

    #!/bin/sh
    iwconfig wlp2s0 mode managed
    service network-manager start
    
    
    echo "Disconnected"
    
  2. Change the execution bit on the file to make it executable:

    chmod +x disconnect.sh
    

    And run it:

    ./disconnect.sh
    

    I stop the Network Manager because it might attempt to find a more reliable network which would cause disconnection of the ad-hoc network.

More: ssh, odroid, u3+, ubuntu