xref: /netbsd-src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 (revision de4fa6c51a9708fc05f88b618fa6fad87c9508ec)
1.\"	$NetBSD: mount_psshfs.8,v 1.21 2009/05/20 14:08:21 pooka 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 May 20, 2009
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 o Ar [no]option
92This flag can be used to give standard mount options and options
93to puffs.
94.It Fl O Ar sshopt=value
95Pass an option to
96.Xr ssh 1 ,
97for example
98.Fl O Ar Port=22 .
99For a list of valid options, see
100.Xr ssh_config 5 .
101.It Fl p
102Preserve connection.
103This option makes
104.Nm
105to try to reconnect to the server if the connection fails.
106The option is very experimental and does not preserve open files
107or retry current requests and should generally only be used if the
108trade-offs are well understood.
109.It Fl r Ar max_reads
110Limits maximum outstanding read requests for each node to
111.Ar max_reads .
112This can be used to improve interactive performance on low-bandwidth links
113when also performing bulk data reads.
114.It Fl s
115This flag can be used to make the program stay on top.
116The default is to detach from the terminal and run in the background.
117.It Fl t Ar timeout
118By default
119.Nm
120caches directory contents and node attributes for 30 seconds before
121re-fetching from the server to check if anything has changed on
122the server.
123This option is used to adjust the timeout period to
124.Ar timeout
125seconds.
126A value 0 means the cache is never valid and \-1 means it is
127valid indefinitely.
128It is possible to force a re-read regardless of timeout status by sending
129.Dv SIGHUP
130to the
131.Nm
132process.
133.Pp
134Note: the file system will still free nodes when requested by the
135kernel and will lose all cached information in doing so.
136How frequently this happens depends on system activity and the total
137number of available vnodes in the system (kern.maxvnodes).
138.El
139.Sh EXAMPLES
140The following example illustrates how to mount the directory
141.Em /usr
142on server
143.Em bigiron
144as user
145.Em abc
146on local directory
147.Em /mnt
148with ssh transport compression enabled:
149.Bd -literal -offset indent
150mount_psshfs -O Compression=yes abc@bigiron:/usr /mnt
151.Ed
152.Pp
153It is possible to use
154.Xr fstab 5
155for psshfs mounts, with SSH public key authentication:
156.Pp
157.Dl "abc@bigiron:/usr /mnt psshfs rw,noauto,-O=BatchMode=yes,-O=IdentityFile=/root/.ssh/id_rsa,-t=-1"
158.Sh SEE ALSO
159.Xr sftp 1 ,
160.Xr puffs 3 ,
161.Xr puffs 4 ,
162.Xr fstab 5 ,
163.Xr ssh_config 5 ,
164.Xr mount 8 ,
165.Xr sshd 8
166.Sh HISTORY
167The
168.Nm
169utility first appeared in
170.Nx 5.0 .
171.Sh CAVEATS
172Permissions are not handled.
173Do not expect the file system to behave except for a single user.
174.Pp
175Depending on if the server supports the
176.Xr sftp 1
177stavfs protocol extension,
178free disk space may be displayed for the mount by
179.Xr df 1 .
180This information reflects the status at the server's mountpoint
181and may differ for subdiretories under the mount root.
182