Skip to content

Instantly share code, notes, and snippets.

View kingoamino's full-sized avatar

Aboumerrouane Mohamed Amine kingoamino

View GitHub Profile
@kingoamino
kingoamino / SendMail
Created August 12, 2020 12:46
Send mail centos whith mailx
Installing mailx
yum -y update
yum install -y mailx
We can now start sending e-mails using
create a symbolic link
ln -s /bin/mailx /bin/email
###Set an External SMTP Server to Relay E-Mails
@kingoamino
kingoamino / connexion ssh with key
Created August 11, 2020 15:08
ssh_key Connexion without password
From client machine :
ssh-keygen -t rsa
Create .ssh in remote server fron client :
ssh user@192.168.0.11 mkdir -p .ssh
Upload key :
cat .ssh/id_rsa.pub | ssh user@192.168.0.11 'cat >> .ssh/authorized_keys'
Set Permission :
ssh user@192.168.0.11 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
Connexion without password :
ssh user@192.168.0.11
@kingoamino
kingoamino / SFTP Commande
Created April 20, 2020 17:22
SFTP Commande
sftp> help
Available commands:
bye Quit sftp
cd path Change remote directory to 'path'
chgrp grp path Change group of file 'path' to 'grp'
chmod mode path Change permissions of file 'path' to 'mode'
chown own path Change owner of file 'path' to 'own'
df [-hi] [path] Display statistics for current directory or
filesystem containing 'path'
exit Quit sftp
@kingoamino
kingoamino / Users EC2 AWS
Last active April 20, 2020 14:59
Default ssh Usernames For Connecting To EC2 Instances
----------------------------------------------------------------------------------------
OS/Distro | Official AMI | Legacy / Community / Other AMI ssh Username |
----------------------------------------------------------------------------------------
Amazon Linux | ec2-user | |
Ubuntu | ubuntu | root |
Debian | admin | root |
RHEL 6.4 and later | ec2-user | |
RHEL 6.3 and earlier | root | |
Fedora | fedora | ec2-user, root |
Centos | centos | root |
@kingoamino
kingoamino / Conf_SFTP
Last active July 1, 2020 13:23
Installation et configuration SFTP
** 1. SFTP Installation **
---- $ rpm -qa|grep ssh
** 2. SFTP Configuration **
Create sftp folder
---- $ mkdir -p /var/sftp
---- $ chmod 755 /var/sftp
@kingoamino
kingoamino / Zip WordPress
Created April 5, 2020 19:05
Compression du projet
zip -r /var/www/BackUP/wordpress-$(date +"%m-%d-%y").zip /var/www/html/WordPress
@kingoamino
kingoamino / DumpMySQL.sh
Last active April 5, 2020 18:46
Back UP database
# Create a dump to Dump_date.sql
mysqldump --databases -h 'host_DB' 'DataBase name' -u 'User' -p 'Passwd' > /var/www/BackUP/Dump_$(date +"%m-%d-%y").sql
@kingoamino
kingoamino / WordPress.sh
Created April 5, 2020 17:07
install Wordpress
# install git
yum -y install git
# clone WordPress from repo
git clone https://github.com/WordPress/WordPress.git
@kingoamino
kingoamino / info.php
Last active April 20, 2020 12:06
Check PHP APACH
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
@kingoamino
kingoamino / Install_PHP7.sh
Last active April 5, 2020 17:20
Install PHP 7.3 on CentOS
#Update CentOS
Yum -y update
# Install Wget
yum -y install wget
# Enable the PHP 7.3 Remi repository
wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm