LinuxCommandLibrary

net

Manage Windows networking resources from Linux

SYNOPSIS

net [global options] <subcommand> [subcommand options] [arguments]

Examples:
net ads join -U administrator
net users add
net share add

PARAMETERS

-U <username>[%<password>]
    Specifies the username and optionally password for authentication. If password is not provided, the user will be prompted.

-S <server_name>
    Specifies the target server to connect to. This can be an IP address or hostname.

-W <workgroup_name>
    Specifies the workgroup or domain to authenticate against.

-d <debug_level>
    Sets the debug level for logging output (0-10), with 0 being no logging and 10 being verbose.

-k
    Enables Kerberos authentication. This requires a valid Kerberos ticket for the user.

-P
    Uses a named pipe for communication (e.g., in a script context).
Note: Most net options are specific to its subcommands and are passed after the subcommand.

DESCRIPTION

net is a versatile command-line utility provided by the Samba suite on Linux systems. It is primarily used for administering Samba servers and interacting with Windows-based networks, including Active Directory domains and Windows workgroups. Unlike general network utilities like netstat or ip, net specifically focuses on the Server Message Block (SMB) and Common Internet File System (CIFS) protocols.

It allows administrators to perform a wide range of tasks such as managing users and groups within a domain, creating and managing network shares, joining a Linux machine to an Active Directory domain, querying domain controller information, and performing Remote Procedure Call (RPC) operations against Windows servers. Its functionality often parallels tools found on Windows systems for domain and share management, making it an essential tool for environments integrating Linux with Windows infrastructure.

CAVEATS

net is part of the Samba suite and should not be confused with generic network utilities like netstat or ip, which are used for displaying system network connections and interfaces.
It requires the Samba client packages to be installed on the Linux system.
Many subcommands require appropriate permissions, often root privileges or a properly configured Kerberos ticket, to function correctly.
Authentication is crucial; incorrect credentials or domain/workgroup settings will lead to errors.

SUBCOMMANDS OVERVIEW

The power of net lies in its extensive set of subcommands, each designed for specific administrative tasks. Common subcommands include:
net ads: For Active Directory domain administration (e.g., join, user, group, computer).
net users: To manage local or domain users.
net group: To manage local or domain groups.
net share: To manage SMB/CIFS network shares.
net rpc: For direct RPC calls to Windows servers (e.g., info, password).
net time: To synchronize time with a Windows server.
net lookup: To resolve NetBIOS names.

AUTHENTICATION METHODS

net supports various authentication methods, primarily NTLM (via username/password) and Kerberos. Kerberos authentication (enabled with -k) is the preferred method for Active Directory environments as it offers stronger security and single sign-on capabilities when properly configured with a Kerberos client and ticket.

HISTORY

The net command is an integral part of the Samba project, which began development in 1992. Samba's primary goal was to provide seamless file and print services between Unix/Linux and Microsoft Windows systems using the Server Message Block (SMB) protocol. The net utility evolved as a command-line interface to expose a wide range of Windows networking functionalities to Unix-like operating systems, offering administrative capabilities that mirror those available on Windows domain controllers and client tools. Its development has closely tracked the evolution of Windows networking, including the shift from NT domains to Active Directory.

SEE ALSO

smbclient(1), nmblookup(1), rpcclient(1), testparm(8), samba(8), smbd(8), nmbd(8), wbinfo(1)

Copied to clipboard