4

i have a small bash script that mounts my sshfs...

problem is it ask for the server/host password for every mount...

i have four mounts and i have to enter it every time for 4 times and its tiresome, also i want to make it mount at boot/login...

#!/bin/bash

sudo fusermount -u /mnt/ctb
sudo fusermount -u /mnt/dtb
sudo fusermount -u /mnt/etb

sudo sshfs -o allow_other 192.168.1.10:/media/ctb /mnt/ctb
sudo sshfs -o allow_other 192.168.1.10:/media/dtb /mnt/dtb
sudo sshfs -o allow_other 192.168.1.10:/media/etb /mnt/etb

after every mount comman it ask me for the password of a user on the machine 192.168.1.10...

david6
  • 14,499
sarvesh.lad
  • 2,524

1 Answers1

4

You can try generating a ssh key with ssh-keygen on your client system, and place the .ssh/id_rsa.pub public key in .ssh/authorized_keys on the 192.168.1.10 system. See How to harden an SSH server? for more info on this.

Add yourself to the fuse user group, if you haven't. You can use sshfs user@system instead of sudo there if that is set up correctly.

Also read the Ubuntu sshfs wiki if you haven't.

belacqua
  • 23,120
  • did that still no luck – sarvesh.lad Apr 29 '12 at 21:49
  • OKay got it...... just went through my brain for an analytic common sense analysis..

    realised that i was generating ssh-keygen from my account, did it for root user too and bam it works!!!! thanks marking as answered

    – sarvesh.lad Apr 29 '12 at 21:52