linux的usage,Usage — The Linux Kernel documentation

本文详细介绍了CIFS(Common Internet File System)网络文件系统在挂载时的各种参数选项,包括用户名、密码、IP地址、UNC路径、工作组名、强制UID和GID、文件和目录权限模式、缓存策略、读写模式、安全性设置等。这些选项用于配置客户端与服务器之间的交互,确保数据的安全传输和正确访问权限。
摘要由CSDN通过智能技术生成

usernameThe user name to use when trying to establish

the CIFS session.

passwordThe user password. If the mount helper is

installed, the user will be prompted for password

if not supplied.

ipThe ip address of the target server

uncThe target server Universal Network Name (export) to

mount.

domainSet the SMB/CIFS workgroup name prepended to the

username during CIFS session establishment

forceuidSet the default uid for inodes to the uid

passed in on mount. For mounts to servers

which do support the CIFS Unix extensions, such as a

properly configured Samba server, the server provides

the uid, gid and mode so this parameter should not be

specified unless the server and clients uid and gid

numbering differ. If the server and client are in the

same domain (e.g. running winbind or nss_ldap) and

the server supports the Unix Extensions then the uid

and gid can be retrieved from the server (and uid

and gid would not have to be specified on the mount.

For servers which do not support the CIFS Unix

extensions, the default uid (and gid) returned on lookup

of existing files will be the uid (gid) of the person

who executed the mount (root, except when mount.cifs

is configured setuid for user mounts) unless the uid=

(gid) mount option is specified. Also note that permission

checks (authorization checks) on accesses to a file occur

at the server, but there are cases in which an administrator

may want to restrict at the client as well. For those

servers which do not report a uid/gid owner

(such as Windows), permissions can also be checked at the

client, and a crude form of client side permission checking

can be enabled by specifying file_mode and dir_mode on

the client. (default)

forcegid(similar to above but for the groupid instead of uid) (default)

noforceuidFill in file owner information (uid) by requesting it from

the server if possible. With this option, the value given in

the uid= option (on mount) will only be used if the server

can not support returning uids on inodes.

noforcegid(similar to above but for the group owner, gid, instead of uid)

uidSet the default uid for inodes, and indicate to the

cifs kernel driver which local user mounted. If the server

supports the unix extensions the default uid is

not used to fill in the owner fields of inodes (files)

unless the forceuid parameter is specified.

gidSet the default gid for inodes (similar to above).

file_modeIf CIFS Unix extensions are not supported by the server

this overrides the default mode for file inodes.

fscEnable local disk caching using FS-Cache (off by default). This

option could be useful to improve performance on a slow link,

heavily loaded server and/or network where reading from the

disk is faster than reading from the server (over the network).

This could also impact scalability positively as the

number of calls to the server are reduced. However, local

caching is not suitable for all workloads for e.g. read-once

type workloads. So, you need to consider carefully your

workload/scenario before using this option. Currently, local

disk caching is functional for CIFS files opened as read-only.

dir_modeIf CIFS Unix extensions are not supported by the server

this overrides the default mode for directory inodes.

portattempt to contact the server on this tcp port, before

trying the usual ports (port 445, then 139).

iocharsetCodepage used to convert local path names to and from

Unicode. Unicode is used by default for network path

names if the server supports it. If iocharset is

not specified then the nls_default specified

during the local client kernel build will be used.

If server does not support Unicode, this parameter is

unused.

rsizedefault read size (usually 16K). The client currently

can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize

defaults to 16K and may be changed (from 8K to the maximum

kmalloc size allowed by your kernel) at module install time

for cifs.ko. Setting CIFSMaxBufSize to a very large value

will cause cifs to use more memory and may reduce performance

in some cases. To use rsize greater than 127K (the original

cifs protocol maximum) also requires that the server support

a new Unix Capability flag (for very large read) which some

newer servers (e.g. Samba 3.0.26 or later) do. rsize can be

set from a minimum of 2048 to a maximum of 130048 (127K or

CIFSMaxBufSize, whichever is smaller)

wsizedefault write size (default 57344)

maximum wsize currently allowed by CIFS is 57344 (fourteen

4096 byte pages)

actimeo=nattribute cache timeout in seconds (default 1 second).

After this timeout, the cifs client requests fresh attribute

information from the server. This option allows to tune the

attribute cache timeout to suit the workload needs. Shorter

timeouts mean better the cache coherency, but increased number

of calls to the server. Longer timeouts mean reduced number

of calls to the server at the expense of less stricter cache

coherency checks (i.e. incorrect attribute cache for a short

period of time).

rwmount the network share read-write (note that the

server may still consider the share read-only)

romount network share read-only

versionused to distinguish different versions of the

mount helper utility (not typically needed)

sepif first mount option (after the -o), overrides

the comma as the separator between the mount

parms. e.g.:

-o user=myname,password=mypassword,domain=mydom

could be passed instead with period as the separator by:

-o sep=.user=myname.password=mypassword.domain=mydom

this might be useful when comma is contained within username

or password or domain. This option is less important

when the cifs mount helper cifs.mount (version 1.1 or later)

is used.

nosuidDo not allow remote executables with the suid bit

program to be executed. This is only meaningful for mounts

to servers such as Samba which support the CIFS Unix Extensions.

If you do not trust the servers in your network (your mount

targets) it is recommended that you specify this option for

greater security.

execPermit execution of binaries on the mount.

noexecDo not permit execution of binaries on the mount.

devRecognize block devices on the remote mount.

nodevDo not recognize devices on the remote mount.

suidAllow remote files on this mountpoint with suid enabled to

be executed (default for mounts when executed as root,

nosuid is default for user mounts).

credentialsAlthough ignored by the cifs kernel component, it is used by

the mount helper, mount.cifs. When mount.cifs is installed it

opens and reads the credential file specified in order

to obtain the userid and password arguments which are passed to

the cifs vfs.

guestAlthough ignored by the kernel component, the mount.cifs

mount helper will not prompt the user for a password

if guest is specified on the mount options. If no

password is specified a null password will be used.

permClient does permission checks (vfs_permission check of uid

and gid of the file against the mode and desired operation),

Note that this is in addition to the normal ACL check on the

target machine done by the server software.

Client permission checking is enabled by default.

nopermClient does not do permission checks. This can expose

files on this mount to access by other users on the local

client system. It is typically only needed when the server

supports the CIFS Unix Extensions but the UIDs/GIDs on the

client and server system do not match closely enough to allow

access by the user doing the mount, but it may be useful with

non CIFS Unix Extension mounts for cases in which the default

mode is specified on the mount but is not to be enforced on the

client (e.g. perhaps when MultiUserMount is enabled)

Note that this does not affect the normal ACL check on the

target machine done by the server software (of the server

ACL against the user name provided at mount time).

serverinoUse server’s inode numbers instead of generating automatically

incrementing inode numbers on the client. Although this will

make it easier to spot hardlinked files (as they will have

the same inode numbers) and inode numbers may be persistent,

note that the server does not guarantee that the inode numbers

are unique if multiple server side mounts are exported under a

single share (since inode numbers on the servers might not

be unique if multiple filesystems are mounted under the same

shared higher level directory). Note that some older

(e.g. pre-Windows 2000) do not support returning UniqueIDs

or the CIFS Unix Extensions equivalent and for those

this mount option will have no effect. Exporting cifs mounts

under nfsd requires this mount option on the cifs mount.

This is now the default if server supports the

required network operation.

noserverinoClient generates inode numbers (rather than using the actual one

from the server). These inode numbers will vary after

unmount or reboot which can confuse some applications,

but not all server filesystems support unique inode

numbers.

setuidsIf the CIFS Unix extensions are negotiated with the server

the client will attempt to set the effective uid and gid of

the local process on newly created files, directories, and

devices (create, mkdir, mknod). If the CIFS Unix Extensions

are not negotiated, for newly created files and directories

instead of using the default uid and gid specified on

the mount, cache the new file’s uid and gid locally which means

that the uid for the file can change when the inode is

reloaded (or the user remounts the share).

nosetuidsThe client will not attempt to set the uid and gid on

on newly created files, directories, and devices (create,

mkdir, mknod) which will result in the server setting the

uid and gid to the default (usually the server uid of the

user who mounted the share). Letting the server (rather than

the client) set the uid and gid is the default. If the CIFS

Unix Extensions are not negotiated then the uid and gid for

new files will appear to be the uid (gid) of the mounter or the

uid (gid) parameter specified on the mount.

netbiosnameWhen mounting to servers via port 139, specifies the RFC1001

source name to use to represent the client netbios machine

name when doing the RFC1001 netbios session initialize.

directDo not do inode data caching on files opened on this mount.

This precludes mmapping files on this mount. In some cases

with fast networks and little or no caching benefits on the

client (e.g. when the application is doing large sequential

reads bigger than page size without rereading the same data)

this can provide better performance than the default

behavior which caches reads (readahead) and writes

(writebehind) through the local Linux client pagecache

if oplock (caching token) is granted and held. Note that

direct allows write operations larger than page size

to be sent to the server.

strictcacheUse for switching on strict cache mode. In this mode the

client read from the cache all the time it has Oplock Level II,

otherwise - read from the server. All written data are stored

in the cache, but if the client doesn’t have Exclusive Oplock,

it writes the data to the server.

rwpidforwardForward pid of a process who opened a file to any read or write

operation on that file. This prevent applications like WINE

from failing on read and write if we use mandatory brlock style.

aclAllow setfacl and getfacl to manage posix ACLs if server

supports them. (default)

noaclDo not allow setfacl and getfacl calls on this mount

user_xattrAllow getting and setting user xattrs (those attributes whose

name begins with user. or os2.) as OS/2 EAs (extended

attributes) to the server. This allows support of the

setfattr and getfattr utilities. (default)

nouser_xattrDo not allow getfattr/setfattr to get/set/list xattrs

mapcharsTranslate six of the seven reserved characters (not backslash):

*?<>|:

to the remap range (above 0xF000), which also

allows the CIFS client to recognize files created with

such characters by Windows’s POSIX emulation. This can

also be useful when mounting to most versions of Samba

(which also forbids creating and opening files

whose names contain any of these seven characters).

This has no effect if the server does not support

Unicode on the wire.

nomapcharsDo not translate any of these seven characters (default).

nocaseRequest case insensitive path name matching (case

sensitive is the default if the server supports it).

(mount option ignorecase is identical to nocase)

posixpathsIf CIFS Unix extensions are supported, attempt to

negotiate posix path name support which allows certain

characters forbidden in typical CIFS filenames, without

requiring remapping. (default)

noposixpathsIf CIFS Unix extensions are supported, do not request

posix path name support (this may cause servers to

reject creatingfile with certain reserved characters).

nounixDisable the CIFS Unix Extensions for this mount (tree

connection). This is rarely needed, but it may be useful

in order to turn off multiple settings all at once (ie

posix acls, posix locks, posix paths, symlink support

and retrieving uids/gids/mode from the server) or to

work around a bug in server which implement the Unix

Extensions.

nobrlDo not send byte range lock requests to the server.

This is necessary for certain applications that break

with cifs style mandatory byte range locks (and most

cifs servers do not yet support requesting advisory

byte range locks).

forcemandatorylockEven if the server supports posix (advisory) byte range

locking, send only mandatory lock requests. For some

(presumably rare) applications, originally coded for

DOS/Windows, which require Windows style mandatory byte range

locking, they may be able to take advantage of this option,

forcing the cifs client to only send mandatory locks

even if the cifs server would support posix advisory locks.

forcemand is accepted as a shorter form of this mount

option.

nostrictsyncIf this mount option is set, when an application does an

fsync call then the cifs client does not send an SMB Flush

to the server (to force the server to write all dirty data

for this file immediately to disk), although cifs still sends

all dirty (cached) file data to the server and waits for the

server to respond to the write. Since SMB Flush can be

very slow, and some servers may be reliable enough (to risk

delaying slightly flushing the data to disk on the server),

turning on this option may be useful to improve performance for

applications that fsync too much, at a small risk of server

crash. If this mount option is not set, by default cifs will

send an SMB flush request (and wait for a response) on every

fsync call.

nodfsDisable DFS (global name space support) even if the

server claims to support it. This can help work around

a problem with parsing of DFS paths with Samba server

versions 3.0.24 and 3.0.25.

remountremount the share (often used to change from ro to rw mounts

or vice versa)

cifsaclReport mode bits (e.g. on stat) based on the Windows ACL for

the file. (EXPERIMENTAL)

servernSpecify the server ‘s netbios name (RFC1001 name) to use

when attempting to setup a session to the server.

This is needed for mounting to some older servers (such

as OS/2 or Windows 98 and Windows ME) since they do not

support a default server name. A server name can be up

to 15 characters long and is usually uppercased.

sfuWhen the CIFS Unix Extensions are not negotiated, attempt to

create device files and fifos in a format compatible with

Services for Unix (SFU). In addition retrieve bits 10-12

of the mode via the SETFILEBITS extended attribute (as

SFU does). In the future the bottom 9 bits of the

mode also will be emulated using queries of the security

descriptor (ACL).

mfsymlinksEnable support for Minshall+French symlinks

(see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks)

This option is ignored when specified together with the

‘sfu’ option. Minshall+French symlinks are used even if

the server supports the CIFS Unix Extensions.

signMust use packet signing (helps avoid unwanted data modification

by intermediate systems in the route). Note that signing

does not work with lanman or plaintext authentication.

sealMust seal (encrypt) all data on this mounted share before

sending on the network. Requires support for Unix Extensions.

Note that this differs from the sign mount option in that it

causes encryption of data sent over this mounted share but other

shares mounted to the same server are unaffected.

localleaseThis option is rarely needed. Fcntl F_SETLEASE is

used by some applications such as Samba and NFSv4 server to

check to see whether a file is cacheable. CIFS has no way

to explicitly request a lease, but can check whether a file

is cacheable (oplocked). Unfortunately, even if a file

is not oplocked, it could still be cacheable (ie cifs client

could grant fcntl leases if no other local processes are using

the file) for cases for example such as when the server does not

support oplocks and the user is sure that the only updates to

the file will be from this client. Specifying this mount option

will allow the cifs client to check for leases (only) locally

for files which are not oplocked instead of denying leases

in that case. (EXPERIMENTAL)

secSecurity mode. Allowed values are:

noneattempt to connection as a null user (no name)

krb5Use Kerberos version 5 authentication

krb5iUse Kerberos authentication and packet signing

ntlmUse NTLM password hashing (default)

ntlmiUse NTLM password hashing with signing (if

/proc/fs/cifs/PacketSigningEnabled on or if

server requires signing also can be the default)

ntlmv2Use NTLMv2 password hashing

ntlmv2iUse NTLMv2 password hashing with packet signing

lanman(if configured in kernel config) use older

lanman hash

hardRetry file operations if server is not responding

softLimit retries to unresponsive servers (usually only

one retry) before returning an error. (default)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值