mount.cifs

title: mount.cifs(8)

text:
# mount.cifs(8)

## NAME
mount.cifs, mount.smb3 - mount using the Common Internet File System (CIFS)

## SYNOPSIS
mount.cifs {service} {mount-point} [-o options]

This tool is part of the cifs-utils suite.

mount.cifs mounts a CIFS or SMB3 filesystem from Linux. It is usually invoked indirectly by the mount(8) command when using the "-t cifs" option. This command only works in Linux, and the kernel must support the cifs filesystem. The SMB3 protocol is the successor to the CIFS (SMB) protocol and is supported by most Windows servers, Azure (cloud storage), Macs and many other commercial servers and Network Attached Storage appliances as well as by the popular Open Source server Samba.

mount.smb3 mounts only SMB3 filesystem. It is usually invoked indirectly by the mount(8) command when using the "-t smb3" option. The smb3 filesystem type was added in kernel-4.18 and above. It works in a similar fashion as mount.cifs except it passes filesystem type as smb3.

The mount.cifs utility attaches the UNC name (exported network resource) specified as service (using //server/share syntax, where "server" is the server name or IP address and "share" is the name of the share) to the local directory mount-point.

Options to mount.cifs are specified as a comma-separated list of key=value pairs. It is possible to send options other than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them. Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the kernel log.

mount.cifs causes the cifs vfs to launch a thread named cifsd. After mounting it keeps running until the mounted resource is unmounted (usually via the umount utility).

mount.cifs -V command displays the version of cifs mount helper.

modinfo cifs command displays the version of cifs module.

## OPTIONS
username=arg|user=arg

specifies the username to connect as. If this is not given, then the environment variable USER is used. Earlier versions of mount.cifs also allowed one to specify the username in a user%password or workgroup/user or workgroup/user%password to allow the password and workgroup to be specified as part of the username. Support for those alternate username formats is now deprecated and should no longer be used. Users should use the discrete password= and domain= to specify those values. While some versions of the cifs kernel module accept user= as an abbreviation for this option, its use can confuse the standard mount program into thinking that this is a non-superuser mount. It is therefore recommended to use the full username= option name.

password=arg|pass=arg

specifies the CIFS password. If this option is not given then the environment variable PASSWD is used. If the password is not specified directly or indirectly via an argument to mount, mount.cifs will prompt for a password, unless the guest option is specified. Note that a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line. However, the same password defined in the PASSWD environment variable or via a credentials file (see below) or entered at the password prompt will be read correctly.

credentials=filename|cred=filename

specifies a file that contains a username and/or password and optionally the name of the workgroup. The format of the file is:

```
username=value
password=value
domain=value
```

This is preferred over having passwords in plaintext in a shared file, such as /etc/fstab . Be sure to protect any credentials file properly.

uid=arg

sets the uid that will own all files or directories on the mounted filesystem when the server does not provide ownership information. It may be specified as either a username or a numeric uid. When not specified, the default is uid 0. The mount.cifs helper must be at version 1.10 or higher to support specifying the uid in non-numeric form. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.

forceuid

instructs the client to ignore any uid provided by the server for files and directories and to always assign the owner to be the value of the uid= option. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.

cruid=arg

sets the uid of the owner of the credentials cache. This is primarily useful with sec=krb5. The default is the real uid of the process performing the mount. Setting this parameter directs the upcall to look for a credentials cache owned by that user.

gid=arg

sets the gid that will own all files or directories on the mounted filesystem when the server does not provide ownership information. It may be specified as either a groupname or a numeric gid. When not specified, the default is gid 0. The mount.cifs helper must be at version 1.10 or higher to support specifying the gid in non-numeric form. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.

forcegid

instructs the client to ignore any gid provided by the server for files and directories and to always assign the owner to be the value of the gid= option. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.

idsfromsid

Extract uid/gid from special SID instead of mapping it. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.

port=arg

sets the port number on which the client will attempt to contact the CIFS server. If this value is specified, look for an existing connection with this port, and use that if one exists. If one doesn't exist, try to create a new connection on that port. If that connection fails, return an error. If this value isn't specified, look for an existing connection on port 445 or 139. If no such connection exists, try to connect on port 445 first and then port 139 if that fails. Return an error if both fail.

netbiosname=arg

When mounting to servers via port 139, specifies the RFC1001 source name to use to represent the client netbios machine during the netbios session initialization.

servern=arg

Similar to netbiosname except it specifies the netbios name of the server instead of the client. Although rarely needed for mounting to newer servers, this option is needed for mounting to some older servers (such as OS/2 or Windows 98 and Windows ME) since when connecting over port 139 they, unlike most newer servers, do not support a default server name. A server name can be up to 15 characters long and is usually uppercased.

file_mode=arg

If the server does not support the CIFS Unix extensions this overrides the default file mode.

dir_mode=arg

If the server does not support the CIFS Unix extensions this overrides the default mode for directories.

ip=arg|addr=arg

sets the destination IP address. This option is set automatically if the server name portion of the requested UNC name can be resolved so rarely needs to be specified by the user.

domain=arg|dom=arg|workgroup=arg

Sets the domain (workgroup) of the user. If no domains are given, the empty domain will be used. Use domainauto to automatically guess the domain of the server you are connecting to.

domainauto

When using NTLM authentication and not providing a domain via domain, guess the domain from the server NTLM challenge. This behavior used to be the default on kernels older than 2.6.36.

guest

don't prompt for a password.

iocharset

Charset 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.

ro

mount read-only.

rw

mount read-write.

setuids

If 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 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).

nosetuids

The 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.

perm

Client 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.

noperm

Client 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. 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).

dynperm

Instructs the server to maintain ownership and permissions in memory that can't be stored on the server. This information can disappear at any time (whenever the inode is flushed from the cache), so while this may help make some applications work, it's behavior is somewhat unreliable. See the section below on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS for more information.

cache=arg

Cache mode. See the section below on CACHE COHERENCY for details. Allowed values are:

- none - do not cache file data at all

- strict - follow the CIFS/SMB2 protocol strictly

- loose - allow loose caching semantics

The default in kernels prior to 3.7 was loose. As of kernel 3.7 the default is strict.

nostrictsync

Do not ask the server to flush on fsync(). Some servers perform non-buffered writes by default in which case flushing is redundant. In workloads where a client is performing a lot of small write + fsync combinations and where network latency is much higher than the server latency, this brings a 2x performance improvement. This option is also a good candidate in scenarios where we want performance over consistency.

handlecache

(default) In SMB2 and above, the client often has to open the root of the share (empty path) in various places during mount, path revalidation and the statfs(2) system call. This option cuts redundant round trip traffic (opens and closes) by simply keeping the directory handle for the root around once opened.

nohandlecache

Disable caching of the share root directory handle.

handletimeout=arg

The time (in milliseconds) for which the server should reserve the handle after a failover waiting for the client to reconnect. When mounting with resilienthandles or persistenthandles mount option, or when their use is requested by the server (continuous availability shares) then this parameter overrides the server default handle timeout (which for most servers is 120 seconds).

rwpidforward

Forward pid of a process who opened a file to any read or write operation on that file. This prevent applications like wine(1) from failing on read and write if we use mandatory brlock style.

mapchars

Translate six of the seven reserved characters (not backslash, but including the colon, question mark, pipe, asterik, greater than and less than characters) to the remap range (above 0xF000), which also allows the CIFS client to recognize files created with such characters by Windows's Services for Mac. 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. Please note that the files created with mapchars mount option may not be accessible if the share is mounted without that option.

nomapchars

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

mapposix

Translate reserved characters similarly to mapchars but use the mapping from Microsoft "Services For Unix".

intr

currently unimplemented.

nointr

(default) currently unimplemented.

hard

The program accessing a file on the cifs mounted file system will hang when the server crashes.

soft

(default) The program accessing a file on the cifs mounted file system will not hang when the server crashes and will return errors to the user application.

noacl

Do not allow POSIX ACL operations even if server would support them. The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers version 3.0.10 and later. Setting POSIX ACLs requires enabling both CONFIG_CIFS_XATTR and then CONFIG_CIFS_POSIX support in the CIFS configuration options when building the cifs module. POSIX ACL support can be disabled on a per mount basis by specifying noacl on mount.

cifsacl

This option is used to map CIFS/NTFS ACLs to/from Linux permission bits, map SIDs to/from UIDs and GIDs, and get and set Security Descriptors. See section on CIFS/NTFS ACL, SID/UID/GID MAPPING, SECURITY DESCRIPTORS for more information.

backupuid=arg

File access by this user shall be done with the backup intent flag set. Either a name or an id must be provided as an argument, there are no default values. See section ACCESSING FILES WITH BACKUP INTENT for more details.

backupgid=arg

File access by users who are members of this group shall be done with the backup intent flag set. Either a name or an id must be provided as an argument, there are no default values. See section ACCESSING FILES WITH BACKUP INTENT for more details.

nocase

Request case insensitive path name matching (case sensitive is the default if the server supports it).

ignorecase

Synonym for nocase.

sec=arg

Security mode. Allowed values are:

- none - attempt to connection as a null user (no name)

- krb5 - Use Kerberos version 5 authentication

- krb5i - Use Kerberos authentication and forcibly enable packet signing

- ntlm - Use NTLM password hashing

- ntlmi - Use NTLM password hashing and force packet signing

- ntlmv2 - Use NTLMv2 password hashing

- ntlmv2i - Use NTLMv2 password hashing and force packet signing

- ntlmssp - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message

- ntlmsspi - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message, and force packet signing

The default in mainline kernel versions prior to v3.8 was sec=ntlm. In v3.8, the default was changed to sec=ntlmssp.

If the server requires signing during protocol negotiation, then it may be enabled automatically. Packet signing may also be enabled automatically if it's enabled in /proc/fs/cifs/SecurityFlags.

seal

Request encryption at the SMB layer. The encryption algorithm used is AES-128-CCM. Requires SMB3 or above (see vers).

rdma

Connect directly to the server using SMB Direct via a RDMA adapter. Requires SMB3 or above (see vers).

resilienthandles

Enable resilient handles. If the server supports it, keep opened files across reconnections. Requires SMB2.1 (see vers).

noresilienthandles

(default) Disable resilient handles.

persistenthandles

Enable persistent handles. If the server supports it, keep opened files across reconnections. Persistent handles are also valid across servers in a cluster and have stronger guarantees than resilient handles. Requires SMB3 or above (see vers).

nopersistenthandles

(default) Disable persistent handles.

snapshot=time

Mount a specific snapshot of the remote share. time must be a positive integer identifying the snapshot requested (in 100-nanosecond units that have elapsed since January 1, 1601, or alternatively it can be specified in GMT format e.g. @GMT-2019.03.27-20.52.19). Supported in the Linux kernel starting from v4.19.

nobrl

Do 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).

forcemandatorylock

Do not use POSIX locks even when available via unix extensions. Always use cifs style mandatory locks.

locallease

Check cached leases locally instead of querying the server.

nolease

Do not request lease/oplock when openning a file on the server. This turns off local caching of IO, byte-range lock and read metadata operations (see actimeo for more details about metadata caching). Requires SMB2 and above (see vers).

sfu

When the CIFS or SMB3 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 mode also will be emulated using queries of the security descriptor (ACL). [NB: requires version 1.39 or later of the CIFS VFS. To recognize symlinks and be able to create symlinks in an SFU interoperable form requires version 1.40 or later of the CIFS VFS kernel module.

mfsymlinks

Enable 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.

echo_interval=n

sets the interval at which echo requests are sent to the server on an idling connection. This setting also affects the time required for a connection to an unresponsive server to timeout. Here n is the echo interval in seconds. The reconnection happens at twice the value of the echo_interval set for an unresponsive server. If this option is not given then the default value of 60 seconds is used. The minimum tunable value is 1 second and maximum can go up to 600 seconds.

serverino

Use inode numbers (unique persistent file identifiers) returned by the server instead of automatically generating temporary inode numbers on the client. Although server inode numbers make it easier to spot hardlinked files (as they will have the same inode numbers) and inode numbers may be persistent (which is useful for some software), 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 not all servers support returning server inode numbers, although those that support the CIFS Unix Extensions, and Windows 2000 and later servers typically do support this (although not necessarily on every local server filesystem). Parameter has no effect if the server lacks support for returning inode numbers or equivalent. This behavior is enabled by default.

noserverino

Client generates inode numbers itself rather than using the actual ones from the server. See section INODE NUMBERS for more information.

posix|unix|linux

(default) Enable Unix Extensions for this mount. Requires CIFS (vers=1.0) or SMB3.1.1 (vers=3.1.1) and a server supporting them.

noposix|nounix|nolinux

Disable the Unix Extensions for this mount. This can be useful in order to turn off multiple settings at once. This includes POSIX acls, POSIX locks, POSIX paths, symlink support and retrieving uids/gids/mode from the server. This can also be useful to work around a bug in a server that supports Unix Extensions. See section INODE NUMBERS for more information.

nouser_xattr

Do not allow getfattr/setfattr to get/set xattrs, even if server would support it otherwise. The default is for xattr support to be enabled.

nodfs

Do not follow Distributed FileSystem referrals. IO on a file not stored on the server will fail instead of connecting to the target server transparently.

noautotune

Use fixed size for kernel recv/send socket buffers.

nosharesock

Do not try to reuse sockets if the system is already connected to the server via an existing mount point. This will make the client always make a new connection to the server no matter what he is already connected to. This can be useful in simulating multiple clients connecting to the same server, as each mount point will use a different TCP socket.

noblocksend

Send data on the socket using non blocking operations (MSG_DONTWAIT flag).

rsize=bytes

Maximum amount of data that the kernel will request in a read request in bytes. Maximum size that servers will accept is typically 8MB for SMB3 or later dialects. Default requested during mount is 4MB. Prior to the 4.20 kernel the default requested was 1MB. Prior to the SMB2.1 dialect the maximum was usually 64K.

wsize=bytes

Maximum amount of data that the kernel will send in a write request in bytes. Maximum size that servers will accept is typically 8MB for SMB3 or later dialects. Default requested during mount is 4MB. Prior to the 4.20 kernel the default requested was 1MB. Prior to the SMB2.1 dialect the maximum was usually 64K.

bsize=bytes

Override the default blocksize (1MB) reported on SMB3 files (requires kernel version of 5.1 or later). Prior to kernel version 5.1, the blocksize was always reported as 16K instead of 1MB (and was not configurable) which can hurt the performance of tools like cp and scp (especially for uncached I/O) which decide on the read and write size to use for file copies based on the inode blocksize. bsize may not be less than 16K or greater than 16M.

max_credits=n

Maximum credits the SMB2 client can have. Default is 32000. Must be set to a number between 20 and 60000.

fsc

Enable local disk caching using FS-Cache for CIFS. 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 the scalability positively as the number of calls to the server are reduced. But, be warned that local caching is not suitable for all workloads, for e.g., read-once type workloads. So, you need to consider carefully the situation/workload before using this option. Currently, local disk caching is enabled for CIFS files opened as read-only. NOTE: This feature is available only in the recent kernels that have been built with the kernel config option CONFIG_CIFS_FSCACHE. You also need to have cachefilesd daemon installed and running to make the cache operational.

multiuser

Map user accesses to individual credentials when accessing the server. By default, CIFS mounts only use a single set of user credentials (the mount credentials) when accessing a share. With this option, the client instead creates a new session with the server using the user's credentials whenever a new user accesses the mount. Further accesses by that user will also use those credentials. Because the kernel cannot prompt for passwords, multiuser mounts are limited to mounts using sec= options that don't require passwords. With this change, it's feasible for the server to handle permissions enforcement, so this option also implies noperm . Furthermore, when unix extensions aren't in use and the administrator has not overridden ownership using the uid= or gid= options, ownership of files is presented as the current user accessing the share.

actimeo=arg

The time (in seconds) that the CIFS client caches attributes of a file or directory before it requests attribute information from a server. During this period the changes that occur on the server remain undetected until the client checks the server again. By default, the attribute cache timeout is set to 1 second. This means more frequent on-the-wire calls to the server to check whether attributes have changed which could impact performance. With this option users can make a tradeoff between performance and cache metadata correctness, depending on workload needs. Shorter timeouts mean better cache coherency, but frequent increased number of calls to the server. Longer timeouts mean a reduced number of calls to the server but looser cache coherency. The actimeo value is a positive integer that can hold values between 0 and a maximum value of 2^30 * HZ (frequency of timer interrupt) setting.

acregmax=arg

The maximum time (in seconds) that the CIFS client caches attributes of a regular file before it requests fresh attribute information from a server. If this option is not specified, then acregmax value will be set to actimeo value, see actimeo for more details.

acdirmax=arg

The maximum time (in seconds) that the CIFS client caches attributes of a directory before it requests fresh attribute information from a server. If this option is not specified, then acdirmax value will be set to actimeo value, see actimeo for more details.

multichannel

This option enables multichannel feature. Multichannel is an SMB3 protocol feature that allows client to establish multiple transport connections to an SMB server and bind them into a single authenticated SMB session. This feature enhances fault tolerance and increases throughput by distributing traffic across several connections. With this mount option default is to use two channels if the server supports multichannel. The max_channels parameter can be specified if you desire to use more than two channels.

max_channels=arg

This option is applicable while using multichannel feature. max_channels option allows the user to specify the number of transport connections that should be establised between client and server up to a limit of 16. Using this option implicitly enables the multichannel feature. If max_channels option not specified, multichannel feature defaults to using 2 connections.

closetimeo=arg

The maximum time (in seconds) that the CIFS client defers sending the final SMB3 close when the client has a handle lease on the file. By default, closetimeo is set to 1 second and can hold values between 0 and a maximum value of 2^30 * HZ.

noposixpaths

If unix extensions are enabled on a share, then the client will typically allow filenames to include any character besides '/' in a pathname component, and will use forward slashes as a pathname delimiter. This option prevents the client from attempting to negotiate the use of posix-style pathnames to the server.

posixpaths

Inverse of noposixpaths .

compress

EXPERIMENTAL FEATURE Enables over-the-wire message compression for SMB 3.1.1 or higher mounts. Mount fails when compress is on and vers is set to a version lower than 3.1.1.

vers=arg

SMB protocol version. Allowed values are:

- 1.0 - The classic CIFS/SMBv1 protocol.

- 2.0 - The SMBv2.002 protocol. This was initially introduced in Windows Vista Service Pack 1, and Windows Server 2008. Note that the initial release version of Windows Vista spoke a slightly different dialect (2.000) that is not supported.

- 2.1 - The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.

- 3.0 - The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.

- 3.02 or 3.0.2 - The SMBv3.0.2 protocol that was introduced in Microsoft Windows 8.1 and Windows Server 2012R2.

- 3.1.1 or 3.11 - The SMBv3.1.1 protocol that was introduced in Microsoft Windows 10 and Windows Server 2016.

- 3 - The SMBv3.0 protocol version and above.

- default - Tries to negotiate the highest SMB2+ version supported by both the client and server.

If no dialect is specified on mount vers=default is used. To check Dialect refer to /proc/fs/cifs/DebugData

Note too that while this option governs the protocol version used, not all features of each version are available.

The default since v4.13.5 is for the client and server to negotiate the highest possible version greater than or equal to 2.1. In kernels prior to v4.13, the default was 1.0. For kernels between v4.13 and v4.13.5 the default is 3.0.

sloppy

Allows the system to ignore any unrecognized mount options that follow this option instead of failing to mount altogether.

--verbose

Print additional debugging information for the mount. Note that this parameter must be specified before the -o . For example:

```
mount -t cifs //server/share /mnt --verbose -o user=username
```

## SERVICE FORMATTING AND DELIMITERS
It's generally preferred to use forward slashes (/) as a delimiter in service names. They are considered to be the "universal delimiter" since they are generally not allowed to be embedded within path components on Windows machines and the client can convert them to backslashes (\) unconditionally. Conversely, backslash characters are allowed by POSIX to be part of a path component, and can't be automatically converted in the same way.

mount.cifs will attempt to convert backslashes to forward slashes where it's able to do so, but it cannot do so in any path component following the sharename.

## INODE NUMBERS
When Unix Extensions are enabled, we use the actual inode number provided by the server in response to the POSIX calls as an inode number.

When Unix Extensions are disabled and serverino mount option is enabled there is no way to get the server inode number. The client typically maps the server-assigned UniqueID onto an inode number.

Note that the UniqueID is a different value from the server inode number. The UniqueID value is unique over the scope of the entire server and is often greater than 2 power 32. This value often makes programs that are not compiled with LFS (Large File Support), to trigger a glibc EOVERFLOW error as this won't fit in the target structure field. It is strongly recommended to compile your programs with LFS support (i.e. with -D_FILE_OFFSET_BITS=64) to prevent this problem. You can also use noserverino mount option to generate inode numbers smaller than 2 power 32 on the client. But you may not be able to detect hardlinks properly.

## CACHE COHERENCY
With a network filesystem such as CIFS or NFS, the client must contend with the fact that activity on other clients or the server could change the contents or attributes of a file without the client being aware of it. One way to deal with such a problem is to mandate that all file accesses go to the server directly. This is performance prohibitive however, so most protocols have some mechanism to allow the client to cache data locally.

The CIFS protocol mandates (in effect) that the client should not cache file data unless it holds an opportunistic lock (aka oplock) or a lease. Both of these entities allow the client to guarantee certain types of exclusive access to a file so that it can access its contents without needing to continually interact with the server. The server will call back the client when it needs to revoke either of them and allow the client a certain amount of time to flush any cached data.

The cifs client uses the kernel's pagecache to cache file data. Any I/O that's done through the pagecache is generally page-aligned. This can be problematic when combined with byte-range locks as Windows' locking is mandatory and can block reads and writes from occurring.

cache=none means that the client never utilizes the cache for normal reads and writes. It always accesses the server directly to satisfy a read or write request.

cache=strict means that the client will attempt to follow the CIFS/SMB2 protocol strictly. That is, the cache is only trusted when the client holds an oplock. When the client does not hold an oplock, then the client bypasses the cache and accesses the server directly to satisfy a read or write request. By doing this, the client avoids problems with byte range locks. Additionally, byte range locks are cached on the client when it holds an oplock and are "pushed" to the server when that oplock is recalled.

cache=loose allows the client to use looser protocol semantics which can sometimes provide better performance at the expense of cache coherency. File access always involves the pagecache. When an oplock or lease is not held, then the client will attempt to flush the cache soon after a write to a file. Note that that flush does not necessarily occur before a write system call returns.

In the case of a read without holding an oplock, the client will attempt to periodically check the attributes of the file in order to ascertain whether it has changed and the cache might no longer be valid. This mechanism is much like the one that NFSv2/3 use for cache coherency, but it particularly problematic with CIFS. Windows is quite "lazy" with respect to updating the LastWriteTime field that the client uses to verify this. The effect is that cache=loose can cause data corruption when multiple readers and writers are working on the same files.

Because of this, when multiple clients are accessing the same set of files, then cache=strict is recommended. That helps eliminate problems with cache coherency by following the CIFS/SMB2 protocols more strictly.

Note too that no matter what caching model is used, the client will always use the pagecache to handle mmap'ed files. Writes to mmap'ed files are only guaranteed to be flushed to the server when msync() is called, or on close().

The default in kernels prior to 3.7 was loose. As of 3.7, the default is strict.

## CIFS/NTFS ACL, SID/UID/GID MAPPING, SECURITY DESCRIPTORS
This option is used to work with file objects which posses Security Descriptors and CIFS/NTFS ACL instead of UID, GID, file permission bits, and POSIX ACL as user authentication model. This is the most common authentication model for CIFS servers and is the one used by Windows.

Support for this requires cifs kernel module built with both CONFIG_CIFS_XATTR and CONFIG_CIFS_ACL options enabled. Since Linux 5.3, CONFIG_CIFS_ACL option no longer exists as CIFS/NTFS ACL support is always built into cifs kernel module.

Most distribution kernels will already have those options enabled by default, but you can still check if they are enabled with:

```
cat /lib/modules/$(uname -r)/build/.config
```

Alternatively, if kernel is configured with CONFIG_IKCONFIG_PROC:

```
zcat /proc/config.gz
```

A CIFS/NTFS ACL is mapped to file permission bits using an algorithm specified in the following Microsoft TechNet document:

http://technet.microsoft.com/en-us/library/bb463216.aspx

In order to map SIDs to/from UIDs and GIDs, the following is required:

- a kernel upcall to the cifs.idmap utility set up via request-key.conf(5)

- winbind or sssd support configured via nsswitch.conf(5)

Please refer to the respective manpages of cifs.idmap(8), winbindd(8) and sssd(8) for more information.

Security descriptors for a file object can be retrieved and set directly using extended attribute named system.cifs_acl. The security descriptors presented via this interface are "raw" blobs of data and need a userspace utility to either parse and format or to assemble it such as getcifsacl(1) and setcifsacl(1) respectively.

Some of the things to consider while using this mount option:

- There may be an increased latency when handling metadata due to additional requests to get and set security descriptors.

- The mapping between a CIFS/NTFS ACL and POSIX file permission bits is imperfect and some ACL information may be lost in the translation.

- If either upcall to cifs.idmap is not setup correctly or winbind or sssd is not configured and running, ID mapping will fail. In that case uid and gid will default to either to those values of the share or to the values of uid and/or gid mount options if specified.

## ACCESSING FILES WITH BACKUP INTENT
For an user on the server, desired access to a file is determined by the permissions and rights associated with that file. This is typically accomplished using ownership and ACL. For a user who does not have access rights to a file, it is still possible to access that file for a specific or a targeted purpose by granting special rights. One of the specific purposes is to access a file with the intent to either backup or restore i.e. backup intent. The right to access a file with the backup intent can typically be granted by making that user a part of the built-in group Backup Operators. Thus, when this user attempts to open a file with the backup intent, open request is sent by setting the bit FILE_OPEN_FOR_BACKUP_INTENT as one of the CreateOptions.

As an example, on a Windows server, a user named testuser, cannot open this file with such a security descriptor:

```
REVISION:0x1
CONTROL:0x9404
OWNER:Administrator
GROUP:Domain Users
ACL:Administrator:ALLOWED/0x0/FULL
```

But the user testuser, if it becomes part of the Backup Operators group, can open the file with the backup intent.

Any user on the client side who can authenticate as such a user on the server, can access the files with the backup intent. But it is desirable and preferable for security reasons amongst many, to restrict this special right.

The mount option backupuid is used to restrict this special right to a user which is specified by either a name or an id. The mount option backupgid is used to restrict this special right to the users in a group which is specified by either a name or an id. Only users matching either backupuid or backupgid shall attempt to access files with backup intent. These two mount options can be used together.

## FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS
The core CIFS protocol does not provide unix ownership information or mode for files and directories. Because of this, files and directories will generally appear to be owned by whatever values the uid= or gid= options are set, and will have permissions set to the default file_mode and dir_mode for the mount. Attempting to change these values via chmod/chown will return success but have no effect.

When the client and server negotiate unix extensions, files and directories will be assigned the uid, gid, and mode provided by the server. Because CIFS mounts are generally single-user, and the same credentials are used no matter what user accesses the mount, newly created files and directories will generally be given ownership corresponding to whatever credentials were used to mount the share.

If the uid's and gid's being used do not match on the client and server, the forceuid and forcegid options may be helpful. Note however, that there is no corresponding option to override the mode. Permissions assigned to a file when forceuid or forcegid are in effect may not reflect the the real permissions.

When unix extensions are not negotiated, it's also possible to emulate them locally on the server using the dynperm mount option. When this mount option is in effect, newly created files and directories will receive what appear to be proper permissions. These permissions are not stored on the server however and can disappear at any time in the future (subject to the whims of the kernel flushing out the inode cache). In general, this mount option is discouraged.

It's also possible to override permission checking on the client altogether via the noperm option. Server-side permission checks cannot be overridden. The permission checks done by the server will always correspond to the credentials used to mount the share, and not necessarily to the user who is accessing the share.

## ENVIRONMENT VARIABLES
The variable USER may contain the username of the person to be used to authenticate to the server. The variable can be used to set both username and password by using the format username%password.

The variable PASSWD may contain the password of the person using the client.

The variable PASSWD_FILE may contain the pathname of a file to read the password from. A single line of input is read and used as the password.

## NOTES
This command may be used only by root, unless installed setuid, in which case the noexec and nosuid mount flags are enabled. When installed as a setuid program, the program follows the conventions set forth by the mount program for user mounts, with the added restriction that users must be able to chdir() into the mountpoint prior to the mount in order to be able to mount onto it.

Some samba client tools like smbclient(8) honour client-side configuration parameters present in smb.conf. Unlike those client tools, mount.cifs ignores smb.conf completely.

## CONFIGURATION
The primary mechanism for making configuration changes and for reading debug information for the cifs vfs is via the Linux /proc filesystem. In the directory /proc/fs/cifs are various configuration files and pseudo files which can display debug information and performance statistics. There are additional startup options such as maximum buffer size and number of buffers which only may be set when the kernel cifs vfs (cifs.ko module) is loaded. These can be seen by running the modinfo utility against the file cifs.ko which will list the options that may be passed to cifs during module installation (device driver load). For more information see the kernel file fs/cifs/README. When configuring dynamic tracing (trace-cmd) note that the list of SMB3 events which can be enabled can be seen at: /sys/kernel/debug/tracing/events/cifs/.

## SECURITY
The use of SMB2.1 or later (including the latest dialect SMB3.1.1) is recommended for improved security and SMB1 is no longer requested by default at mount time. Old dialects such as CIFS (SMB1, ie vers=1.0) have much weaker security. Use of CIFS (SMB1) can be disabled by modprobe cifs disable_legacy_dialects=y.

## BUGS
Mounting using the CIFS URL specification is currently not supported.

The credentials file does not handle usernames or passwords with leading space.

Note that the typical response to a bug report is a suggestion to try the latest version first. So please try doing that first, and always include which versions you use of relevant software when reporting bugs (minimum: mount.cifs (try mount.cifs -V), kernel (see /proc/version) and server type you are trying to contact.

## VERSION
This man page is correct for version 2.18 of the cifs vfs filesystem (roughly Linux kernel 5.0).

## SEE ALSO
cifs.upcall(8), getcifsacl(1), setcifsacl(1)

Documentation/filesystems/cifs.txt and fs/cifs/README in the Linux kernel source tree may contain additional options and information.

## AUTHOR
Steve French

The maintainer of the Linux cifs vfs is Steve French. The maintainer of the cifs-utils suite of user space tools is Pavel Shilovsky. The Linux CIFS Mailing list is the preferred place to ask questions regarding these programs.


clamd

package: clamav

title: clamd(8)

summary: an anti\-virus daemon

text:
# clamd(8)

## NAME
clamd - an anti-virus daemon

## SYNOPSIS
clamd [options]

## DESCRIPTION
The daemon listens for incoming connections on Unix and/or TCP socket and scans files or directories on demand. It reads the configuration from /etc/clamav/clamd.conf

## COMMANDS
It's recommended to prefix clamd commands with the letter z (eg. zSCAN) to indicate that the command will be delimited by a NULL character and that clamd should continue reading command data until a NULL character is read. The null delimiter assures that the complete command and its entire argument will be processed as a single command. Alternatively commands may be prefixed with the letter n (e.g. nSCAN) to use a newline character as the delimiter. Clamd replies will honour the requested terminator in turn. If clamd doesn't recognize the command, or the command doesn't follow the requirements specified below, it will reply with an error message, and close the connection.

Clamd recognizes the following commands:

PING

Check the server's state. It should reply with "PONG".

VERSION

Print program and database versions. This command may be disabled with EnableVersionCommand in clamd.conf. If disabled, clamd replies with COMMAND UNAVAILABLE.

RELOAD

Reload the virus databases. This command may be disabled with EnableReloadCommand in clamd.conf. If disabled, clamd replies with COMMAND UNAVAILABLE.

SHUTDOWN

Perform a clean exit. This command may be disabled with EnableShutdownCommand in clamd.conf. If disabled, clamd replies with COMMAND UNAVAILABLE.

SCAN file/directory

Scan a file or a directory (recursively) with archive support enabled (if not disabled in clamd.conf). A full path is required.

CONTSCAN file/directory

Scan file or directory (recursively) with archive support enabled and don't stop the scanning when a virus is found.

MULTISCAN file/directory

Scan a directory recursively using multiple threads (to make the scanning faster on SMP machines). If the target is not a directory, clamd falls back to non-multiscan scanning behavior.

ALLMATCHSCAN file/directory

It is mandatory to prefix this command with n or z. ALLMATCHSCAN works just like SCAN except that it sets a mode where scanning continues after finding a match within a file. This command may be disabled with AllowAllMatchScan in clamd.conf. If disabled, clamd replies with an ALLMATCHSCAN error.

INSTREAM

It is mandatory to prefix this command with n or z. Scan a stream of data. The stream is sent to clamd in chunks, after INSTREAM, on the same socket on which the command was sent. This avoids the overhead of establishing new TCP connections and problems with NAT. The format of the chunk is: '<length><data>' where <length> is the size of the following data in bytes expressed as a 4 byte unsigned integer in network byte order and <data> is the actual chunk. Streaming is terminated by sending a zero-length chunk. Note: do not exceed StreamMaxLength as defined in clamd.conf, otherwise clamd will reply with INSTREAM size limit exceeded and close the connection.

FILDES

It is mandatory to newline terminate this command, or prefix with n or z. This command only works on UNIX domain sockets. Scan a file descriptor. After issuing a FILDES command a subsequent rfc2292/bsd4.4 style packet (with at least one dummy character) is sent to clamd carrying the file descriptor to be scanned inside the ancillary data. Alternatively the file descriptor may be sent in the same packet, including the extra character.

STATS

It is mandatory to newline terminate this command, or prefix with n or z, it is recommended to only use the z prefix. Replies with statistics about the scan queue, contents of scan queue, and memory usage. The exact reply format is subject to change in future releases. This command may be disabled with EnableStatsCommand in clamd.conf. If disabled, clamd replies with COMMAND UNAVAILABLE.

IDSESSION, END

It is mandatory to prefix this command with n or z, and all commands inside IDSESSION must be prefixed. Start/end a clamd session. Within a session multiple SCAN, INSTREAM, FILDES, VERSION, VERSIONCOMMANDS, PING, and STATS commands can be sent on the same socket without opening new connections. CONTSCAN, MULTISCAN, ALLMATCHSCAN, RELOAD, and SHUTDOWN are not accepted inside an IDSESSION. Replies from clamd will be in the form '<id>: <response>' where <id> is the request number (in ascii, starting from 1) and <response> is the usual clamd reply. The reply lines have same delimiter as the corresponding command had. Clamd will process the commands asynchronously, and reply as soon as it has finished processing.

Clamd requires clients to read all the replies it sent, before sending more commands to prevent send() deadlocks. The recommended way to implement a client that uses IDSESSION is with non-blocking sockets, and a select()/poll() loop: whenever send would block, sleep in select/poll until either you can write more data, or read more replies. Note that using non-blocking sockets without the select/poll loop and alternating recv()/send() doesn't comply with clamd's requirements.

If clamd detects that a client has deadlocked, it will close the connection. Note that clamd may close an IDSESSION connection too if you don't follow the protocol's requirements. The client can use the PING command to keep the connection alive.

VERSIONCOMMANDS

It is mandatory to prefix this command with either n or z. It is recommended to use nVERSIONCOMMANDS. Print program and database versions, followed by "| COMMANDS:" and a space-delimited list of supported commands. Clamd <0.95 will recognize this as the VERSION command, and reply only with their version, without the commands list.

This command can be used as an easy way to check for IDSESSION support for example.

REMOVED COMMANDS

STREAM

The legacy STREAM command is no longer supported. Use INSTREAM instead.

NOT SUPPORTED COMMANDS

SESSION, END

Start/end a clamd session which will allow you to run multiple commands per TCP session. (use IDSESSION instead)

## OPTIONS
-h, --help

Output help information and exit.

-V, --version

Print the version number and exit.

-F, --foreground

Run in foreground; do not daemonize.

--debug

Enable debug mode.

-c FILE, --config-file=FILE

Read configuration from FILE.

--fail-if-cvd-older-than=days

Return with a nonzero error code if the virus database is older than the specified number of days.

--datadir=DIRECTORY

Load signatures from DIRECTORY.

-p FILE, --pid=FILE

Write the daemon's pid to FILE.

--cvdcertsdir=DIR

Specify a directory containing the root CA cert needed to verify detached CVD digital signatures. If not provided, then clamd will look in the default directory.

## ENVIRONMENT VARIABLES
clamd uses the following environment variables:

LD_LIBRARY_PATH

May be used on startup to find the libclamunrar_iface shared library module to enable RAR archive support.

CVD_CERTS_DIR

Specify a directory containing the root CA cert needed to verify detached CVD digital signatures. If not provided, then clamd will look in the default directory.

## SIGNALS
Clamd recognizes the following signals:

SIGHUP

Reopen the logfile.

SIGUSR2

Reload the signature databases.

SIGTERM

Perform a clean exit.

## FILES
/etc/clamav/clamd.conf

## CREDITS
Please check the full documentation for credits.

## AUTHOR
Tomasz Kojm <tkojm@clamav.net>

## SEE ALSO
clamd.conf(5), clamdscan(1), freshclam(1), freshclam.conf(5), clamav-milter(8)


clamonacc

package: clamav-clamonacc

title: clamonacc(8)

summary: an anti\-virus on\-access scanning daemon and clamd client

text:
# clamonacc(8)

## NAME
clamonacc - an anti-virus on-access scanning daemon and clamd client

## SYNOPSIS
clamonacc [options]

## DESCRIPTION
The clamonacc daemon registers for file access notifications from the Linux kernel and in response, submits scans to the clamd scanning daemon for a verdict. On-Access is only available on Linux systems. On Linux, On-Access requires a kernel version >= 3.8. This is because it leverages a kernel api called fanotify to block processes from attempting to access malicious files. This prevention occurs in kernel-space, and thus offers stronger protection than a purely user-space solution.

## OPTIONS
-h, --help

Output help information and exit.

-V, --version

Print the version number and exit.

-v, --verbose

Be verbose.

-l FILE, --log=FILE

Save the scan report to FILE.

-F, --foreground

Run in foreground; do not daemonize.

-W FILE, --watch-list=FILE

Watch directories from FILE.

-e FILE, --exclude-list=FILE

Exclude directories from FILE.

-p A[:I], --ping A[:I]

Ping clamd up to [A] times at optional interval [I] until it responds.

-w, --wait

Wait up to 30 seconds for clamd to start. Optionally use alongside ping to set attempts [A] and interval [I] to check clamd.

--remove

Remove infected files. Be careful.

--move=DIRECTORY

Move infected files into DIRECTORY.

--copy=DIRECTORY

Copy infected files into DIRECTORY.

-c FILE, --config-file=FILE

Read configuration from FILE.

--allmatch

Continue scanning within file after finding a match.

--fdpass

Pass the file descriptor permissions to clamd. This is useful if clamd is running as a different user as it is faster than streaming the file to clamd. Only available if connected to clamd via local(unix) socket.

--stream

Forces file streaming to clamd. This is generally not needed as clamdscan detects automatically if streaming is required. This option only exists for debugging and testing purposes, in all other cases --fdpass is preferred.

## SIGNALS
ClamOnAcc recognizes the following signals:

SIGHUP

Reopen the logfile.

SIGUSR2

Reload the signature databases.

SIGTERM

Perform a clean exit.

## FILES
/etc/clamav/clamd.conf

## CREDITS
Please check the full documentation for credits.

## AUTHOR
Tomasz Kojm <tkojm@clamav.net>

## SEE ALSO
clamd.conf(5), clamd(8)


clamav-milter

package: clamav-milter

title: clamav-milter(8)

summary: milter compatible mail scanner

text:
# clamav-milter(8)

## NAME
clamav-milter - milter compatible mail scanner

## SYNOPSIS
clamav-milter [options]

## DESCRIPTION
Clamav-milter is a filter for sendmail(1) mail server. It uses a mail scanning engine built into clamd(8).

Clamav-milter can use load balancing and fault tolerant techniques to connect to more than one clamd(8) server and seamlessly hot-swap to even the load between different machines and to keep scanning for viruses even when a server goes down.

## OPTIONS
-h, --help

Output help information and exit.

-V, --version

Print the version number and exit.

-c FILE, --config-file=FILE

Read configuration from FILE.

## FILES
/etc/clamav/clamav-milter.conf

## AUTHOR
aCaB <acab@clamav.net>

## SEE ALSO
sendmail(8), clamav-milter.conf(5), clamd(8), clamd.conf(5)


clamsmtpd

package: clamsmtp

title: clamsmtpd(8)

text:
# clamsmtpd(8)

## NAME
clamsmtpd — an SMTP server for scanning viruses via clamd

## SYNOPSIS
clamsmtpd

[-d level] [-f configfile] [-p pidfile]

clamsmtpd

-v

## DESCRIPTION
clamsmtpd is an SMTP filter that allows you to check for viruses using the ClamAV anti-virus software. It accepts SMTP connections and forwards the SMTP commands and responses to another SMTP server.

The DATA email body is intercepted and scanned before forwarding. By default email with viruses are dropped silently and logged without any additional action taken.

clamsmtpd aims to be lightweight and simple rather than have a myriad of options. The options it does have are configured by editing the clamsmtpd.conf(5) file. See the man page for clamsmtpd.conf(5) for more info on the default location of the configuration file.

## OPTIONS
Previous versions had more options. These still work for now but have equivalents in clamsmtpd.conf(5) and are not documented here. The options are as follows.

-d

Don't detach from the console and run as a daemon. In addition the level argument specifies what level of error messages to display. 0 being the least, 4 the most.

-f

configfile specifies an alternate location for the clamsmtpd configuration file. See clamsmtpd.conf(5) for more details on where the configuration file is located by default.

-p

pidfile specifies a location for the a process id file to be written to. This file contains the process id of clamsmtpd and can be used to stop the daemon.

-v

Prints the clamsmtp version number and exits.

## LOGGING
clamsmtpd logs to syslogd by default under the 'mail' facility. You can also output logs to the console using the -d option.

## LOOPBACK FEATURE
In some cases it's advantageous to consolidate the virus scanning and filtering for several mail servers on one machine. clamsmtpd allows this by providing a loopback feature to connect back to the IP that an SMTP connection comes in from.

To use this feature specify only a port number (no IP address) for the OutAddress setting in the configuration file. This will cause clamsmtpd to pass the email back to the said port on the incoming IP address.

Make sure the MaxConnections setting is set high enough to handle the mail from all the servers without refusing connections.

## TRANSPARENT PROXY FEATURE
A transparent proxy is a configuration on a gateway that routes certain types of traffic through a proxy server without any changes on the client computers. clamsmtpd has support for transparent proxying of SMTP traffic by enabling the TransparentProxy setting. This type of setup usually involves firewall rules which redirect traffic to clamsmtpd and the setup varies from OS to OS. The SMTP traffic will be forwarded to it's original destination after being scanned.

When doing transparent proxying for outgoing email it's probably a good idea to turn on bounce notifications using the Action: bounce setting. Also note that some features (such as SSL/TLS) will not be available when going through the transparent proxy.

Make sure that the MaxConnections setting is set high enough for your transparent proxying. Because clamsmtpd is not being used as a filter inside a queue, which usually throttles the amount of email going through, this setting may need to be higher than usual.

## VIRUS ACTIONS
Using the VirusAction option you can run a script or program whenever a virus is found. This may be handy in certain circumstances but it has several drawbacks. For one, the performance of the virus filtering will take a hit, perhaps DOS'ing your machine under heavy load. Secondly as with running any program there are security implications to be considered.

The script is run without its output being logged, or return value being checked. Because of this you should test it thoroughly. Make sure it runs without problems under the user that clamsmtpd(8) is being run as.

Various environment variables will be present when your script is run. You may need to escape them properly before use in your favorite scripting language. Failure to do this could lead to a REMOTE COMPROMISE of your machine.

CLIENT

The network address of the SMTP client connected.

EMAIL

When the Quarantine option is enabled, this specifies the file that the virus was saved to.

RECIPIENTS

The email addresses of the email recipients. These are specified one per line, in standard address format.

REMOTE

If clamsmtpd is being used to filter email between SMTP servers, then this is the IP address of the original client. In order for this information to be present (a) the SMTP client (sending server) must an send an XFORWARD command and (b) the SMTP server (receiving server) must accept that XFORWARD command without error.

REMOTE_HELO

If clamsmtpd is being used to filter email between SMTP servers, then this is the HELO/EHLO banner of the original client. In order for this information to be present (a) the SMTP client (sending server) must an send an XFORWARD command and (b) the SMTP server (receiving server) must accept that XFORWARD command without error.

SENDER

The email address for the sender of the email.

SERVER

The network address of the SMTP server we're connected to.

TMPDIR

The path to the temp directory in use. This is the same as the TempDirectory option.

VIRUS

The name of the virus found.

## SECURITY
There's no reason to run this daemon as root. It is meant as a filter and should listen on a high TCP port. It's probably a good idea to run it using the same user as the clamd(8) daemon. This way the temporary files it writes are accessible to clamd(8)

Care should be taken with the directory that clamsmtpd writes its temporary files to. In order to be secure, it should not be a world writeable location. Specify the directory using the TempDirectory setting.

When using the VirusAction option make sure you understand the security issues involved. Unescaped environment variables can lead to execution of arbitrary shell commands on your machine.

If running clamsmtpd on a publicly accessible IP address or without a firewall please be sure to understand all the possible security issues. This is especially true if the loopback feature is used (see above).

## SEE ALSO
clamsmtpd.conf(5) clamd(8), clamdscan(1)

## AUTHOR
Stef Walter ⟨stef@memberwebs.com⟩


cockpit-tls

package: cockpit-ws

title: cockpit-tls(8)

summary: TLS proxy for Cockpit web service

text:
# cockpit-tls(8)

## NAME
cockpit-tls - TLS proxy for Cockpit web service

## SYNOPSIS
cockpit-tls [--help] [--port PORT] [--no-tls] [--idle-timeout SECONDS]

## DESCRIPTION
The cockpit-tls program is a TLS terminating HTTP proxy for cockpit-ws(8). It manages a set of isolated cockpit-ws instances, one per TLS client certificate, plus one for TLS without a client certificate, and one for unencrypted HTTP. With that, one session cannot tamper with another one through possible security vulnerability exploits.

Users or administrators should never need to start this program as it automatically started by systemd(1) via socket activation.

## TRANSPORT SECURITY
To specify the TLS certificate the web service should use, simply drop a file with the extension .cert in the /etc/cockpit/ws-certs.d directory, or below $XDG_CONFIG_DIRS if set (see cockpit.conf[1]). If there are multiple files in this directory, then the highest priority one is chosen after sorting.

The .cert file should contain at least two OpenSSL style PEM blocks. First one or more BEGIN CERTIFICATE blocks for the server certificate and intermediate certificate authorities and a second one containing a BEGIN PRIVATE KEY or similar. The key must not be encrypted.

If there is no TLS certificate, a self-signed certificate is automatically generated using sscg (if available) or openssl and stored in the 0-self-signed.cert file.

When enrolling into a FreeIPA domain, an SSL certificate is requested from the IPA server and stored in 10-ipa.cert.

To check which certificate cockpit-ws will use, run the following command.

```
$ sudo /usr/libexec/cockpit-certificate-ensure --check
```

Or, on Debian-based systems:

```
$ sudo /usr/lib/cockpit/cockpit-certificate-ensure --check
```

If using certmonger to manage certificates, following command can be used to generate a certificate/key pair:

```
CERT_FILE=/etc/cockpit/ws-certs.d/50-certmonger.crt
KEY_FILE=/etc/cockpit/ws-certs.d/50-certmonger.key
getcert request -f ${CERT_FILE} -k ${KEY_FILE} -D $(hostname --fqdn)
```

## OPTIONS
--help

Show help options.

--port PORT

Serve HTTP requests on PORT instead of port 9090. Usually Cockpit is started on demand by systemd socket activation, and this option has no effect. Update the ListenStream directive cockpit.socket file in the usual systemd manner.

--no-tls

Don't use TLS. Certificates will not be read, and https connections denied. Then cockpit-tls will only manage a single cockpit-ws instance, and thus not do anything different than running cockpit-ws --no-tls directly. Only use this for debugging or testing.

--idle-timeout SECONDS

If greater than 0, exit if no connections have happened for the given number of seconds, i. e. the server is idle. If not given, the default is 90.

## ENVIRONMENT
The cockpit-tls program expects the RUNTIME_DIRECTORY environment variable to be set to an empty directory (preferably in /run/) that is only accessible by the system user under which it is running. This contains the Unix sockets for communicating with the cockpit-ws instances, and in the future, state information about client certificates. This variable is normally set by the cockpit.service systemd unit.

In addition, cockpit-tls will use the XDG_CONFIG_DIRS environment variable from the XDG basedir spec[2] to find its certificates and the cockpit.conf(5) configuration file.

## BUGS
Please send bug reports to either the distribution bug tracker or the upstream bug tracker[3].

## AUTHOR
Cockpit has been written by many contributors[4].

## SEE ALSO
cockpit-ws(8) , cockpit.conf(5) , systemd(1)

## NOTES
1.

cockpit.conf

[set $man.base.url.for.relative.links]/./cockpit.conf.5.html

2.

XDG basedir spec

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

3.

upstream bug tracker

https://github.com/cockpit-project/cockpit/issues/new

4.

contributors

https://github.com/cockpit-project/cockpit/graphs/contributors


cockpit-ws

title: cockpit-ws(8)

summary: Cockpit web service

text:
# cockpit-ws(8)

## NAME
cockpit-ws - Cockpit web service

## SYNOPSIS
cockpit-ws [--help] [--port PORT] [--address ADDRESS] [--no-tls] [--for-tls-proxy] [--local-ssh] [--local-session BRIDGE]

## DESCRIPTION
The cockpit-ws program is the web service component used for communication between the browser application and various configuration tools and services like cockpit-bridge(1).

Users or administrators should never need to start this program as it automatically started by systemd(1) on bootup, through cockpit-tls(8).

## TRANSPORT SECURITY
cockpit-ws is normally run behind the cockpit-tls TLS terminating proxy, and only deals with unencrypted HTTP by itself. But for backwards compatibility it can also handle TLS connections by itself when being run directly. For details how to configure certificates, please refer to the cockpit-tls(8) documentation.

## TIMEOUT
When started via systemd(1) then cockpit-ws will exit after 90 seconds if nobody logs in, or after the last user is disconnected.

## OPTIONS
--help

Show help options.

--port PORT

Serve HTTP requests PORT instead of port 9090. Usually Cockpit is started on demand by systemd socket activation, and this option has no effect. Update the ListenStream directive cockpit.socket file in the usual systemd manner.

--address ADDRESS

Bind to address ADDRESS instead of binding to all available addresses. Usually Cockpit is started on demand by systemd socket activation, and this option has no effect. In that case, update the ListenStream directive in the cockpit.socket file in the usual systemd manner.

--no-tls

Don't use TLS.

--for-tls-proxy

Tell cockpit-ws that it is running behind a local reverse proxy that does the TLS termination. Then Cockpit puts https:// URLs into the default Content-Security-Policy, and accepts only https:// origins, instead of http: ones by default. However, if Origins is set in the cockpit.conf(5) configuration file, it will override this default.

--local-ssh

Normally cockpit-ws uses cockpit-session and PAM to authenticate the user and start a user session. With this option enabled, it will instead authenticate via SSH at 127.0.0.1 port 22.

--local-session BRIDGE

Skip all authentication and cockpit-session, and launch the cockpit-bridge specified in BRIDGE in the local session. If the BRIDGE is specified as - then expect an already running bridge that is connected to stdin and stdout of this cockpit-ws process. This allows the web server to run as any unprivileged user in an already running session. This mode implies --no-tls, thus you need to use http:// URLs with this.

Warning

If you use this, you have to isolate the opened TCP port somehow (for example in a network namespace), otherwise all other users (or even remote machines if the port is not just listening on localhost) can access the session!

## ENVIRONMENT
The cockpit-ws process will use the XDG_CONFIG_DIRS environment variable from the XDG basedir spec[1] to find its cockpit.conf(5) configuration file.

In addition the XDG_DATA_DIRS environment variable from the XDG basedir spec[1] can be used to override the location to serve static files from. These are the files that are served to a non-logged in user.

## BUGS
Please send bug reports to either the distribution bug tracker or the upstream bug tracker[2].

## AUTHOR
Cockpit has been written by many contributors[3].

## SEE ALSO
cockpit-tls(8) , cockpit.conf(5) , systemd(1)

## NOTES
1.

XDG basedir spec

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

2.

upstream bug tracker

https://github.com/cockpit-project/cockpit/issues/new

3.

contributors

https://github.com/cockpit-project/cockpit/


title: pam_ssh_add(8)

text:
# pam_ssh_add(8)

## NAME
pam_ssh_add - PAM module to auto load ssh keys into an agent

## DESCRIPTION
pam_ssh_add provides authentication and session modules that allow users to start their session with a running ssh-agent with as many ssh keys loaded as possible.

If used, the authentication module simply stores the authentication token for later use by the session module. Because this module performs no actual authentication it returns PAM_CRED_INSUFFICIENT on success and should always be accompanied by an actual authentication module in your pam configuration.

By default the session module will start a new ssh-agent and run ssh-add, loading any keys that exist in the default path for the newly logged in user. If any keys prompt for a password, and a authentication token was successfully stored, that token will be provided as the password.

## OPTIONS
debug

This option will turn on debug logging to syslog.

## EXAMPLES

```
        auth     required  pam_unix.so

        auth     optional  pam_ssh_add.so

        session  optional  pam_ssh_add.so

```

## AUTHOR
Cockpit has been written by many contributors[1].

## BUGS
Please send bug reports to either the distribution bug tracker or the upstream bug tracker[2].

## NOTES
1.

contributors

https://github.com/cockpit-project/cockpit/

2.

upstream bug tracker

https://github.com/cockpit-project/cockpit/issues/new


conmon

package: conmon

title: conmon(8)

summary: container monitor utility

text:
# conmon(8)

## NAME
conmon - container monitor utility

## SYNOPSIS
conmon [options]

## DESCRIPTION
conmon is a command-line program for monitoring and managing the lifecycle of Linux containers that follow the Open Container Initiative (OCI) format.

## APPLICATION OPTIONS
--api-version Conmon API version to use.

-b, --bundle Location of the OCI Bundle path.

-c, --cid Identification of Container.

--exec-attach Attach to an exec session.

-e, --exec Exec a command into a running container.

--exec-process-spec Path to the process spec for execution.

--exit-command Path to the program to execute when the container terminates its execution.

--exit-command-arg Additional arguments to pass to the exit command. Can be specified multiple times.

--exit-delay Delay before invoking the exit command (in seconds).

--exit-dir Path to the directory where exit files are written.

--full-attach Don't truncate the path to the attach socket. This option causes conmon to ignore --socket-dir-path.

-h, --help Show help options.

-i, --stdin Open up a pipe to pass stdin to the container.

This option tells conmon to setup the pipe regardless of whether there is a terminal connection.

-l, --log-path Path to store all stdout and stderr messages from the container.

--leave-stdin-open Leave stdin open when the attached client disconnects.

--log-level Print debug logs based on the log level.

--log-max-files Maximum number of log backup files to keep when log rotation is enabled. Default is 1.

--log-rotate Enable log rotation instead of log truncation. When enabled, log files are rotated with numbered suffixes (.1, .2, etc.) instead of being truncated when they reach the maximum size.

--log-size-max Maximum size of the log file (in bytes).

--log-global-size-max Maximum size of all log files combined (in bytes).

--log-tag Additional tag to use for logging.

--log-allowlist-dir Specifies allowed directories for log file creation. This option can be specified multiple times to allow multiple directories. When configured, log files can only be created within these allowed directories or their subdirectories. If not specified, log files can be created in any location.

--log-label Additional label to use for logging. The accepted format is LABEL=VALUE. Can be specified multiple times. Note that LABEL must contain only uppercase letters, numbers and underscore character.

--no-container-partial-message Do not set CONTAINER_PARTIAL_MESSAGE=true for partial lines in journald logs. This prevents splitting of long log lines into multiple journal entries, which can be problematic for systems that parse structured logs like JSON. Only affects journald log driver.

-n, --name Container name.

--no-new-keyring Do not create a new session keyring for the container.

--no-pivot Do not use pivot_root.

--no-sync-log Do not manually call sync on logs after container shutdown.

-0, --persist-dir Persistent directory for a container that can be used for storing container data.

-p, --container-pidfile PID file for the initial pid inside of the container.

-P, --conmon-pidfile PID file for the conmon process.

-r, --runtime Path to store runtime data for the container.

--replace-listen-pid Replace listen PID if set for oci-runtime PID.

--restore Restore a container from a checkpoint.

--runtime-arg Additional arguments to pass to the runtime. Can be specified multiple times.

--runtime-opt Additional options to pass to the restore or exec command. Can be specified multiple times.

-s, --systemd-cgroup Enable systemd cgroup manager, rather than use the cgroupfs directly.

--socket-dir-path Location of container attach sockets.

--sdnotify-socket Path to the host's sd-notify socket to relay messages to.

--sync Keep the main conmon process as its child by only forking once.

--syslog Log to syslog (use with cgroupfs cgroup manager).

-t, --terminal Allocate a pseudo-TTY. The default is false.

When set to true, conmon will allocate a pseudo-tty and attach to the standard input of the container. This can be used, for example, to run a throwaway interactive shell. The default is false.

-T, --timeout Kill container after specified timeout in seconds.

-u, --cuuid Specify the Container UUID to use.

--version Print the version and exit.

## SEE ALSO
podman(1), buildah(1), cri-o(1), crun(8), runc(8)

## HISTORY
October 2020, Originally compiled by Dan Walsh ⟨dwalsh@redhat.com⟩


connman

package: connman

title: connman(8)

summary: network management daemon

text:
# connman(8)

## NAME
ConnMan - network management daemon

## SYNOPSIS
connmand [--version|--help]

connmand [-c file] [-d [file[,...]]] [-i interface[,...]] [-I interface[,...]] [-W driver[,...]] [-p plugin[,...]] [-P plugin[,...]] [-n] [-r]

## DESCRIPTION
The ConnMan provides a daemon for managing internet connections within devices running the Linux operating system. The Connection Manager is designed to be slim and to use as few resources as possible. It is a fully modular system that can be extended, through plug-ins, to support all kinds of wired or wireless technologies. Also, configuration methods, like DHCP and domain name resolving, are implemented using plug-ins. The plug-in approach allows for easy adaption and modification for various use cases.

## OPTIONS
The following options are supported:

-v, --version

Print the ConnMan software version and exit.

-h, --help

Print ConnMan's available options and exit.

-c file, --config=file

Specify configuration file to set up various settings for ConnMan. If not specified, the default value of /etc/connman/main.conf is used. See connman.conf(5) for more information on configuration file. The use of config file is optional and sane default values are used if config file is missing.

-d [file[,...]], --debug[=file[,...]]

Sets how much information ConnMan sends to the log destination (usually syslog's "daemon" facility). If the file options are omitted, then debugging information from all the source files are printed. If file options are present, then only debug prints from that source file are printed. Example:

connmand --debug=src/service.c,plugins/wifi.c

-i interface[,...], --device=interface[,...]

Only manage these network interfaces. By default all network interfaces are managed.

-I interface[,...], --nodevice=interface[,...]

Never manage these network interfaces. The option can be a pattern containing "*" and "?" characters.

-p plugin[,...], --plugin=plugin[,...]

Load these plugins only. The option can be a pattern containing "*" and "?" characters.

-P plugin[,...], --noplugin=plugin[,...]

Never load these plugins. The option can be a pattern containing "*" and "?" characters.

-W driver[,...], --wifi=driver[,...]

Wifi driver that WiFi/Supplicant should use. If this flag is omitted, then the value "nl80211,wext" is used by default.

-n, --nobacktrace

Don't print out backtrace information.

-n, --nodaemon

Do not daemonize. This is useful for debugging, and directs log output to the controlling terminal in addition to syslog.

-r, --nodnsproxy

Do not act as a DNS proxy or support external DNS resolving. Depending on how ConnMan is compiled, it will by default direct all DNS traffic to itself by setting nameserver to 127.0.0.1 in resolv.conf(5) file or leave DNS management to an external entity, such as systemd-resolved. If this is not desired and you want that all programs call directly some DNS server, then you can use the --nodnsproxy option. ConnMan then figures out the DNS server and search domain on startup and sets them in resolv.conf(5). If this option is used, then ConnMan is not able to cache the DNS queries because the DNS traffic is not going through ConnMan and that can cause some extra network traffic.

## SEE ALSO
connmanctl(1), connman.conf(5), connman-service.config(5), connman-vpn(8)


connman-vpn

title: connman-vpn(8)

summary: VPN management daemon

text:
# connman-vpn(8)

## NAME
ConnMan-VPN - VPN management daemon

## SYNOPSIS
connman-vpnd [--version|--help]

connman-vpnd [-c file] [-d [file[,...]]] [-p plugin[,...]] [-P plugin[,...]] [-n]

## DESCRIPTION
The ConnMan-VPN provides a daemon for managing vpn connections together with connmand(8). The Connection Manager is designed to be slim and to use as few resources as possible. The VPN daemon supports openconnect(8), openvpn(8), vpnc(8) and L2TP/PPTP (xl2tpd.conf(5), pptp(8), pppd(8)).

## OPTIONS
The following options are supported:

-v, --version

Print the ConnMan-VPN software version and exit.

-h, --help

Print ConnMan-VPN's available options and exit.

-c file, --config=file

Specify configuration file to set up various settings for ConnMan. If not specified, the default value of /etc/connman/connman-vpn.conf is used. See connman-vpn.conf(5) for more information on configuration file. The use of config file is optional and sane default values are used if config file is missing.

-d [file[,...]], --debug[=file[,...]]

Sets how much information ConnMan-VPN sends to the log destination (usually syslog's "daemon" facility). If the file options are omitted, then debugging information from all the source files are printed. If file options are present, then only debug prints from that source file are printed. Example:

connman-vpnd --debug=vpn/vpn-provider.c,vpn/vpn-config.c

-n, --nodaemon

Do not daemonize. This is useful for debugging, and directs log output to the controlling terminal in addition to syslog.

## SEE ALSO
connmanctl(1), connman-vpn.conf(5), connman-vpn-provider.config(5), connmand(8)


conntrack

package: conntrack-tools

title: conntrack(8)

text:
# conntrack(8)

## NAME
conntrack - command line interface for netfilter connection tracking

## SYNOPSIS
conntrack -L [table] [options] [-z]

conntrack -G [table] parameters

conntrack -D [table] parameters

conntrack -I [table] parameters

conntrack -A [table] parameters

conntrack -U [table] parameters

conntrack -E [table] [options]

conntrack -F [table]

conntrack -C [table]

conntrack -S

conntrack -R file

## DESCRIPTION
The conntrack utility provides a full-featured userspace interface to the Netfilter connection tracking system that is intended to replace the old /proc/net/ip_conntrack interface. This tool can be used to search, list, inspect and maintain the connection tracking subsystem of the Linux kernel.

Using conntrack, you can dump a list of all (or a filtered selection of) currently tracked connections, delete connections from the state table, and even add new ones.

In addition, you can also monitor connection tracking events, e.g. show an event message (one line) per newly established connection.

## TABLES
The connection tracking subsystem maintains several internal tables:

conntrack:

This is the default table. It contains a list of all currently tracked connections through the system. If you don't use connection tracking exemptions (NOTRACK iptables target), this means all connections that go through the system.

expect:

This is the table of expectations. Connection tracking expectations are the mechanism used to "expect" RELATED connections to existing ones. Expectations are generally used by "connection tracking helpers" (sometimes called application level gateways [ALGs]) for more complex protocols such as FTP, SIP or H.323.

dying:

This table shows the conntrack entries, that have expired and that have been destroyed by the connection tracking system itself, or via the conntrack utility.

unconfirmed:

This table shows new entries, that are not yet inserted into the conntrack table. These entries are attached to packets that are traversing the stack, but did not reach the confirmation point at the postrouting hook. The tables "dying" and "unconfirmed" are basically only useful for debugging purposes. Under normal operation, it is hard to see entries in any of them. There are corner cases, where it is valid to see entries in the unconfirmed table, eg. when packets that are enqueued via nfqueue, and the dying table, eg. when conntrackd(8) runs in event reliable mode.

## OPTIONS
The options recognized by conntrack can be divided into several different groups.

### COMMANDS
These options specify the particular operation to perform. Only one of them can be specified at any given time.

-L --dump

List connection tracking or expectation table

-G, --get

Search for and show a particular (matching) entry in the given table.

-D, --delete

Delete an entry from the given table.

-I, --create

Create a new entry from the given table, it fails if it already exists.

-A, --add

Add a new entry from the given table.

-U, --update

Update an entry from the given table.

-E, --event

Display a real-time event log.

-F, --flush

Flush the whole given table

-C, --count

Show the table counter.

-S, --stats

Show the in-kernel connection tracking system statistics.

-R, --load-file

Load entries from a given file. To read from stdin, "-" should be specified.

### PARAMETERS
-z, --zero

Atomically zero counters after reading them. This option is only valid in combination with the "-L, --dump" command options.

-o, --output [extended,xml,save,timestamp,id,ktimestamp,labels]

Display output in a certain format. With the extended output option, this tool displays the layer 3 information. With ktimestamp, it displays the in-kernel timestamp available since 2.6.38 (you can enable it via the sysctl(8) key net.netfilter.nf_conntrack_timestamp). The labels output option tells conntrack to show the names of connection tracking labels that might be present. The userspace output option tells if the event has been triggered by a process.

-e, --event-mask [ALL|NEW|UPDATES|DESTROY][,...]

Set the bitmask of events that are to be generated by the in-kernel ctnetlink event code. Using this parameter, you can reduce the event messages generated by the kernel to the types that you are actually interested in. This option can only be used in conjunction with "-E, --event".

-b, --buffer-size value

Set the Netlink socket buffer size in bytes. This option is useful if the command line tool reports ENOBUFS errors. If you do not pass this option, the default value available at sysctl(8) key net.core.rmem_default is used. The tool reports this problem if your process is too slow to handle all the event messages or, in other words, if the amount of events is big enough to overrun the socket buffer. Note that using a big buffer reduces the chances to hit ENOBUFS, however, this results in more memory consumption. This option can only be used in conjunction with "-E, --event".

### FILTER PARAMETERS
-s, --src, --orig-src IP_ADDRESS

Match only entries whose source address in the original direction equals the one specified as argument. Implies "--mask-src" when CIDR notation is used.

-d, --dst, --orig-dst IP_ADDRESS

Match only entries whose destination address in the original direction equals the one specified as argument. Implies "--mask-dst" when CIDR notation is used.

-r, --reply-src IP_ADDRESS

Match only entries whose source address in the reply direction equals the one specified as argument.

-q, --reply-dst IP_ADDRESS

Match only entries whose destination address in the reply direction equals the one specified as argument.

-p, --proto PROTO

Specify layer four (TCP, UDP, ...) protocol.

-f, --family PROTO

Specify layer three (ipv4, ipv6) protocol. This option is only required in conjunction with "-L, --dump". If this option is not passed, the default layer 3 protocol will be IPv4.

-t, --timeout TIMEOUT

Specify the timeout.

-m, --mark MARK[/MASK]

Specify the conntrack mark. Optionally, a mask value can be specified. In "--update" mode, this mask specifies the bits that should be zeroed before XORing the MARK value into the ctmark. Otherwise, the mask is logically ANDed with the existing mark before the comparison. In "--create" mode, the mask is ignored.

-l, --label LABEL

Specify a conntrack label. This option is only available in conjunction with "-L, --dump", "-E, --event", "-U --update" or "-D --delete". Match entries whose labels include those specified as arguments. Use multiple -l options to specify multiple labels that need to be set.

--label-add LABEL

Specify the conntrack label to add to the selected conntracks. This option is only available in conjunction with "-I, --create", "-A, --add" or "-U, --update".

--label-del [LABEL]

Specify the conntrack label to delete from the selected conntracks. If no label is given, all labels are deleted. This option is only available in conjunction with "-U, --update".

-c, --secmark SECMARK

Specify the conntrack selinux security mark.

-u, --status [ASSURED|SEEN_REPLY|FIXED_TIMEOUT|EXPECTED|OFFLOAD|UNSET][,...]

Specify the conntrack status.

-n, --src-nat

Filter source NAT connections.

-g, --dst-nat

Filter destination NAT connections.

-j, --any-nat

Filter any NAT connections.

-w, --zone

Filter by conntrack zone. See iptables CT target for more information.

--orig-zone

Filter by conntrack zone in original direction. See iptables CT target for more information.

--reply-zone

Filter by conntrack zone in reply direction. See iptables CT target for more information.

--tuple-src IP_ADDRESS

Specify the tuple source address of an expectation. Implies "--mask-src" when CIDR notation is used.

--tuple-dst IP_ADDRESS

Specify the tuple destination address of an expectation. Implies "--mask-dst" when CIDR notation is used.

--mask-src IP_ADDRESS

Specify the source address mask. For conntracks this option is only available in conjunction with "-L, --dump", "-E, --event", "-U --update" or "-D --delete". For expectations this option is only available in conjunction with "-I, --create".

--mask-dst IP_ADDRESS

Specify the destination address mask. Same limitations as for "--mask-src".

### PROTOCOL FILTER PARAMETERS
TCP-specific fields:

--sport, --orig-port-src PORT

Source port in original direction

--dport, --orig-port-dst PORT

Destination port in original direction

--reply-port-src PORT

Source port in reply direction

--reply-port-dst PORT

Destination port in reply direction

--state state

TCP state, one of NONE, SYN_SENT, SYN_RECV, ESTABLISHED, FIN_WAIT, CLOSE_WAIT, LAST_ACK, TIME_WAIT, CLOSE or LISTEN.

UDP-specific fields:

--sport, --orig-port-src PORT

Source port in original direction

--dport, --orig-port-dst PORT

Destination port in original direction

--reply-port-src PORT

Source port in reply direction

--reply-port-dst PORT

Destination port in reply direction

ICMP-specific fields:

--icmp-type TYPE

ICMP Type. Has to be specified numerically.

--icmp-code CODE

ICMP Code. Has to be specified numerically.

--icmp-id ID

ICMP Id. Has to be specified numerically (non-mandatory)

UDPlite-specific fields:

--sport, --orig-port-src PORT

Source port in original direction

--dport, --orig-port-dst PORT

Destination port in original direction

--reply-port-src PORT

Source port in reply direction

--reply-port-dst PORT

Destination port in reply direction

SCTP-specific fields:

--sport, --orig-port-src PORT

Source port in original direction

--dport, --orig-port-dst PORT

Destination port in original direction

--reply-port-src PORT

Source port in reply direction

--reply-port-dst PORT

Destination port in reply direction

--state state

SCTP state, one of NONE, CLOSED, COOKIE_WAIT, COOKIE_ECHOED, ESTABLISHED, SHUTDOWN_SENT, SHUTDOWN_RECD, SHUTDOWN_ACK_SENT.

--orig-vtag value

Verification tag (32-bits value) in the original direction

--reply-vtag value

Verification tag (32-bits value) in the reply direction

DCCP-specific fields (needs Linux >= 2.6.30):

--sport, --orig-port-src PORT

Source port in original direction

--dport, --orig-port-dst PORT

Destination port in original direction

--reply-port-src PORT

Source port in reply direction

--reply-port-dst PORT

Destination port in reply direction

--state state

DCCP state, one of NONE, REQUEST, RESPOND, PARTOPEN, OPEN, CLOSEREQ, CLOSING, TIMEWAIT.

--role [client|server]

Role that the original conntrack tuple is tracking

GRE-specific fields:

--srckey, --orig-key-src KEY

Source key in original direction (in hexadecimal or decimal)

--dstkey, --orig-key-dst KEY

Destination key in original direction (in hexadecimal or decimal)

--reply-key-src KEY

Source key in reply direction (in hexadecimal or decimal)

--reply-key-dst KEY

Destination key in reply direction (in hexadecimal or decimal)

## DIAGNOSTICS
The exit code is 0 for correct function. Errors which appear to be caused by invalid command line parameters cause an exit code of 2. Any other errors cause an exit code of 1.

## EXAMPLES
conntrack -L

Show the connection tracking table in /proc/net/ip_conntrack format

conntrack -L -o extended

Show the connection tracking table in /proc/net/nf_conntrack format, with additional information.

conntrack -L -o xml

Show the connection tracking table in XML

conntrack -L -o save

Show the connection tracking table in conntrack syntax format

conntrack -L -f ipv6 -o extended

Only dump IPv6 connections in /proc/net/nf_conntrack format, with additional information.

conntrack -L --src-nat

Show source NAT connections

conntrack -E -o timestamp

Show connection events together with the timestamp

conntrack -D -s 1.2.3.4

Delete all flows whose source address is 1.2.3.4

conntrack -U -s 1.2.3.4 -m 1

Set connmark to 1 of all the flows whose source address is 1.2.3.4

conntrack -L -w 11 -o save | sed s/-w 11/-w 12/g | conntrack --load-file -

Copy all entries from ct zone 11 to ct zone 12

## BUGS
Please, report them to netfilter-devel@vger.kernel.org or file a bug in Netfilter's bugzilla (https://bugzilla.netfilter.org).

## SEE ALSO
nftables(8),iptables(8),conntrackd(8)

See http://conntrack-tools.netfilter.org

## AUTHORS
Jay Schulist, Patrick McHardy, Harald Welte and Pablo Neira Ayuso wrote the kernel-level "ctnetlink" interface that is used by the conntrack tool.

Pablo Neira Ayuso wrote and maintains the conntrack tool, Harald Welte added support for conntrack-based accounting counters.

Man page written by Harald Welte <laforge@netfilter.org> and Pablo Neira Ayuso <pablo@netfilter.org>.


conntrackd

title: conntrackd(8)

text:
# conntrackd(8)

## NAME
conntrackd - netfilter connection tracking user-space daemon

## SYNOPSIS
conntrackd [options]

## DESCRIPTION
conntrackd is the user-space daemon for the netfilter connection tracking system. This daemon synchronizes connection tracking states between several replica firewalls. Thus, conntrackd can be used to deploy highly available stateful firewalls.

The daemon supports Primary-Backup and Multiprimary setups and can also be used as statistics collector.

## OPTIONS
The options recognized by conntrackd can be divided into two different groups.

### GEMERAL OPTIONS
General options for the conntrackd daemon.

-d

Run conntrackd in daemon mode (fork to background).

-C <path>

Load config file specified in path. See conntrackd.conf(5) for details.

-v

Display version information.

-h

Display help information.

### CLIENT COMMANDS
conntrackd can be used in client mode to request several information and operations to a running instance of the daemon.

-i [ct|expect]

Dump the internal cache, i.e. show local states

-e [ct|expect]

Dump the external cache, i.e. show foreign states

-x

Display output in XML format. This option is only valid in combination with -i and -e parameters.

-f [internal|external]

Flush the internal and/or external cache

-F [ct|expect]

Flush the kernel conntrack table (if you use a Linux kernel >= 2.6.29, this option will not flush your internal and external cache).

-c

Commit external cache to conntrack table.

-B

Force a bulk send to other replica firewalls. With this command, you will ask conntrackd to send the state-entries that it owns to others.

-n

Request resync with other node (only FT-FW and NOTRACK modes).

-k

Kill the daemon

-s [network|cache|runtime|link|rsqueue|process|queue|ct|expect]

Dump statistics. If no parameter is passed, it displays the general statistics.

If "network" is passed as parameter it displays the networking statistics.

If "cache" is passed as parameter, it shows the extended cache statistics.

If "runtime" is passed as parameter, it shows the run-time statistics.

If "process" is passed as parameter, it shows existing child processes (if any).

If "queue" is passed as parameter, it shows queue statistics.

If "ct" is passed, it displays the general statistics.

If "expect" is passed as parameter, it shows expectation statistics.

-R [ct|expect]

Force a resync against the kernel connection tracking table

-t

Reset the in-kernel timers (See PurgeTimeout clause)

## DIAGNOSTICS
The exit code is 0 for correct function. Errors cause an exit code of 1.

## EXAMPLES
The following example are illustrative, for a real use in a firewall fail-over, check the primary-backup.sh script that comes with the sources.

conntrackd -d

Runs conntrackd in daemon and synchronization mode

conntrackd -i

Dumps the states held in the internal cache, i.e. those handled by this firewall

conntrackd -e

Dumps the states held in the external cache, i.e. those handled by other replica firewalls

conntrackd -c

Commits the external cache into the kernel connection tracking system. This is used to inject the state so that the connections can be recovered during the failover.

## DEPENDENCIES
This daemon requires a Linux kernel version >= 2.6.18. TCP window tracking support requires >= 2.6.22, otherwise you have to disable it. Helpers are fully supported since >= 2.6.25, however, if you use any previous version, depending on the protocol helper and your setup (e.g. if you setup performs NAT sequence adjustments or not), your help connection may be successfully recovered.

There are several unsupported stateful iptables matches such as recent, connbytes and the quota matches which gather internal information to operate. Since that information does not belong to the domain of the connection tracking system, connections affected by those matches may not be fully recovered during the takeover.

The daemon requires a Linux kernel version >= 2.6.26 to support kernel-space event filtering. Otherwise, all the event filtering is done in userspace with the corresponding extra overhead. If you are not using the Filter clause in the configuration file, ignore this notice.

## SYSTEMD INTEGRATION
Starting with the 1.4.4 release, conntrackd includes integration with systemd(1) to use an unit file of Type=notify and watchdog support.

## INCOMPATIBILITIES
During the 0.9.9 development, some important changes in the replication message format were introduced. Therefore, conntrackd >= 0.9.9 will not work appropriately with conntrackd <= 0.9.8.

This should not be a problem if you use the same conntrackd version in all the firewall replica nodes.

## SEE ALSO
conntrackd.conf(5) conntrack(8) iptables(8) nft(8)

http://conntrack-tools.netfilter.org

## BUGS
Please, report them to netfilter-devel@vger.kernel.org (subscription required) or file a bug in Netfilter's bugzilla (https://bugzilla.netfilter.org).

## AUTHORS
Pablo Neira Ayuso wrote and maintains the conntrackd tool

Man page written by Pablo Neira Ayuso <pablo@netfilter.org>.


nfct

title: nfct(8)

text:
# nfct(8)

## NAME
nfct - command line tool to configure with the connection tracking system

## SYNOPSIS
nfct command subsystem [parameters]

## DESCRIPTION
nfct is the command line tool that allows you to configure the Connection Tracking System.

## COMMANDS
list

List the existing objects.

add

Add new object.

delete

Delete an object.

get

Get an existing object.

flush

Flush the accounting object table.

disable

This command is for the helper subsystem. It allows you to disable enqueueing packets to userspace for helper inspection.

default-set

This command is for the timeout subsystem. It allows you to set default protocol timeouts.

default-get

This command is for the timeout subsystem. It allows you to get the default protocol timeouts.

## SUBSYS
By the time this manpage has been written, the supported subsystems are timeout and helper.

timeout

The timeout subsystem allows you to define fine-grain timeout policies.

helper

The helper subsystem allows you to configure userspace helpers.

version

Displays the version information.

help

Displays the help message.

## EXAMPLE
nfct add timeout test-tcp inet tcp established 100 close 10 close_wait 10

This creates a timeout policy for tcp using 100 seconds for the ESTABLISHED state, 10 seconds for CLOSE state and 10 seconds for the CLOSE_WAIT state.

Then, you can attach the timeout policy with the iptables CT target:

iptables -I PREROUTING -t raw -p tcp -j CT --timeout test-tcp

iptables -I OUTPUT -t raw -p tcp -j CT --timeout test-tcp

You can test that the timeout policy with:

conntrack -E -p tcp

It should display:

[UPDATE] tcp 6 100 ESTABLISHED src=192.168.39.100 dst=57.126.1.20 sport=56463 dport=80 src=57.126.1.20 dst=192.168.39.100 sport=80 dport=56463 [ASSURED]

## SEE ALSO
iptables(8),conntrack(8)

## BUGS
Please, report them to netfilter-devel@vger.kernel.org or file a bug in Netfilter's bugzilla (https://bugzilla.netfilter.org).

## AUTHORS
Pablo Neira Ayuso wrote and maintains the nfct tool.

Man page written by Pablo Neira Ayuso <pablo@netfilter.org>.