This ROS project is a simple ssh daemon adapted from the sshd example bundled with libssh. It accepts connections from my ClipbotCtrl Android app and forwards the joystick input it receives to an Arduino as Twist messages via rosserial. The Arduino code is here.
sudo apt-get install libssh-4
sudo apt-get install libssh-dev
sudo apt-get install ros-kinetic-rosserial
(not needed to compile but is run in the launch file)
cd ~/catkin_ws/src
git clone https://github.com/static55/clipbot_sshd.git
user@clipbot:~/catkin_ws/src/$ cd ~
user@clipbot:~$ mkdir clipbot_sshd_keys
user@clipbot:~$ cd clipbot_sshd_keys
user@clipbot:~/clipbot_sshd_keys$ ssh-keygen -t DSA
Generating public/private DSA key pair.
Enter file in which to save the key (/home/user/.ssh/id_dsa): ./ssh_host_dsa_key
Enter passphrase (empty for no passphrase): <Hit return>
Enter same passphrase again: <Hit return>
Your identification has been saved in ./ssh_host_dsa_key.
Your public key has been saved in ./ssh_host_dsa_key.pub.
user@clipbot:~/clipbot_sshd_keys$ ssh-keygen -t RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): ./ssh_host_rsa_key
Enter passphrase (empty for no passphrase): <Hit return>
Enter same passphrase again: <Hit return>
Your identification has been saved in ./ssh_host_rsa_key.
Your public key has been saved in ./ssh_host_rsa_key.pub.
- Change the hardcoded username 'user' and password 'pass' in
userAuthenticated()
- Update the
ssh_bind_options_set()
calls with the paths to your keys
cd ~/catkin_ws
catkin_make
catkin_make install
roslaunch clipbot_sshd clipbot_sshd.launch
Public Domain. Do whatever you want with it.