A service (also called a daemon process) is software that runs on a computer, generally in the background. This is usually because it's something that the administrator isn't likely to interact with directly.
For instance, a network service runs at the application layer to provide some form of service over a network. It's expected that client computers will contact the service for access. A common example is the Apache web server. It runs on a system so that devices connected to the internet can view a specific set of files on a computer.
Red Hat Enterprise Linux (RHEL) provides an environment where these network services can run. RHEL also provides a utility named systemd to help you manage these services.
systemd has been the default service manager since RHEL 7. It's the first thing that gets started (PID 1), and it is responsible for starting the rest of the system. It activates server daemons, system resources, and various other processes. With systemd, you can start, stop, and check the status of the network services running on your server. You interact with systemd by using the systemctl command.
Start a service
To start a given service, use:
$ sudo systemctl start <service>For example, to start the sshd service, type:
$ sudo systemctl start sshd.serviceYou can ignore .service and run the systemctl start sshd command.
[ Free cheat sheet: Get a list of Linux utilities and commands for managing servers and networks. ]
List services
You can list all loaded services on a server with:
$ sudo systemctl list-units --type=serviceStop a service
To stop a service, type:
$ sudo systemctl stop sshdTo find out whether a service is running, inactive, enabled, disabled, or has exited, use:
$ sudo systemctl status sshdThe systemctl command also has is-active and is-enabled options to see whether a service is active or enabled. For example, to check if a service is active or enabled, run:
$ systemctl is-active sshdThis command gives two possible outputs. The service is either active, which means it is running, or it's inactive, which means it is stopped or not running.
Enable a service
You can configure a service to start automatically with the system so that you don't have to start it manually after the server reboots or restarts.
To enable a service, which means the service starts automatically when the server boots, use:
$ sudo systemctl enable sshdTo both start and enable a service, add the --now option, like this:
$ sudo systemctl enable --now sshdTo check whether a service is enabled, enter:
$ sudo systemctl is-enabled sshdWhen a service is enabled, it starts automatically at boot. When it's disabled, it doesn't start automatically at boot.
[ Free download: Advanced Linux commands cheat sheet. ]
Disable a service
To disable a service, so the service will not start automatically at boot time, run:
$ sudo systemctl disable sshdWrap up
Not everything uses systemctl by default. Some applications are intended to be started manually. Of course, you can always add your own systemd service files when you need a network service to start automatically.
Systemd is full of features, and the systemctl command gives you easy control over the services your computer runs.
Updated: 12/30/2021 by The net command is used to update or fix a network or view its settings. Net is an
external command that is available for the following Microsoft operating systems as net.exe. [/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length] \\computername {/ADD | /DEL} [SERVER | WORKSTATION] [service] [id [/CLOSE]] [groupname [/COMMENT:"text"]] [/DOMAIN] [groupname [/COMMENT:"text"]] [/DOMAIN] [name [/ADD | /DELETE]] [service] [\\computername] [/DELETE] sharename [service] [WORKSTATION | SERVER] service [\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET] [devicename | *] [\\computername\sharename[\volume] [password | *]] NET USE {devicename | *} [password | *] /HOME NET USE [/PERSISTENT:{YES | NO}] [username [password | *] [options]] [/DOMAIN] [\\computername [/CACHE] | /DOMAIN[:domainname]] NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ] [/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length] \\computername {/ADD | /DEL} [SERVER | WORKSTATION] [service] [id [/CLOSE]] [groupname [/COMMENT:"text"]] [/DOMAIN] [groupname [/COMMENT:"text"]] [/DOMAIN] [name [/ADD | /DELETE]] [service] \\computername\sharename You can send a message only to a name that is active on the network. If the message is sent to a username, that user must be logged on and running the Messenger service to receive the message. {name | * | /DOMAIN[:name] | /USERS} message [\\computername] [/DELETE] sharename [service] [WORKSTATION | SERVER] service [\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET] [devicename | *] [\\computername\sharename[\volume] [password | *]] NET USE {devicename | *} [password | *] /HOME NET USE [/PERSISTENT:{YES | NO}] [username [password | *] [options]] [/DOMAIN] [\\computername [/CACHE] | /DOMAIN[:domainname]] Windows 2000 syntax NET [ CONFIG | DIAG | HELP | INIT | LOGOFF | LOGON | PASSWORD | PRINT | SEND | SHARE | START | STOP | TIME | USE | VER | VIEW ] NET CONFIG [/YES] NET DIAGNOSTICS [/NAMES | /STATUS] command /? NET INITIALIZE [/DYNAMIC] NET LOGOFF [/YES] NET LOGON [user [password | ?]] [/DOMAIN:name] [/YES] [/SAVEPW:NO] NET PASSWORD [oldpassword [newpassword]] NET PRINT \\computer[\printer] | port [/YES] Sends messages to other users, computers, or messaging names on the network. The Messenger service must be running to receive messages. You can send a message only to a name that is active on the network. If the message is sent to a username, that user must be logged on and running the Messenger service to receive the message. NET START [BASIC | NWREDIR | WORKSTATION | NETBIND | NETBEUI | NWLINK] [/LIST] [/YES] [/VERBOSE] To start the workgroup redirector you selected during setup, type NET START without options. In general, you don't need to use any of the options. NET STOP [BASIC | NWREDIR | WORKSTATION | NETBEUI | NWLINK] [/YES] To stop the workgroup redirector, type NET STOP without options. This command breaks all your connections to shared resources and removes the NET commands from your computer's memory. NET TIME [\\computer | /WORKGROUP:wgname] [/SET] [/YES] NET USE [drive: | *] [\\computer\directory [password | ?]] NET USE drive: | \\computer\directory /DELETE [/YES] NET USE drive: | * /HOME NET VER NET VIEW [\\computer] [/YES] Map the Z: drive to the network path //computer/folder. Send a text message to the computer with a hostname of mrhope the message There is hope!. Note This command only works in Windows versions that support it. Tip Today's computers
disable the messenger service. If this service is disabled, you cannot send or receive net send messages. If you need to use this service, follow the instructions on this page and choose to enable the service instead of disabling it. Note New versions of Windows no longer support the net send command. Instead, use the msg command. The command above would send
"Hello everyone!" to all users in your current domain. Note Used this command with caution. On a school or corporate network, any computer with the Messenger service enabled could receive the message. Display additional information about the network such as the computer's name, workgroup, logon domain, DNS, and other useful information. To view the available computers and their shared resources, you may use either of the
commands below. The first example displays available computers. The last command would display the shared resources on the hope computer. Display all groups currently setup on the computer. Display all network shares on your computer. Create a share called "hope" for the "c:\hope\files" directory.Availability
Net syntax
Windows Vista and later syntax
net [ accounts | computer | config | continue | file | group | help | helpmsg |
localgroup | pause | session | share | start | statistics | stop | time |
use | user | view ]
NET ACCOUNTS
Adjust account settings.
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]NET COMPUTER
Add other networked computers with Windows Domain Controller. NET CONFIG
Displays your current server or workgroup settings. NET CONTINUE
Continues the use of service. NET FILE
Display opened shared files on the server. NET GROUP
Add, delete, view, and otherwise manage network workgroups.
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname username [...] {/ADD | /DELETE} [/DOMAIN]NET LOCALGROUP
Add, delete, view, and otherwise manage network groups.
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]NET NAME
Create or delete name used for messaging. NET PAUSE
Pause the specified network service. NET SESSION
Display all sessions connected to the computer and deletes them if specified. NET SHARE
Create and manage a local network share.
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETENET START
Start the specified network service. NET STATISTICS
Display network statistics of the workstation or server. NET STOP
Stop the specified network service. NET TIME
Display the time and date of another network computer.
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]NET USE
Connects or disconnects your computer from a shared resource or displays information about your connections.
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[[email protected] domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] |
[/PERSISTENT:{YES | NO}]]NET USER
Displays users on the computer or domain.
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]NET VIEW
Displays a list of computers in a specified workgroup or the shared resources available on a specified computer.
NET VIEW /NETWORK:NW [\\computername]Windows XP syntax
NET ACCOUNTS
Adjust account settings.
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]NET COMPUTER
Add other networked computers with Windows Domain Controller. NET CONFIG
Displays your current server or workgroup settings. NET CONTINUE
Continues the use of service. NET FILE
Display opened shared files on the server. NET GROUP
Add, delete, view, and otherwise manage network workgroups.
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname username [...] {/ADD | /DELETE} [/DOMAIN]NET LOCALGROUP
Add, delete, view, and otherwise manage network groups.
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]NET NAME
Create or delete name used for messaging. NET PAUSE
Pause the specified network service. NET PRINT
Manage network print jobs.
[\\computername] job# [/HOLD | /RELEASE | /DELETE]NET SEND
Sends messages to other users, computers, or messaging names on the network. The messenger service must be running to receive messages. NET SESSION
Display all sessions connected to the computer and deletes them if specified. NET SHARE
Create and manage a local network share.
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETENET START
Start the specified network service. NET STATISTICS
Display network statistics of the workstation or server. NET STOP
Stop the specified network service. NET TIME
Display the time and date of another network computer.
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]NET USE
Connects or disconnects your computer from a shared resource or displays information about your connections.
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[[email protected] domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] |
[/PERSISTENT:{YES | NO}]]NET USER
Displays the users on the computer or domain.
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]NET VIEW
Displays a list of computers in a specified workgroup or the shared resources available on a specified computer.
NET VIEW /NETWORK:NW [\\computername]NET CONFIG
Displays your current workgroup settings. /YES
Carries out the NET CONFIG command without first prompting you to provide information or confirm actions.
NET DIAG
Runs the Microsoft Network Diagnostics program to test the hardware connection between two computers and to display information about a single computer. /NAMES
Specifies a diagnostic server name to avoid conflicts when NET DIAG is used simultaneously by multiple users. This option works only when the network uses a NetBIOS protocol.
/STATUS
Enables you to specify a computer that you want network diagnostics information.
NET HELP
Displays information about NET commands and error messages.
NET HELP [suffix]
NET HELP errornumcommand /?
Specifies the Microsoft NET command that you want information about.
suffix
Specifies the second word of the command you want information about. For example, the suffix of NET VIEW is VIEW.
errornum
Specifies the number of the error message that you want information about.
NET INIT
Loads protocol and network adapter drivers without binding them to Protocol Manager. This command may be required if you are using a third-party network adapter driver. You can then bind the drivers to Protocol Manager by typing NET START NETBIND. /DYNAMIC
Loads the Protocol Manager dynamically that is useful with some third-party networks, such as Banyan VINES, to resolve memory problems.
NET LOGOFF
Breaks the connection between your computer and the shared resources to which it connects. /YES
Carries out the NET LOGOFF command without first prompting you to provide information or confirm actions.
NET LOGON
Identifies you as a member of a workgroup.
If you would rather be prompted to type your username and password instead of specifying them in the NET LOGON command line, type NET LOGON without options.
user
Specifies the name that identifies you in your workgroup. The name you specify can contain up to 20 characters.
password
The unique string of characters that authorizes you to gain access to your password-list file. The password can contain up to 14 characters.
?
Specifies that you want to be prompted for your password.
/DOMAIN
Specifies that you want to log on to a Microsoft Windows NT or LAN Manager domain. The name specifies the Windows NT or LAN Manager domain you want to log on to.
/YES
Carries out the NET LOGON command without first prompting you to provide information or confirm actions.
/SAVEPW:NO
Carries out the NET LOGON command without prompting you to create a password-list file.
NET PASSWORD
Changes your logon password.
NET PASSWORD \\computer | /DOMAIN:name [user [oldpassword [newpassword]]]
The first syntax line above is for changing the password for your password-list file. The second syntax line above is for changing your password on a Windows NT or LAN Manager server or domain.
oldpassword
Specifies your current password.
newpassword
Specifies a new password. It can have as many as 14 characters.
computer
Specifies the Windows NT or LAN Manager server on which you want to change your password.
/DOMAIN
Specifies that you want to change your
password on a Windows NT or LAN Manager domain.
Name specifies the Windows NT or LAN Manager domain on which you want to change your password.
user
Specifies your Windows NT or LAN Manager username.
NET PRINT
Displays information about print queues and controls print jobs.
NET PRINT \\computer | port [job# [/PAUSE | /RESUME | /DELETE]] [/YES]
When specifying the computer name using NET PRINT, you receive information about the print queues on each of the shared printers that are connected to the computer.
computer
Specifies the name of the computer whose print queue you want information about.
printer
Specifies the name of the printer you want information about.
port
Specifies the name of the parallel port (LPT) on your computer connected to the printer you want information about.
job#
Specifies the number assigned to a queued print job. You can specify the options below.
/PAUSE
Pauses a print job.
/RESUME
Restarts a print job that was paused.
/DELETE
Cancels a print job.
/YES
Carries out the NET PRINT command without first prompting you to provide information or confirm actions.
NET SEND
NET SEND {name | * | /DOMAIN[:name] | /USERS} message name
Is the username, computer name, or messaging name to send the message. If the name is a computer name containing blank characters, enclose the alias in quotation marks (" ").
*
Sends the message to all the names in your group.
/DOMAIN[:name]
Sends the message to all the names in the workstation domain. If name is specified, the message is sent to all the names in the specified domain or workgroup.
/USERS
Sends the message to all users connected to the server.
message
The text to be sent as a message.
NET SHARE
NET SHARE sharename
sharename=drive:path
[/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Automatic | No ]
sharename
[/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Automatic | No ]
{sharename | devicename | drive:path}
/DELETE
NET START
Starts services. NOTE: Services cannot be started from a command prompt within Windows. BASIC
Starts the basic redirector.
NWREDIR
Starts the Microsoft Novell compatible redirector.
WORKSTATION
Starts the default redirector.
NETBIND
Binds protocols and network adapter drivers.
NETBEUI
Starts the NetBIOS interface.
NWLINK
Starts the IPX/SPX-compatible interface.
/LIST
Displays a list of the services that are running.
/YES
Carries out the NET START command without first prompting you to provide information or confirm actions.
/VERBOSE
Displays information about device drivers and services as they are loaded.
NET STOP
Stops services. NOTE: Services cannot be stopped from a command prompt within Windows. NET STOP
Stops the basic redirector.
BASIC
Stops the basic redirector.
NWREDIR
Stops the Microsoft Novell compatible redirector.
WORKSTATION
Stops the default redirector.
NETBEUI
Stops the NetBIOS interface.
NWLINK
Stops the IPX/SPX compatible interface.
/YES
Carries out the NET STOP command without first prompting you to provide information or confirm actions.
NET TIME
Displays the time on or synchronizes your computer's clock with the shared clock on a Microsoft Windows for Workgroups, Windows NT, Windows 95, or NetWare time server. computer
Specifies the name of the computer (time server) whose time you want to check or use to synchronize your computer's clock.
/WORKGROUP
Specifies that you want to use the clock on a computer (time server) in another workgroup.
wgname
Specifies the name of the workgroup containing a computer whose clock you want to check or use to synchronize your computer's clock. If there are multiple time servers in that workgroup, NET TIME uses the first one it finds.
/SET
Synchronizes your computer's clock with the clock on the computer or workgroup you specify.
/YES
Carries out the NET TIME command without first prompting you to provide information or confirm actions.
NET USE
Connects or disconnects your computer from a shared resource or displays information about your connections.
[/SAVEPW:NO] [/YES] [/NO]
NET USE [port:] [\\computer\printer [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]
NET USE port: | \\computer\printer /DELETE [/YES]
NET USE * /DELETE [/YES]
To list all your connections, type NET USE without options.
drive
Specifies the drive letter you assign to a shared directory.
*
Specifies the next available drive letter. If used with /DELETE, specifies to disconnect all your connections.
port
Specifies the parallel (LPT) port name you assign to a shared printer.
computer
Specifies the name of the computer sharing the resource.
directory
Specifies the name of the shared directory.
printer
Specifies the name of the shared printer.
password
Specifies the password for the shared resource, if any.
?
Specifies that you want to be prompted for the password of the shared resource. You don't need to use this option unless the password is optional.
/SAVEPW:NO
Specifies that the password you type should not be saved in your password-list file. You need to re-type the password the next time you connect to this resource.
/YES
Carries out the NET USE command without first prompting you to provide information or confirm actions.
/DELETE
Breaks the specified connection to a shared
resource.
/NO
Carries out the NET USE command, responding with NO automatically when you are prompted to confirm actions.
/HOME
Makes a connection to your HOME directory if one is specified in your LAN Manager or Windows NT user account.
NET VER
Displays the type and version number of the workgroup redirector you are using. NET VIEW
Displays a list of computers in a specified workgroup or the shared resources available on a specified computer.
NET VIEW [/WORKGROUP:wgname] [/YES]
To display a list of computers in your workgroup that share resources, type NET VIEW without options.
computer
Specifies the name of the computer whose shared resources you want to see listed.
/WORKGROUP
Specifies that you want to view the names of the computers in another workgroup that share resources.
wgname
Specifies the name of the workgroup whose computer names you want to view.
/YES
Carries out the NET VIEW command without first prompting you to provide information or confirm actions.
Net examples
net use z: \\computer\folder