Active Directory FSMO Roles

Knowing which Active Directory server(s) holds the following five roles is important for a number of reasons, the most important of which is that decommissioning a server that holds one or more of these roles may cause serious operational issues within a functioning domain.

The five FSMO (Flexible Single Master Operation) roles are:

Schema Master
Domain Naming Master
Infrastructure Master
Relative ID (RID) Master
PDC Emulator

Find the server(s) that holds the roles from the command line:

netdom query fsmo

Or using PowerShell:

Get-ADForest | Select-Object DomainNamingMaster, SchemaMaster

– and –

 Get-ADDomain | Select-Object RIDMaster, PDCEmulator, InfrastructureMaster 

A follow-up article on transferring the roles can be found here:

Locating a Preconfigured “ls” Alias in CentOS Using grep

Linux distributions sometimes configure “ll” (lowercase L’s) as an alias to “ls -l”. Debian based OS’s typically do this from the users ~/.bashrc file. This is not the case with Red Hat/CentOS based OS’s. I couldn’t remember where CentOS set the alias and I needed to locate it. As a non-root user, this proved to be a little more challenging than I first expected. Yes, I could look it up on the web but I decided to make an exercise out of it and it was more challenging than it would first seem.

grep -riE "alias ?ll" /etc/ 2> /dev/null

I’m sure there are other ways to it but this worked. In short. I knew I needed to search for “ll” in /etc, but “ll” is also common in many words. Also, I’m running as a normal user so I wanted to avoid “Permission Denied” and other errors that cluttered the search.

Note the the following also returns the same:

 grep -riE "alias ?ll" /etc/ 2>&1 | grep -v "Permission" 

Basic FreeBSD Desktop Setup

I haven’t setup a FreeBSD server in a while so I decided to have a look at FreeBSD 12.1, which I installed as a guest using VirtualBox. I also decided that I wanted a fairly basic desktop on this install. Below are my notes on what I did to setup the desktop after I had already installed the base FreeBSD system.

First – here is a quick list of commands for working with user setup and package management :

  • adduser - Add new user
  • rmuser - Remove a user
  • chpass - Allows for user modification, including shell
  • chsh - Change shell using editor, chsh -s does not use the editor
  • pw - Modify user and groups
    • Type “pw” to get basic help
    • Another example: "pw usermod help"
Working with packages:
  • pkg help
  • pkg info <name>
  • pkg search <name>
  • pkg search -o <name>   - use this one, provides path
  • pkg install <name>
  • pkg delete <name>
  • pkg upgrade
  • pkg autoremove   - remove stale dependencies
  • pkg clean - clean package cache
  • pkg clean -a   - clean all cached packages
  • pkg audit -F   - Check for vulns

Install bash and VIM:

pkg install bash bash-completion vim Edit vimrc: vim /usr/local/etc/vim/vimrc add: "set background=dark" - Easier to see text "set number" - Always display line numbers

Set up UTF-8:

vim /etc/login.conf (edit default class as below)
     :umask=022:\     (add “\” only)
     :charset=UTF-8:\
     :lang=en_US.UTF-8:

execute "cap_mkdb /etc/login.conf"

Edit /etc/profile:
   vim /etc/profile
        LANG=en_US.UTF-8; export LANG
        CHARSET=UTF-8; export CHARSET
        GDM_LANG=en_US.UTF-8; export GDM_LANG

Logout and login again
execute “locale"

Install Xorg, fonts, and XFCE:

pkg install xorg xfce
pkg install virtualbox-ose-additions
pkg install terminus-font liberation-fonts-ttf

execute "fc-cache -vf"

Add the following to /etc/rc.conf:

vim /etc/rc.conf
   dbus_enable="YES"
   vboxguest_enable="YES"
   vboxservice_enable="YES"

If /etc/X11/xorg.conf does not exist:

cd /root/
X -configure

Add these lines to the following:
vim xorg.conf.new

   Section "Files"
        FontPath     "/usr/local/share/fonts/terminus-font/"
        FontPath     "/usr/local/share/fonts/Liberation/"
        FontPath     "/usr/local/share/fonts/dejavu/"

   Section "Module"
        Load  "dri"
        Load  "freetype"
        Load  "bitmap"
        Load  "type1"

   Section "InputDevice"
        Driver      "vboxmouse"

   Section "Device"
        Option     "DRI" "true"
        Driver      "vboxvideo"

cp xorg.conf.new /etc/X11/xorg.conf

Add to ~/.xinitrc (for each user):

exec /usr/local/bin/startxfce4

Add user account:

adduser
passwd username
pw usermod username -G wheel,operator

As user:
vim .xinitrc
    exec /usr/local/bin/startxfce4

Login as user and start xorg:

startx