Hello all,
First time posting, although the site has helped solve many problems in the past!
I would like to create a script to simplify a series of commands that I run:
Log into the ssh-server (RSA key)
ssh username@hostname -p 6110
Once there, I mount a truecrypt volume:
truecrypt /media/uhd/container ~/mnt
After entering the password to complete the mount, I log out from the ssh-server
exit
I then mount those files locally:
sshfs username@hostname:~/mnt /media/remote -p 6110
Once I have finished working, I unmount the remote volume:
fusermount -u /media/remote
I then log back onto the ssh-server to unmount the truecrypt container:
ssh username@hostname -p 6110
truecrypt -d
I've made some simple scripts for vnc through ssh, but I've not managed to make much headway on scripting this.
I'm presuming I'll need two scripts: one to mount the truecrypt container and then mount that locally, and another script to dismount the remote container then dismount from truecrypt.
Any pointers on how to go about this would be very much appreciated! (and indeed whether I can refine the process)
-- Added with regard to alternative method --
Although I can mount the drive locally then use truecrypt locally:
sshfs -p 6110 username@hostname:/media/uhd/ /media/remote -o allow_other
The (lack of) speed in accessing the truecrypt contents makes it unworkable. I've put this down to the very slow server
---------- Post updated 04-06-11 at 03:44 AM ---------- Previous update was 04-05-11 at 02:05 PM ----------
Well, I'm still not getting very far with this one.
If I try the following:
#!/bin/bash
ssh -v -p 6110 username@hostname 'truecrypt /media/uhd/container ~/mnt'
It just hangs indefinitely after sending command: truecrypt /media/uhd/container ~/mnt ... which is the point at which I would be expected to enter the truecrypt container's password.
Any clues on what I can do in order to get the password prompt?