Set up an Ubuntu Server as a standalone Windows network server. In this scenario, we'll assume that you want to replace an existing Windows domain server with the Ubuntu server. Here are the steps:
-
Install Ubuntu Server:
- Start by downloading the Ubuntu Server ISO image from the official Ubuntu website.
- Create a bootable USB drive or mount the ISO on your server.
- Follow the installation prompts to install Ubuntu Server. During installation, choose the appropriate options for language, keyboard layout, and network configuration.
-
Configure Network Settings:
- After installation, ensure that your Ubuntu server has a static IP address within your existing network range. You can set this up during installation or later using the
/etc/netplan
configuration files. - Make sure the hostname of your Ubuntu server is unique and doesn't conflict with other machines on the network.
- After installation, ensure that your Ubuntu server has a static IP address within your existing network range. You can set this up during installation or later using the
-
Install Samba:
- Samba is a software suite that allows Linux servers to share files and printers with Windows clients. Install Samba on your Ubuntu server:
sudo apt update sudo apt install samba
- During installation, you'll be prompted to set up a workgroup name. Choose a workgroup name that matches your existing Windows network (usually "WORKGROUP").
- Samba is a software suite that allows Linux servers to share files and printers with Windows clients. Install Samba on your Ubuntu server:
-
Configure Samba Shares:
- Edit the Samba configuration file (
/etc/samba/smb.conf
) using a text editor (e.g.,nano
orvim
):sudo nano /etc/samba/smb.conf
- Define your shared folders by adding sections like this:
[SharedFolder] path = /path/to/shared/folder read only = no guest ok = yes
- Replace
/path/to/shared/folder
with the actual path to the folder you want to share. - Save the file and exit.
- Edit the Samba configuration file (
-
Create Samba Users:
- Create Samba users who will have access to the shared folders:
sudo smbpasswd -a username
- Replace
username
with the desired username.
- Create Samba users who will have access to the shared folders:
-
Restart Samba:
- Restart the Samba service to apply the changes:
sudo systemctl restart smbd
- Restart the Samba service to apply the changes:
-
Test Access from Windows:
- On a Windows machine, open File Explorer and enter the Ubuntu server's IP address or hostname in the address bar (e.g.,
\\192.168.1.10
or\\ubuntuserver
). - You should see the shared folders. Access them using the Samba username and password you created earlier.
- On a Windows machine, open File Explorer and enter the Ubuntu server's IP address or hostname in the address bar (e.g.,
-
Decommission the Existing Domain Server:
- Once you've verified that the Ubuntu server is working as expected, you can decommission the existing Windows domain server.
- Update DNS settings on client machines to point to the new Ubuntu server for domain resolution.
How to set up your Ubuntu Server to take over Active Directory (AD) and name services. We'll cover two approaches: using Samba as an AD domain controller and integrating with AD using SSSD.
-
Install Samba:
- Install Samba on your Ubuntu server:
sudo apt update sudo apt install samba
- Install Samba on your Ubuntu server:
-
Configure Samba:
- Edit the Samba configuration file (
/etc/samba/smb.conf
) to define shared folders and other settings. - Create Samba users who will have access to shared resources.
- Edit the Samba configuration file (
-
Promote Samba to an AD Domain Controller:
- Run the following command to configure Samba as an AD controller:
sudo samba-tool domain provision --use-rfc2307 --interactive
- Accept the default REALM and Domain settings.
- Run the following command to configure Samba as an AD controller:
-
Test Access from Windows:
- On a Windows machine, access shared folders using the Samba username and password.
-
Install SSSD:
- Install the System Security Services Daemon (SSSD) on your Ubuntu server:
sudo apt install sssd
- Install the System Security Services Daemon (SSSD) on your Ubuntu server:
-
Configure SSSD:
- Edit the SSSD configuration file (
/etc/sssd/sssd.conf
) to specify AD settings. - Set up Kerberos authentication and LDAP for user and group information.
- Edit the SSSD configuration file (
-
Join the AD Domain:
- Use the
realm
command to join the AD domain:sudo realm join AD_DOMAIN
- Replace
AD_DOMAIN
with your actual AD domain name.
- Use the
-
Test Authentication:
- Verify that users can authenticate against AD using SSSD:
sudo su - AD_USER
- Replace
AD_USER
with an actual AD username.
- Verify that users can authenticate against AD using SSSD:
Remember to adjust firewall rules, DNS settings, and permissions as needed. Choose the approach that best fits your requirements and environment. 🍌
For more detailed instructions, refer to the official documentation: