For some of us, administering systems that are fully remote and in a different facility is a daily way of life. For others, recent work-from-home restrictions might be one of the first times that you have administered a system that you have no physical access to if something goes wrong. Fear not! In this article, I'll take you through some simple suggestions to set you up for success when administering your systems from your home or from wherever you might be.
Tip 1: Lockdown remote access protocols
The first step to managing a remote system is... well, being able to manage it! Remote access protocols, such as SSH (and in rare cases, remote desktop), enable you to configure and manage your systems from anywhere. But you don't want your remote management strategy to turn into a security risk inadvertently. You should always take the time to understand the remote management protocol or system that you are using and secure it accordingly.
At a minimum, you should follow two standard best-practices for SSH security.
- Disable password authentication and use SSH keys
- Disable root login over SSH
SSH is highly configurable, and you can implement plenty of security enhancements, such as disabling weaker ciphers or limiting the use of particular SSH keys to specific IP addresses. Be sure to check out the sshd_config man page for more information. If you're feeling overwhelmed and don't know where to start, Enable Sysadmin has you covered with an article about locking down SSH.
Tip 2: Limit ingress points for remote management traffic
If you're suddenly in the position of managing remote systems and need to get access as soon as possible, it might be tempting to start loosening security safeguards to get you up and running. Punching holes in your firewall to permit SSH connections and loosening security ACLs permits remote management protocols through your edge network.
The problem with such "temporary" workarounds is that they inevitably become permanent. Set yourself up for success by only allowing remote access protocols, such as SSH or remote desktop, through a secure VPN with appropriate authentication and authorization controls. While setting up a VPN environment might seem like a bit of initial up-front work, the security benefits and reduction of administrative burden pays dividends. You won't have to worry about home or remote IP addresses changing since everyone goes through the VPN endpoint. And your systems are more secure because they can only be reached through an official VPN setup.
Tip 3: Know your network fundamentals
When administering a remote system, you don't have the luxury of walking over to a rack and tracing a network cable to figure out what the server is plugged in to. Additionally, making a network configuration mistake can be a costly accident: you might suddenly lose remote access entirely. Knowing your network fundamentals is absolutely essential for successfully managing remote systems. Using command-line tools, such as ip
, lldpctl
, and tcpdump
, can help you build a mental picture of your network topology. This mental image enables you to make safe, sensible network changes even if you're hundreds of miles away from your beloved servers.
Knowing network fundamentals can also save you if you lose access to a remote system. For example: knowing that hosts on the same Layer 2 broadcast domain can reach each other can allow you to fix a routing change gone awry: simply use one server as a jump box to the other server, and you're in!
Tip 4: Have access to a remote console
There's nothing quite like rolling the classic keyboard, video, mouse (KVM) "crash cart" over to a completely unresponsive server and working to diagnose it while basking in the warmth of the data center hot aisle. But what will you do if one of your servers suddenly dies and you can't drive into the office to get it back online? You want to be confident in the remote access technology available to you for your servers when you need to administer them remotely.
For physical servers, this is the remote management facility provided by the hardware vendor (such as IPMI). For virtual machines, a console is provided by the hypervisor, such as a virsh
console in KVM. Either way, you want to be comfortable with the tools available to you if something goes wrong.
It's also a best practice to confirm remote access to a server before you make any potentially dangerous network changes, such as changing the IP address. If something goes wrong and you lose your ability to SSH to the machine, you want to be able to log in and revert your changes. Confirming access includes verifying that the root password you have on file works. The worst feeling is staring at a login prompt that keeps failing authentication because your root password doesn't work.
Tip 5: Use SSH agent forwarding to your advantage
If you've read our previous articles about using SSH keys, then you're familiar with the idea of using ssh-agent
and ssh-add
to cache your key locally. Key-based authentication avoids the need to continually enter the passphrase for your private key when connecting to remote systems. But there's another useful feature in the SSH protocol that you can use to your advantage when administering remote systems: ssh-agent forwarding.
Using ssh
with the -A
flag forwards your ssh-agent
session to the remote host. This allows your private key to be "available" on that remote host. You can then "jump" from the first system to the second system, using the same SSH key authentication that you would use from your PC.
When is this useful? Consider the following common remote administration scenario: You have a very large file on host1
, and you want to transfer it to host2
. Both systems trust your SSH key. You could rsync
the file to your local machine from host1
, and then rsync
it up to host2
, but that would be inefficient. It would be much better if you could just copy it directly from host1
to host2
. Agent forwarding can help with this:
# Add my SSH key to the agent
anthony@laptop$ ssh-add
Enter passphrase for /home/anthony/.ssh/id_rsa:
Identity added: /home/anthony/.ssh/id_rsa (/home/anthony/.ssh/id_rsa)
# Connect to host1 with a forwarded SSH agent
anthony@laptop$ ssh -A ansible@host1
# Rsync a file to host2. This uses the forwarded agent
ansible@host1:~$ rsync some-file.txt ansible@host2:~/
# SSH to host2 from host1. This also uses the forwarded agent
ansible@host1:~$ ssh ansible@host2
# Looks like the file made it over OK!
ansible@host2:~$ ls
some-file.txt
Wrapping up
This article covered some basic best practices for administering remote systems. For some sysadmins, this is nothing new: managing remote server farms is a daily activity. For others, the current world climate might be forcing you to be farther from your servers than you'd really like. Either way, this article reviewed some useful tips and tricks for keeping the servers humming, even when you're not in the office.
[ Free online course: Red Hat Enterprise Linux technical overview. ]
저자 소개
Anthony Critelli is a Linux systems engineer with interests in automation, containerization, tracing, and performance. He started his professional career as a network engineer and eventually made the switch to the Linux systems side of IT. He holds a B.S. and an M.S. from the Rochester Institute of Technology.
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.