[K12OSN] SSHFS and Open Office - two separate issues
Petre Scheie
petre at maltzen.net
Tue Sep 5 13:38:49 UTC 2006
Petre Scheie wrote:
> Bert Rolston wrote:
>> Hi folks,
>>
>> Thanks for the help with SMB4K, sshfs, and accessing file on my SAMBA
>> server from my Linux desktop.
>>
>> I've just about got it all working the way I want.
>> I've gone with sshfs because it allows the file system access that I
>> want. Unfortunately I can't get it to force user ID's the way SAMBA
>> does. Which leads to my first question -
>>
>> "How do you force the user to be someone else when a file is created
>> while accessing files using sshfs, e.g. bert is the user that logs in
>> and accesses a file in public folder, but all files should remain
>> user=public, group=public?"
>>
>> My second question is how to automate the sshfs connection process, so
>> that it sort of simulates a login script, and automagically mounts the
>> server folders into my local file system? I've tried generating a
>> public/private key, but it isn't working.
>>
> You're on the right track: After you generate the public/private keys as
> bert, copy the public key to to user's ~/.ssh/authorized_keys file. Be
> sure the permissions on /home/user and /home/user/.ssh are set to 700
> and /home/user/.ssh/authorized_keys are set to 600. Then, as user bert,
> you run the following:
>
> sshfs user at remotehost:/path/to/directory /home/bert/mountpoint
>
> Since you're attaching as user, all the files you create & modify on the
> remote host should be owned by user. As for the group permisssions, set
> the group sticky bit on the directory on the remote host.
>
> To 'automate' this, just put it in /etc/fstab. It will stay up all the
> time rather than being unmounted when the user logs out, but since it's
> just an ssh session, that shouldn't really be an issue (and it won't
> actually be doing anything when bert is not logged in). The syntax for
> the fstab file is like this:
>
> sshfs#USERNAME at REMOTE_HOST:REMOTE_PATH MOUNT_POINT fuse SSHFS_OPTIONS 0 0
>
> See the sshfs FAQ page for some examples at
> http://fuse.sourceforge.net/wiki/index.php/SshfsFaq
>
> HTH
>
> Petre
>
I just noticed I made a mistake in my explanation that muddies everything. The example
syntax should read
sshfs public at remotehost:/home/public /home/bert/mountpoint
IOW, user bert connects to the remote box using the ID 'public' (not 'user' as I
originally wrote).
Petre
More information about the K12OSN
mailing list