General Issues
Remote Access on Linux
ssh -i key.pem username@hostname
Ssh “ip” -l username -i /root/key.pem
To find the public address in ubuntu
curl http://icanhazip.com
To find the root password of Mysql
cat /etc/mysql/debian.cnf
Port change of server to SSH
M1
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 2222 -j REDIRECT --to-port 22
M2
Sudo -i
Vi /etc/ssh/sshd_config
Port 22 to port user wish
To copy the files using sync command with excluding directory
rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude
Eg:
rsync -av --progress /var/www/html/stats4/ /var/www/html/stats8/ --exclude /var/www/html/stats4/reports
Comments
Post a Comment