Skip to content

Instantly share code, notes, and snippets.

@Alexisgt01
Last active July 30, 2020 14:51
Show Gist options
  • Save Alexisgt01/b2f1bb5a02b5813d424ae7723dc78c91 to your computer and use it in GitHub Desktop.
Save Alexisgt01/b2f1bb5a02b5813d424ae7723dc78c91 to your computer and use it in GitHub Desktop.
Base de connaissance
# sources
https://medium.com/@blanselle/utiliser-expect-dans-un-script-bash-869ef35a512e
# Source
http://www.delafond.org/traducmanfr/man/man5/sshd_config.5.html
# Créer un utilisateur
CREATE USER 'myuser' IDENTIFIED BY 'mypassword';
# Accorder l'accès local à l'utilisateur
GRANT USAGE ON *.* TO 'myuser'@localhost IDENTIFIED BY 'mypassword';
# Accorder l'accès depuis un autre serveur
GRANT USAGE ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword';
# Accorder tout les droits sur une base de données
GRANT ALL privileges ON `mydb`.* TO 'myuser'@localhost;
# Appliquer les modifications
FLUSH PRIVILEGES;
# source
https://www.daniloaz.com/en/how-to-create-a-user-in-mysql-mariadb-and-grant-permissions-on-a-specific-database/
# sources
https://blog.ssdnodes.com/blog/how-to-install-wordpress-on-debian-9-with-lamp-tutorial/
# Tentative échoué
cat /var/log/auth.log | grep 'sshd.*Invalid'
# Tentative réussis
cat /var/log/auth.log | grep 'sshd.*opened'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment