CS Servers Quick Reference Guide
1 Managing Email Aliases
-
SSH into 'Ark':
ssh ndodds@arkNavigate to the configuration directory:cd /etc/postfix/Check out the file for editing:co -l aliases_clinicOpen the file in the vim editor:vim aliases_clinicCheck in the file after editing:ci -u aliases_clinicProcess changes and update alias database:newaliases
2 User Password Management
-
SSH into Cortana:
ssh cortanaChange a user's password (replace USERNAME with the actual username):passwd -i opendirectory -u ndodds USERNAME
3 Service Management
-
SSH into Hopper:
ssh root@hopperRestart the sssd service (OpenRC):/etc/init.d/sssd restartRestart the sssd service (systemd - for Lovelace or Granville):systemctl restart sssd
4 Account Lookup Tools
-
Display user ID and group information:
id ndoddsFetch the password entry for the user:getent passwd ndoddsDisplay detailed user information with finger:finger dodds
5 LDAP Account Management
-
Fetch basic LDAP entries for a user:
ldapsearch -LLLx uid=ndoddsFetch specific LDAP fields (common name and email):ldapsearch -LLLx uid=ndodds cn mail
6 Network and DNS Configuration
-
Find the current IP address on the local client:
ip addrSSH into the network server:ssh mudd@neutron.cs.hmc.eduLocate the DHCP binding for the IP (replace xxx with your IP suffix):show ip dhcp bind | incl 134.173.43.xxxClear existing DHCP binding if necessary:clear ip dhcp bind 134.173.43.xxxNote: This removes the binding from the active table, but the client may still attempt to renew with the old IP. The following method ensures a complete removal.
Alternative: Clear binding from configuration (more thorough):conf term ip dhcp pool guest43 no addr 134.173.43.xxxThis removes the static binding from the DHCP pool configuration itself, preventing the server from reassigning this binding.
Enter configuration mode:conf termDefine a DHCP pool:ip dhcp pool guest43Set static IP with client ID (replace with your specific values):addr 134.173.43.xxx client-id 01xx:xx:xx:xx:xx:xxImportant: The client-id must begin with01followed by the MAC address. The01prefix indicates the hardware type (Ethernet). DHCP uses this format to distinguish between different types of network interfaces. Without the correct prefix, the binding won't match the client's DHCP request.Save the configuration to disk:write mem
7 Editing DNS Zone Files
-
SSH into Ark:
ssh ndodds@ark.cs.hmc.eduNavigate to the DNS directory:cd /mnt/dnsFreeze the zone for editing:sudo rndc freeze cs.hmc.eduCheck out the zone file:sudo co -l cs.hmc.eduEdit the zone file (remember to increment the serial number):sudo vim cs.hmc.eduImportant: Don't forget to increment the serial number at the top of the file.Check in the changes:sudo ci -u cs.hmc.eduThaw the zone:sudo rndc thaw cs.hmc.edu
8 Disk Quota Management
-
Edit quota for a specific user:
sudo edquota usernameView the quota for a specific user:sudo checkquota -v usernameReset user quota to default:sudo edquota -p quotatemplate username
9 APT History Log Processing
-
Process both compressed and uncompressed APT history logs:
for log in /var/log/apt/history.log /var/log/apt/history.log.*; do if [[ "$log" == *.gz ]]; then zcat "$log" | perl -00 -lne 'next unless m/\nRequested-By: (\w+) \(\d+\) /; my $user = $1; printf "%s: %s\n", $user, $1 if m/Commandline:\s+(.*)/' | grep install else cat "$log" | perl -00 -lne 'next unless m/\nRequested-By: (\w+) \(\d+\) /; my $user = $1; printf "%s: %s\n", $user, $1 if m/Commandline:\s+(.*)/' | grep install fi done
10 NVIDIA Management
-
Unload the NVIDIA kernel module:
modprobe -r nvidiaRemoves the NVIDIA driver module from the kernel. Useful when troubleshooting driver issues or before updating drivers. All programs using the GPU must be stopped first.
Load NVIDIA device files:nvidia-modprobeCreates the NVIDIA device files in /dev if they don't exist. Required for GPU access after driver installation or system boot. Typically runs automatically but can be invoked manually.
Check which processes are using NVIDIA devices:sudo lsof /dev/nvidia*Lists all processes with open file handles to NVIDIA devices. Essential for diagnosing "device busy" errors or identifying which programs need to be closed before unloading the driver.
11 NVMe Drive Cloning & Upgrade (Ubuntu Method)
-
1. Prepare Hardware
Shut down the system. Move the original NVMe drive to an external USB adapter, then install the new (larger) NVMe drive into the motherboard's M.2 slot.
2. Boot into Live EnvironmentInsert your Ubuntu USB Installer. Boot the machine and select "Try Ubuntu without installing". Once the desktop loads, open a Terminal (Ctrl+Alt+T).
3. Identify Your DrivesRun the following to list all connected storage devices:
lsblk -o NAME,MODEL,SIZE,TYPE,FSTYPEIdentify your two drives based on size:
- Source (Old Drive): Usually
/dev/sdaor/dev/sdb(connected via USB). - Destination (New Drive): Usually
/dev/nvme0n1(internal M.2 slot).
4. Clone the DriveCritical Warning: Double-check yourif(Input File) andof(Output File). Writing to the wrong drive is irreversible.sudo dd if=/dev/sdX of=/dev/nvme0n1 bs=64K conv=noerror,sync status=progressReplace
/dev/sdXwith your USB adapter identifier (e.g., /dev/sda). Thebs=64Kflag speeds up the copy significantly.5. Fix GPT Table & Resize PartitionAfter cloning, the backup partition table is now "stuck" in the middle of the drive (where the old disk ended). We must move it to the end of the new disk.
Launch the partition editor:
sudo parted /dev/nvme0n1You will immediately see a warning about the GPT table. Type
Fixwhen prompted:Warning: Not all of the space available to /dev/nvme0n1 appears to be used... Fix/Ignore? FixNow, find the partition number you want to expand (usually partition 2 or the largest one):
(parted) printResize the partition to fill the disk:
(parted) resizepart 2 100% (parted) quit6. Check & Resize FilesystemNow that the partition is larger, we must expand the filesystem inside it to match.
First, run a safety check on the filesystem:
sudo e2fsck -f /dev/nvme0n1p2Then, resize it (defaults to max available size):
sudo resize2fs /dev/nvme0n1p27. FinalizeShut down the computer, remove the USB boot drive and the external USB adapter. Boot normally from the new internal NVMe.
- Source (Old Drive): Usually