sshfs autostart

I wrote a bash script to mount my home FreeBSD server

Code:
#!/usr/local/bin/bash
sshfs kclark@192.168.15.206:/usr/home/kclark /mnt/server -o idmap=user -o allow
_other

When it's run I'm prompted for my password but here's my question. How do I edit the script so I'm not prompted for the password so it can be ran at startup and ready to roll when xfce is loaded?
 
kr651129 said:
I wrote a bash script to mount my home FreeBSD server

Code:
#!/usr/local/bin/bash
sshfs kclark@192.168.15.206:/usr/home/kclark /mnt/server -o idmap=user -o allow
_other

When it's run I'm prompted for my password but here's my question. How do I edit the script so I'm not prompted for the password so it can be ran at startup and ready to roll when xfce is loaded?

Simple. You just need to set up proper ssh key-based authorization.
SSH needs to connect to server using ssh private key. You probably need to store this in ~/root/.ssh/ if you want to auto connect.

My question: Why do you use /usr/local/bin/bash and not /bin/sh?


P.S.
Private ssh key must also be saved without password.
 
Awesome, that did the trick. Thank you! I used that because it's what was returned when I did

Code:
$ which bash

I'm going to have my script auto run using xfce's settings, but if I wanted to add it via /etc/rc.conf what would be the proper way to do this?
 
Back
Top