22Sep/20

Change ownership of files/direcotry

Change ownership of single file :

sudo chown username:groupname path/to/file/filename

Example : sudo chown developer:www-data /var/www/html/info.php

Change ownership of multiple files of specific extension :

sudo chown -R username:groupname path/to/files/*.ext

Example : sudo chown -R developer:www-data /var/www/html/*.php

Change ownership of a directory:

sudo chown -R username:groupname /path/of/directory

Example : sudo chown -R developer:www-data /var/www/html/laravel

16Sep/20

Connect to ssh server using terminal

  1. Connect with username and password :
ssh username@[IP-ADDRESS]

Example : ssh rudra@192.168.12.12

When it is connected it will ask for password. Enter your ssh user password.

2. Connect using ssh-key

Make your file permission 600

sudo chmod 600 /path/to/ssh-key-file

ssh -i [/path/to/ssh-key-file] username@[IP-ADDRESS]

Example : ssh -i /home/rudra/rudraitnetworks.pem rudra@192.168.12.12

You can use domain name instead of [IP-ADDRESS]