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
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 |
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
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 |
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
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 |
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
---------------------------------------------------------------------------------------- | |
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 | |
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
** 1. SFTP Installation ** | |
---- $ rpm -qa|grep ssh | |
** 2. SFTP Configuration ** | |
Create sftp folder | |
---- $ mkdir -p /var/sftp | |
---- $ chmod 755 /var/sftp |
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
zip -r /var/www/BackUP/wordpress-$(date +"%m-%d-%y").zip /var/www/html/WordPress |
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
# 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 |
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
# install git | |
yum -y install git | |
# clone WordPress from repo | |
git clone https://github.com/WordPress/WordPress.git |
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
echo "<?php phpinfo(); ?>" > /var/www/html/info.php |
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
#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 |
NewerOlder