Created
October 28, 2025 16:14
-
-
Save DiegoAscanio/6e5bced5cbd4475497df272150450eba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 1. crio o usuário cefetmg | |
| useradd -m cefetmg -s /bin/bash | |
| # 2. defino a senha do usuário cefetmg | |
| echo "cefetmg:cefetmg" | chpasswd | |
| # 3. gero chaves pro sshd | |
| ssh-keygen -A | |
| # 4. inicio o serviço sshd pela linha de comando | |
| /usr/sbin/sshd -f /etc/ssh/sshd_config -D & | |
| # 5. pego o IP da máquina | |
| IP=$(ip a sh dev eth0 | grep "inet " | awk '{print $2}' | cut -d/ -f1) | |
| echo "O IP da máquina é: $IP" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment