I have a Django project on my laptop. It works perfectly fine on my machine.
This web app takes input from the user in the form of an image and reads the content in it. If the content is already present on the database, it runs a Linux command on a different machine. Both machines are connected to the same network.
Currently, I am using SSH to connect to the other machine but it asks for password every time. Is there any way I can eliminate the need for entering a password every time I want to run a command?
Advertisement
Answer
Solution 1: use SSH pre-shared key to login via SSH without a password. See this link for how to do it. After you have configured it properly, you are able to run a command on your server:
ssh hostname-or-ip-of-the-raspi command arg1 arg2 ...
and will execute command arg1 arg2 ...
on the Raspberry PI, without being prompted for a password.
Solution 2: use TCP communication, and write a server for the Raspberry PI and a client for your server. You can use raw sockets, or some high level library such as zmq
.