Conor Schaefer on 9 Jan 2011 16:16:39 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] sshfs mounts on laptop


On 01/09/2011 04:40 PM, brent timothy saner wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/09/11 15:11, Lee Marzke wrote:
Does anyone have recommendations / scripts for mounting sshfs filesystems
that I want always mounted at login to my laptop.

I would prefer to not have to type another password ( I have full disk
encryption,
and so already enter 2 passwords )

I guess this might need a option / or timeout if I'm traveling and don't
have the VPN up.

Lee


set up pubkey auth. no password needed and more secure than password
auth. if you're looking for an actual script to run on login, let me
know and i can type up a quick one for you and tell you how to get it to
run on login.
I'm very interested in suggestions. I've been running this as a script:

#!/bin/bash
#The goal of this script is to create an SSH tunnel for mounting
#Samba shares from remote locations. What follows is a description
#of the options used to achieve this effect:

#-E preserves the user environment, overriding the root environment
#invoked by sudo (which is necessary to assign ports such as 139)
#-f forks the ssh process into the background, freeing up the terminal in which it was run. #-F forces the use of the user's SSH config file (specified here in the default location) #-N declares that no command will be run on the remote server, which is necessary to fork (-f) #-L creates the bind between remote and local ports, specified here as 139 to handle Samba

sudo service smbd stop
sudo -E ssh -f -F /home/USERNAME/.ssh/config REMOTESERVER[ok to use abbreviations from .ssh/config here] -N -L 139:localhost:139

echo
echo -n "Press Enter to exit this script gracefully."
read answer

echo "Restarting Samba daemon and removing port-bind. Goodbye!"

#sudo servide smdb start
exit 0

I haven't actually figured out a way to remap the port bind, though. Never looked into using SSHFS. Seems a lot easier than this, and still easier than using a VPN, naturally, which is way I wrote this script in the first place.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0qK2cACgkQ8u2Zh4MtlQpDdwCbBohnbvYRgaQm6kvRrkZLqD7T
FEcAmwfYp2dKrso6bnnbV9MfPPXKsEjo
=sDVD
-----END PGP SIGNATURE-----
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug