3

I want my raspberry device to make its own hotspot when it boots up (Internet not needed), and then ssh to it.

So the two questions I'm actually asking is...

  1. How do I create a hotspot in Linux?

  2. Once connected, how do I successfully SSH to it?

After some digging around, I found hotspotd that can make a hotspot and is pretty easy to configure. After creating the hotspot, I wasn't able to SSH.

I don't mind using an alternate program to make a hotspot, if it works better than this one.

My pi is running Debian.

This question has a slight similarity to my question, but I'd like more technical details and the answer remarks ssh to the correct IP. In my case, I'd like to assign the pi to a static ip, so please add on how to do that.

4
  • After creating the hotspot did you successfully connect to it? – Baroudi Safwen Nov 1 '16 at 15:26
  • Yes, he was able to connect to it. @BaroudiSafwene – Don't Root here plz... Nov 2 '16 at 15:02
  • then typing route -n will give you the IP address of the router, to get a static IP every time the Raspberry pi boots up you want to edit /etc/network/interfaces or you can edit cmdline.txt and add this ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>, eg: ip=192.168.1.200::192.168.1.1:255.255.255.0:rpi:eth0:off . – Baroudi Safwen Nov 2 '16 at 18:32
  • Could you please answer my question, instead of commenting? I can't really follow your comment. @BaroudiSafwene – Don't Root here plz... Nov 3 '16 at 13:07
2
+50

To create a hotspot from a raspberry pi and ssh to it:

  1. sudo apt-get install hostapd
  2. wget https://github.com/prahladyeri/hotspotd/raw/master/dist/hotspotd-latest.tar.gz
  3. tar xvf hotspotd-latest.tar.gz
  4. cd hotspo*
  5. sudo python setup.py install
  6. sudo hotspotd configure: Here, it will ask you for an IP address for the AP, type whatever you want( C class IP of course ), for example: 10.0.0.1
  7. You must be running a dhcpd server to do so, enter:

    sudo dhcpd

  8. Now you can connect to your access point =)

  9. ssh pi@10.0.0.1 now type your password.

Finally, if you want to get an AP everytime the pi boots up, here is a nice answer on how to run a script at start up.
the script can just contain:

sudo hotspotd start

//Forget about my comment it's nonsense


EDIT: I am wrong about C class IPs, the truth is you should use private IPs:

  • 192.168.0.0 - 192.168.255.255 (65,536 IP addresses)
  • 172.16.0.0 - 172.31.255.255 (1,048,576 IP addresses)
  • 10.0.0.0 - 10.255.255.255 (16,777,216 IP addresses)
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.