Linux device kit: set up in 10 minutes
Once your profile and API key are ready, your first laptop is on the network in about 10 minutes.
The Linux device kit gives Ubuntu laptops an EasyScep device certificate and sets up wired and/or Wi-Fi 802.1X for EasyRadius. Use it for Ubuntu laptops that aren't managed by Intune: you run one command per laptop, and the laptop is on the network for every user, before anyone logs in. The certificate renews by itself.
Everything is done from your own machine (the admin machine). In Step 3, pick Via SSH if you can reach the laptop over SSH, or Local Copy to carry a file to it via remote access / remote desktop IT software or using a USB stick (not recommended).
Prerequisites
Before you begin, make sure you have the following in place:
| Requirement | Details |
|---|---|
| Laptops | Ubuntu 22.04 or 24.04 with NetworkManager (the default on Ubuntu Desktop). The laptop must be online during setup, on another network or a cable. You need sudo on the laptop. |
| Admin machine | Linux, or WSL on Windows, with bash 4 or later, curl, jq and openssl. On Ubuntu: sudo apt install curl jq openssl. |
| EasyScep profile | A profile created from the Linux devices with enrollment tokens template (see Profiles). See Profile settings below. |
| EasyScep API key | An API key for that profile with the scopes profiles:read, enrollment-tokens:create, certificates:read and certificates:revoke. It stays on the admin machine. |
| RADIUS CA certificate | Nothing to do if EasyRadius gets its certificate from EasyScep (the default): init downloads it. Otherwise, a PEM file: see Get the RADIUS CA certificate. |
| RADIUS server name | The name on the RADIUS server certificate, shown on the EasyRadius Dashboard under Endpoints. |
| Network | Your switches and/or access points send 802.1X to EasyRadius, as in the EasyRadius vendor guides. For Wi-Fi, the network name (SSID). |
| SSH (Via SSH only) | The laptop runs an SSH server (sudo apt install openssh-server), and you can log in as a user with sudo. |
Profile settings
Create the profile in the EasyScep portal from the Linux devices with enrollment tokens template, and check these settings:
| Setting | Value |
|---|---|
| Enrollment | Enrollment tokens |
| Common name (CN) | {{token.cn}} |
| Extended key usage | Client authentication |
| Renewal | On, over SCEP, with a window of at least 30 days |
| Key type | RSA allowed (the kit uses RSA 3072) |
Important: The renewal window must be at least 30 days. Laptops renew about 28 days before the certificate expires; with a shorter window EasyScep refuses the renewal and the laptop drops off the network when the certificate expires.
Get the RADIUS CA certificate
Only needed if EasyRadius uses its own certificates instead of getting them from EasyScep. When it's linked to EasyScep (the default), skip this: init downloads the CA certificate for you.
- EasyRadius certificates: in the EasyRadius portal, go to Settings → Certificates and use the download icon on the CA that issued the server certificate. It saves the public certificate as PEM.
Save it as radius-ca.pem. The file must contain only the certificate, never a private key (the setup checks for this).
Download
Download the kit to your admin machine:
Download easyscep-linux-kit-0.1.1.tar.gz SHA-256 checksum
Or from a terminal:
curl -fLO https://docs.just-cloud.net/EasyScep/Linux/assets/easyscep-linux-kit-0.1.1.tar.gz
curl -fLO https://docs.just-cloud.net/EasyScep/Linux/assets/easyscep-linux-kit-0.1.1.tar.gz.sha256
sha256sum -c easyscep-linux-kit-0.1.1.tar.gz.sha256
The last command prints easyscep-linux-kit-0.1.1.tar.gz: OK.
Step 1: Unpack the kit
On the admin machine:
tar -xzf easyscep-linux-kit-0.1.1.tar.gz
cd easyscep-linux-kit-0.1.1
If you have a radius-ca.pem (EasyRadius not linked to EasyScep), copy it into this folder.
Step 2: Set up once
./easyscep init
Answer the questions:
| Question | Answer |
|---|---|
| EasyScep address | Your EasyScep instance address, e.g. your-instance.saas.just-cloud.dk |
| API key | Paste the API key (it isn't shown) |
| Profile | The slug of your Linux profile (default linux-devices) |
| Use wired 802.1X | y to set up the cable, n for Wi-Fi only |
| Wi-Fi network name | Your SSID (as it appears on Intune), or press Enter for none |
| EasyRadius gets its certificate from EasyScep | y (the default): init downloads the CA certificate from EasyScep. n: it asks for the file, radius-ca.pem |
| RADIUS server name | The name from the EasyRadius Dashboard |
init checks the answers against EasyScep and prints Saved. You don't run it again unless something changes.
Step 3: Set up a laptop
The laptop name is the certificate name (preferably use the laptop's hostname). Use lowercase letters, digits and - between spaces.
3.1 Run one command
On the admin machine:
./easyscep add laptop-001 --ssh user@laptop-address
Enter the password when asked.
Optional: log in without a password
Without this, you're asked for the laptop user's password up to three times. Run it once per laptop, on the admin machine, before the command above:
ssh-keygen -t ed25519 # only if you don't have an SSH key yet; press Enter at every question
ssh-copy-id user@laptop-address # asks the laptop user's password this one time
This copies your public SSH key to the laptop. After that, only sudo asks for the password.
3.2 Wait for setup complete
The command creates a one-time setup file, copies it to the laptop, runs it and deletes it. It prints setup complete with the laptop's name, certificate serial and expiry.
3.1 Create the setup file
On the admin machine:
./easyscep add laptop-001
This creates easyscep-laptop-001.sh.
3.2 Copy it to the laptop
Use a USB stick, a network share or any other way. The file works once and for 2 hours.
Important: The file contains a one-time token. Treat it like a password: don't email it or leave it on a share.
3.3 Run it on the laptop
sudo bash easyscep-laptop-001.sh
Wait for setup complete with the laptop's name, certificate serial and expiry. The file deletes itself.
Repeat Step 3 for each laptop. For many laptops at once, the kit includes an Ansible playbook: see docs/IT-GUIDE.md in the kit.
Step 4: Verify
On the laptop:
sudo easyscep status
Check that:
certmonger status:is MONITORING. The certificate is issued and will renew by itself.subject=showsCN=laptop-001, andnotAfter=the expiry date.connection easyscep-wired:(and/oreasyscep-wifi) is active (Once it has connected to your WiFi or cable network). The laptop is on the 802.1X network.
In the EasyRadius portal, Logs shows a successful login for the laptop's certificate.
Lost or retired laptop
On the admin machine:
./easyscep revoke laptop-001
This revokes all of the laptop's active certificates and prints Revoked <serial> (laptop-001) for each. EasyRadius then refuses the laptop.
To take the kit off a laptop you still have, run sudo easyscep remove on it. This removes the certificate, the key and the kit's network connections, but doesn't revoke the certificate, so also run revoke.
Security questions IT asks
Where is the private key created, and does it ever leave the laptop?
The laptop creates its own RSA 3072 key with certmonger, Ubuntu's certificate service. Only the certificate request, which holds the public key, is sent to EasyScep. The kit never copies the key anywhere.
The key is stored in /etc/easyscep/device.key, readable only by root. It's a file on disk, not in a TPM, so we recommend full-disk encryption on the laptops.
How does EasyScep know a laptop may get a certificate?
Each setup file carries a single-use enrollment token, minted with your API key for that one laptop name just before you need it:
- It works once and expires after 2 hours.
- It's only accepted over SCEP, for your Linux profile, and the certificate gets the name the token was minted for.
- Setup checks that the token looks right before sending it, so a damaged file doesn't use it up.
- After setup, nothing on the laptop holds or refers to the token: the setup file deletes itself, the tool it installs doesn't contain it, and certmonger keeps no reference to it.
Can someone with access to the laptop create new certificates?
No. The laptop has nothing that can create certificates:
- The API key never goes to a laptop, so no tokens can be minted there.
- The token is used up during setup, and the setup file deletes itself.
- The RADIUS CA certificate on the laptop is a public certificate without a private key, so it can't sign anything.
The only secret on the laptop is its own private key, and only root can read it.
What can someone with root access, or a stolen laptop, do?
With root access, or an unencrypted disk, someone can copy the laptop's private key and certificate and use them on another device to join the network as that laptop, until you revoke it. Through renewal they can keep that one certificate going, but only for the same laptop name and only until it's revoked. They can't get certificates for other names.
To limit this, use full-disk encryption, and run ./easyscep revoke <laptop> as soon as a laptop is lost.
What if someone copies the setup file before it's run?
If you know a file went missing before it was run, revoke its token in the EasyScep portal: ./easyscep add prints the token id. The file then can't be used at all.
Otherwise, within its 2 hours, they could enroll a device as that laptop name, once. The token is then used up, so your own setup fails with the server refused the request. If that happens unexpectedly, run ./easyscep revoke <laptop>, which revokes every certificate with that name, including theirs, then ./easyscep add <laptop> again.
After the file has been run, or after 2 hours, a copy is useless. Treat the file like a one-time password, and prefer Via SSH, where the file never sits anywhere but the laptop.
Can the token or API key show up in the process list, logs or shell history?
No. The kit never puts them on a command line:
- API key: sent to EasyScep in an HTTPS header read from a private temporary file.
- Token: inside the setup file, then handed to certmonger as a file in a private temporary folder. The commands you type (
sudo bash easyscep-laptop-001.sh,./easyscep add …) contain neither. - Output: the kit prints the token's id for troubleshooting, never the token.
Can other users on the laptop use or copy the certificate?
Every user on the laptop gets the network connection. That's the point of a device certificate, and it works before login. Users without sudo can't read the private key, so they can't copy the laptop's identity to another device.
How do renewal and revocation work?
certmonger renews the certificate about 28 days before it expires. The renewal uses a new key, is signed with the current certificate and needs no token, so it works whether or not your profile requires a new key on renewal. After a renewal, the laptop reconnects with the new certificate.
./easyscep revoke <laptop> revokes every active certificate with the laptop's name, including renewed ones. EasyRadius checks revocation with OCSP, see Certificate revocation checking.
What does the kit connect to?
- Admin machine: your EasyScep instance only, over HTTPS (the API, and the public CA certificate download).
- Laptop: your EasyScep instance over HTTPS to enroll and renew, and Ubuntu's package mirrors if certmonger needs installing. The 802.1X login itself goes through your network to EasyRadius.
🛠️ Troubleshooting
Common problems
-
easyscep-it: missing: ...: Install the tools it names on the admin machine, e.g.sudo apt install curl jq openssl. -
easyscep-it: API error (HTTP 401)or(HTTP 403): The API key is wrong, lacks one of the four scopes, or isn't allowed on the profile. Fix the key on the EasyScep Credentials page and run./easyscep initagain. -
not set up yet: run ./easyscep init first: Run Step 2 on this admin machine. -
invalid laptop name: Use only lowercase letters, digits and-, at most 63 characters. -
the server refused the request: The setup file is older than 2 hours or was already used, or the profile doesn't allow the request. Setup prints a token id: find it in the EasyScep Activity log, which shows why the request failed. Then run./easyscep add laptop-001again for a new file. -
did not fetch the CA certificates ... within 60sorcould not fetch the CA certificates: The laptop can't reach EasyScep. Check that it's online and can open the SCEP address (curl -Ifollowed by the address in the message). Then run./easyscep add laptop-001again for a new file. -
could not install certmonger: The laptop needs internet access and Ubuntu's universe repository: runsudo add-apt-repository universeon the laptop, then./easyscep add laptop-001again for a new file. -
connection easyscep-wired: inactive(oreasyscep-wifi): The certificate is fine, but the 802.1X login fails. Check that the RADIUS server name and CA you gaveinitmatch the EasyRadius server certificate, that EasyRadius trusts your EasyScep root CA (see Certificates), and the EasyRadius Logs. Ifinithad the wrong values, run./easyscep initagain, then./easyscep addfor the laptop.