1.\" $NetBSD: mount_psshfs.8,v 1.27 2014/06/25 23:22:18 szptvlfn Exp $ 2.\" 3.\" Copyright (c) 2007-2009 Antti Kantee. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.Dd January 7, 2010 27.Dt MOUNT_PSSHFS 8 28.Os 29.Sh NAME 30.Nm mount_psshfs 31.Nd sshfs implementation for puffs 32.Sh SYNOPSIS 33.Nm 34.Op Ar options 35.Ar user@host[:path] 36.Ar mount_point 37.Sh DESCRIPTION 38The 39.Nm 40utility can be used to mount a file system using the ssh sftp 41subprotocol, making a remote directory hierarchy appear in the 42local directory tree. 43This functionality is commonly known as 44.Em sshfs . 45.Pp 46The mandatory parameters are the target host name and local mount 47point. 48The target host parameter can optionally contain a username whose 49credentials will be used by the remote sshd, and a relative or 50absolute path for the remote mount point's root. 51If no user is given, the credentials of the user issuing the mount 52command are used. 53If no path is given, the user's home directory on the remote machine 54will be used. 55.Pp 56The following command line options are available: 57.Pp 58.Bl -tag -width xxx 59.It Fl c Ar nconnect 60Opens 61.Ar nconnect 62connections to the server. 63Currently, the value has to be 1 or 2. 64If 2 is specified, a second connection is opened for the reading 65and writing of data, while directory operations are performed on 66their own connection. 67This can greatly increase directory operation performance (ls, 68mkdir, etc.) if 69.Nm 70completely saturates the available bandwidth by doing bulk data copying. 71The default is 1. 72.It Fl e 73Makes the mounted file system NFS exportable. 74If this option is used, it is very important to understand that 75.Nm 76can not provide complete support for NFS due to the limitations in 77the backend. 78Files are valid only for the time that 79.Nm 80is running and in the event of e.g. a server crash, all client retries 81to access files will fail. 82.It Fl F Ar configfile 83Pass a configuration file to 84.Xr ssh 1 . 85This will make it ignore the system-wide 86.Pa /etc/ssh/ssh_config 87configuration file and use 88.Pa configfile 89instead of 90.Pa ~/.ssh/config . 91.It Fl g Ar manglegid 92Converts remote 93.Ar manglegid 94to the effective gid of the file server and vice versa. 95See 96.Fl u . 97.It Fl o Ar [no]option 98This flag can be used to give standard mount options and options 99to puffs. 100.It Fl O Ar sshopt=value 101Pass an option to 102.Xr ssh 1 , 103for example 104.Fl O Ar Port=22 . 105For a list of valid options, see 106.Xr ssh_config 5 . 107.It Fl p 108Preserve connection. 109This option makes 110.Nm 111to try to reconnect to the server if the connection fails. 112The option is very experimental and does not preserve open files 113or retry current requests and should generally only be used if the 114trade-offs are well understood. 115.It Fl r Ar max_reads 116Limits maximum outstanding read requests for each node to 117.Ar max_reads . 118This can be used to improve interactive performance on low-bandwidth links 119when also performing bulk data reads. 120.It Fl s 121This flag can be used to make the program stay on top. 122The default is to detach from the terminal and run in the background. 123.It Fl t Ar timeout 124By default 125.Nm 126caches directory contents and node attributes for 30 seconds before 127re-fetching from the server to check if anything has changed on 128the server. 129This option is used to adjust the timeout period to 130.Ar timeout 131seconds. 132A value of 0 means the cache is never valid; \-1 means it is 133valid indefinitely. 134It is possible to force a re-read regardless of timeout status by sending 135.Dv SIGHUP 136to the 137.Nm 138process. 139.Pp 140Note: the file system will still free nodes when requested by the 141kernel and will lose all cached information in doing so. 142How frequently this happens depends on system activity and the total 143number of available vnodes in the system (kern.maxvnodes). 144.It Fl u Ar mangleuid 145Converts remote 146.Ar mangleuid 147to the effective uid of the file server and vice versa. 148This is a simple special case of the functionality of 149.Xr mount_umap 8 . 150For example: you mount remote me@darkmoon as the local user "me". 151If the uid of "me" on the local system is 101 and on 152darkmoon it is 202, you would use 153.Fl u 154.Ar 202 155to see files owned by 202 on darkmoon as owned by 101 when browsing the 156mount point. 157Apart from the cosmetic effect, this makes things like 158"chown me file" work. 159See 160.Fl g . 161.El 162.Sh EXAMPLES 163The following example illustrates how to mount the directory 164.Em /usr 165on server 166.Em bigiron 167as user 168.Em abc 169on local directory 170.Em /mnt 171with ssh transport compression enabled: 172.Bd -literal -offset indent 173mount_psshfs -O Compression=yes abc@bigiron:/usr /mnt 174.Ed 175.Pp 176It is possible to use 177.Xr fstab 5 178for psshfs mounts, with SSH public key authentication: 179.Pp 180.Dl "abc@bigiron:/usr /mnt psshfs rw,noauto,-O=BatchMode=yes,-O=IdentityFile=/root/.ssh/id_rsa,-t=-1" 181.Sh SEE ALSO 182.Xr sftp 1 , 183.Xr puffs 3 , 184.Xr puffs 4 , 185.Xr fstab 5 , 186.Xr ssh_config 5 , 187.Xr mount 8 , 188.Xr sshd 8 189.Sh HISTORY 190The 191.Nm 192utility first appeared in 193.Nx 5.0 . 194It was inspired by FUSE sshfs. 195.Sh CAVEATS 196Permissions are not handled. 197Do not expect the file system to behave except for a single user. 198.Pp 199Depending on if the server supports the 200.Xr sftp 1 201statvfs protocol extension, 202free disk space may be displayed for the mount by 203.Xr df 1 . 204This information reflects the status at the server's mountpoint 205and may differ for subdirectories under the mount root. 206