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,528
  • 5
  • 38
  • 46
sarvesh.lad
  • 2,534

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,540