Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Script:
#!/bin/bash
# Update package list and upgrade packages
sudo apt update && sudo apt upgrade -y
# Install SSH server
sudo apt install -y openssh-server
# Enable and start SSH service
sudo systemctl enable ssh
sudo systemctl start ssh
# Install xrdp for RDP access
sudo apt install -y xrdp
# Enable and start xrdp service
sudo systemctl enable xrdp
sudo systemctl start xrdp
# Allow SSH and RDP through the firewall
sudo ufw allow ssh
sudo ufw allow 3389/tcp
# Enable the firewall
sudo ufw enable
echo "SSH and RDP services are now enabled and running."
How to Execute the Script:
nano enable_ssh_rdp.sh
CTRL+O
to save and CTRL+X
to exit).chmod +x enable_ssh_rdp.sh
sudo ./enable_ssh_rdp.sh