# Grant access

> Give people and teams a Linux account on a server, for good or for a while, and take it away again.

This guide shows how to let someone log in to a server. Access is always a **grant**: one Linux account on one server, given to a user, a team or a service account.

## Grant access to a server

1. Open the server in the web app. It lists its Linux accounts. Servers report the accounts they have, and you can add more by hand.
2. Pick an account, like `ubuntu`, and add users, teams or service accounts to it.

That's it. The change applies right away, on every kind of server.

Some tips:

- **Prefer teams over single users.** Access then follows the team, and onboarding is one step.
- **Give `root` sparingly.** Grant a normal account and let people use `sudo` where your server policy allows it.
- **Shared accounts are fine.** Five people on `ubuntu` still show up as five different people in the audit log.

An account marked **Not on the host** is one the server has not reported, because you added it by hand or an enroll token carried it. Grants on it open nothing until the account exists on the server.

Servers can also start with grants already in place, from an [enroll token](/docs/servers/add-server#enroll) or from [`nk sync --grant`](/docs/servers/without-daemon#give-people-access).

## Access that ends by itself

Some access is only for a while, like a contractor's week or a fix on a database tonight. A grant can have an end. When the time is up, the access is gone without anyone doing a thing, and the audit log records it.

No certificate works past the end. Servers with `nokkud` also close the sessions that use the grant. On a server without the daemon, a session that is already open stays until it closes.

To let people ask for such access themselves, see [Access requests](/docs/access/requests).

## Remove access

- **One grant:** remove the user or team from the account.
- **Every direct grant at once:** use **Revoke all access** on the user. Access through teams stays, so also take them out of their teams.
- **Deactivate the user:** they are signed out everywhere, can't sign in, and lose every server at once, including what their teams give them. Their grants stay for when they return. SCIM does this for you. This is the step for someone who leaves.
- **Delete the user:** also removes every grant they had.

Servers with `nokkud` stop accepting the person at once and close their open sessions. A server without the daemon stops new logins a little later, when the person's last certificate runs out. [Revoking access](/docs/learn/certificates#revoking-access) explains why.
