Tag: System Administration

  • Zsh vs. Bash on macOS: Should You Care?

    Starting with macOS Catalina, Apple ditched Bash as the default shell and gave Zsh the crown. Cue the collective sighs and confusion. But here’s the deal—if you’re doing any real terminal work on macOS, it’s worth knowing why that switch happened and whether you should care.

    Why the Switch?

    Apple made Zsh the default for licensing reasons. The version of Bash that shipped with macOS was ancient (v3.2 from 2007) because newer versions use GPLv3, which Apple didn’t want to mess with. Zsh doesn’t have that problem, so… boom, default.

    But it’s not just a legal shuffle—Zsh brings some goodies to the table.

    Zsh Perks

    • Auto-suggestions: Like fish shell vibes—Zsh can guess what you’re typing and finish your thought. Bash can’t do that natively.
    • Globbing on steroids: More powerful wildcard matching. Want to match all files with two digits and a .logextension? Zsh makes that easy.
    • Plugins & ThemesOh My Zsh turns Zsh into a productivity beast. You get Git status right in the prompt, syntax highlighting, fancy themes… Bash just feels barebones after.
    • Customization: Bash can be customized too, sure—but Zsh makes it easier and sexier.

    Downsides?

    Not much, unless you’ve got a pile of Bash scripts with weird quirks. Zsh is mostly compatible, but not 100%. You might have to tweak some syntax here and there.

    Also, Zsh’s .zshrc isn’t the same as .bash_profile or .bashrc, so your muscle memory might need a refresh.

    So, Which Should You Use?

    If you’re already neck-deep in Bash and it’s working? Stick with it.

    If you’re starting fresh or want something more modern and extensible? Zsh is the move. Especially if you’re living in Terminal daily. Install Oh My Zsh, pick a theme, grab some plugins, and feel like a hacker god.

  • Enabling Remote Desktop Access on Windows with PowerShell

    When managing a remote network or administering systems across multiple locations, enabling Remote Desktop Protocol (RDP) becomes an essential task. Here’s a quick and efficient way to set up RDP on a Windows machine using PowerShell commands. This method ensures secure connections, including Network Level Authentication (NLA) and the appropriate firewall settings.

    1. Enable Remote Desktop Connections

    First, you’ll need to enable RDP connections on the system. By default, Windows disables Remote Desktop connections for security reasons. You can change this setting using PowerShell.

    Set-ItemProperty'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\'-Name"fDenyTSConnections"-Value0

    This command modifies the registry key that controls RDP access. Setting fDenyTSConnections to 0 ensures that RDP is enabled on the machine.

    2. Enable Network Level Authentication (NLA)

    Network Level Authentication (NLA) adds an additional layer of security by requiring users to authenticate before establishing a full RDP session. This is a recommended best practice to prevent unauthorized access and reduce the risk of exploitation.

    Set-ItemProperty'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\'-Name"UserAuthentication"-Value1

    By setting UserAuthentication to 1, you ensure that NLA is required for all RDP connections, thus enhancing the security of remote desktop access.

    3. Enable Windows Firewall Rules for RDP

    Now, we need to ensure that the Windows firewall allows incoming RDP connections. Windows Firewall typically blocks most incoming traffic unless explicitly allowed. Luckily, you can enable the necessary firewall rules for RDP with this command:

    Enable-NetFirewallRule-DisplayGroup"Remote Desktop"

    This command enables the built-in firewall rules under the “Remote Desktop” group, allowing RDP traffic to pass through the firewall.

    Final Thoughts

    By running these three PowerShell commands, you can quickly and securely enable Remote Desktop access to a Windows machine. The combination of enabling RDP, enforcing NLA, and allowing RDP through the firewall creates a balanced approach to remote access that is both efficient and secure.