How do I set up my own MQTT Server with Mosquitto? [closed] - server

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am setting up a sensor network for my new diy home automation system and am running into a major roadblock. I am using OpenHAB as the "home base" for the system, and since it has an MQTT binding, I figured that would be a good way to have all of the nodes talk with it. I know that I can connect to test.mosquitto.org, which is great for testing. But, obviously, this is not secure enough by far for the permanent server (also, I'm pretty sure they specifically say not to use that server for permanent things).
After a lot of Google-ing I have found a decent amount of info on Mosquitto and MQTT, but honestly most of it is over my head since I am just starting. My question here, that most seem to assume is known already, is how do I actually go about setting up my own MQTT server on the Raspberry Pi that will be running everything? Or is this not the norm, and should I find a public server (like test.mosquitto.org)? That just doesn't seem like the most practical method.
Thanks in advance for your help.

Mosquitto is light enough that you can install it anywhere. I would only use test.mosquitto.org if I was testing as it is public (ie. anyone can see your data!) and isn't always up and working.
When running on the pi I normally add the Mosquitto Debian Repo as it is more upto date. Has v1.3.5
Good instructions on mosquitto.org site or a good beginnners howto over at jpmens, just do the installation upto the TLS part (unless you need it!)

On a raspberry pi
If you just run the following commands:
sudo apt-get update
sudo apt-get install mosquitto
sudo update-rc.d mosquitto defaults
(I'm not 100% sure you need this one but it won't hurt)
sudo /etc/init.d/mosquitto start
(only needed this time, as it should start automatically on reboot)
That will give you a mosquitto broker running on your pi

Related

How can I view a localhost apache website from another computer on the same network? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a Raspberry Pi on my network on which I would like to host a website. I don't want to plug it to a monitor but still be able to work on the website.
So I access it via SSH from my main computer to edit the files etc... but I didn't find a way to view the website from my main computer.
I didn't wrote over the 000-default website but created a new one so I see the default Apache page when I type in http://localhost.
I also tried using ssh -X but my main computer is a Mac and I have issues with making X11 work.
So my question is how can I preview from my Mac an Apache website that is not the default one, when the website is hosted on a Raspberry Pi on my network?
Two methods
Setup a VNC connection
Connect using ssh to RPi and prepare it for VNC using sudo raspi-config
at Interfacing options enable VNC and at Advanced options set the resolution. Then use a VNC client on your MAC to connect to RPi
Useful link: https://www.raspberrypi.org/documentation/remote-access/vnc/
Using Local Forwarding
ssh -L 8080:intra.example.com:80 gw.example.com
This example opens a connection to the gw.example.com and forwards any connection to port 80 on the local machine to port 8080 on intra.example.com.
Useful link: https://www.ssh.com/ssh/tunneling/example

Minecraft server hosted on PC without internet, just a router/modem [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm wondering if its possible to host a Minecraft server on my PC and have my wife connect to that server without any internet connection. We are willing to get a router/modem or switch if need be. We just can't use internet and need instructions on what to get, how to set it up, and how to use it. My hope is that it is possible to have our computers in the same room, plug our PCs into a router that has no internet service via Ethernet cables, turn on the server on my PC, my wife can type in the IP and we can play together.
Yes you can. I am running a Minecraft server on a separate Linux machine, and me and my brother connect to the Minecraft server from separate computers, all of it from our own wireless LAN and without an Internet connection.
We are using a WiFi router that is not connected to the Internet, the computer running the server is an old laptop, and then we have two additional computers, each running an instance of Minecraft, and it all works fine.
I'm not sure about using only a network switch, because you need to be connected at the IP layer, since you need to specify the internal, private IP address of the computer running the Minecraft server from the Minecraft client in order to join.
So in a nutshell, you will need to download and install the Minecraft server, install the latest Java OpenJDK, run the Minecraft server, read the eula, and last in order for this to work completely offline (that is, we want this to work without an Internet connection), you will need to go into the Minecraft server configuration file, locate the property of online-mode=true and set it to online-mode=false.
This setting basically controls whether or not players authenticate to Mojang's servers before they connect to your server, and it prevents players with cracked clients from connecting to your server, but since you will be hosting and joining from within an internal, private network anyways it does not matter. No one will be connecting to your server from the outside world if there is not a connection to the Internet anyway.
For more details about how to install and run a Minecraft server, there are many guides out there. It's actually pretty simple, if you're comfortable using a console screen and know just a little bit about IP addresses and editing a configuration file with a text editor. For me, I run the Mi ecraft server and I was able to connect to it with my brother and start playing right away, without having to mess around with the server at all.
So there you have it, I hope this helps someone.
The very definition of a server is something that provides resources over the internet:
A server is a computer program or a device that provides functionality for other programs or devices, called "clients", over the Internet.
There is a way that would work the way you intend, but without Ethernet, it runs over WiFi. Go into a world, open the Pause menu, and click Open to LAN. Then you can go to a server menu on another computer and it will show up in the LAN Worlds section. However, this will only run vanilla gameplay.
Just FYI, this question would be considered off-topic here and should be asked in the Gaming or Networking communities.
EDIT: Opening to LAN would work over ethernet too.

feature telnet server not available in windows 10 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
In the features of windows 7 we have both telnet client and telnet server. But in windows 10 telnet server is not available, Can anyone please guide on how to install it? And I am also aware that we can use ssh instead of telnet.
Microsoft deprecated Telnet Servers in Windows Server 2012 R2, and subsequently in Windows 10.
Telnet is considered completely insecure these days, because it sends everything across the wire in plain text, so they removed it.
Since you'd need to install a 3rd party Telnet server, you should (instead) consider installing a SSH server. Similar abilities and results, but SSH is generally considered secure.
Perhaps check out this Serverfault question for some suggested SSH servers:
What is a good SSH server to use on Windows?
(Answer from #Ƭᴇcʜιᴇ007 found HERE)
I know I am a tad late to this feed, but I have used the GSW Telnet Server and SSH Server and they have been great. They claim to be the most secure SSH on the market and I have never had any issues with data security at all.
They do have 24/7 support and can help with installation if there are any difficulties.
Hope this helps - Ben

Remote desktop connection to Raspberry Pi without specifying a port [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have a Raspberry Pi running Debian 7 (Wheezy) connected on "Site A", where the network is managed by a third-party company and where all ports are closed to the Internet (for security reasons). So, there is no way for me to do any port forwarding to VNC, nor SSH or anything else. That means I just can't access it in any way other than locally, on-site.
However, I need to connect to that device on the X Desktop session (graphical interface) to do some maintenance, and I am located in let's say "Site B", which is nearly 300 miles away from site A.
I know you can do such tasks on Windows or x86 Linux computers with TeamViewer (we use it for our other hardware in the same location and it works like a charm), but since the Raspberry Pi is based on an ARM architecture, it isn't supported by TeamViewer yet.
If anyone has ever achieved this, I would be glad to hear how to do it!
Since you have no ssh access, I can safe you from going on site A once.
I would setup a reverse ssh tunnel for ssh and VNC to a computer on the raspberry:
nohup ssh -N -R 3000:localhost:22 you#site-b &
nohup ssh -N -R 3001:localhost:5900 you#site-b &
You might implement some "watchog" which reconnects the tunnels if they should get disconnected for some reason. I assume that a VNC server is already running on the raspberry.
On site B you can now use:
ssh -p 3000 localhost # ssh to raspberry.
or VNC to the raspberry using localhost:3001

SELinux and multiple httpd service context [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Using CentOS 6
I have 2 Apache httpd services running. The first one provides REST interfaces and a UI to manage the operating system (start/stop services, execute system command using suid, modify system settings, etc.). This httpd service (running on port 5555) will only be accessible from a certain ip range (firewall) since it will be used for administrative purposes.
The second httpd service (port 80 and 443) will be visible on the Internet. It will serve a web application to external customers.
The first httpd needs selinux policies that give it more access to the OS files/processes. The second needs selinux policies that are strict to what it is allowed to do within its context. The second needs to be this way for better web application security and prevent any web app exploits from even being able to touch the OS.
Both of the httpd processes are running as different users.
Can selinux be used with 2 different sets of policies for the same httpd executable?
How do I/is it possible to set the httpd process context to switch to another set of policies when httpd starts?
Is it just a matter of making a copy of the httpd binary and change its selinux context that uses all new policies (relabel the httpd binary, but I'm sure it will take more than this)?
What are the steps to copy the existing httpd selinux settings to a new name?
I think this comes down to needing a httpdpublic and httpdprivate selinux context. Anyone done anything like this before that could give some guidance or suggest alternative solutions? Thanks