Skip to content

Kedaranatha/linux-vps-admin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 

Repository files navigation

Useful tools:

SSH Client: link
Filezilla: link

Basic Linux Commands:

man

man # get commands manual.  

pwd

pwd # path of the current directory.  

cd:

cd /      # go to root.  
cd /usr/  # got to user folder.  
cd -      # goto previous folder.  
cd ..     # goto parent folder.    

ls:

ls -a # display all.

Managing files: create, copy, move, delete:

nano file.txt          # create file.txt.
cp file.txt file2.txt  # copy file.txt to file2.txt.
mv file2.txt /file.txt # move file2.txt to root folder file.txt.
rm file.txt            # remove file.txt from current folder.

Managing folders: create, copy, move, delete:

mkdir test         # make folder test.
cp -r test/ test2/ # copy folder test and its files.
mv test/ test2/
rm -r test         # remove folder.
rmdir test         # remove empty folder.
rm -ri test        # add confirmation to remove folder.

Managing package:

apt-get install package-name # install package-name
apt-get remove package-name  # uninstall package-name but keep configuration files.
apt-get purge package-name   # uninstall package-name and all it configuration files.
apt-get update               # update all packages
apt-get autoremove           # delete anciant packages.

restart:

reboot

Managing services:

sudo service docker status # check status of service docker
service nginx stop    # stop service nginx.
service nginx start   # start service nginx.
service nginx restart # restart service nginx.
service nginx reload  # reload configuration files and settings.

Make executable global:

mv composer.phar /usr/local/bin/composer # make composer globally accessible.

Generate ssh key:

ssh-keygen -t rsa -b 4096 -C "root"

Add user:

adduser test

Remove user:

deluser test
rm -r /home/test

Add admin rights to user:

sudo adduser user_test sudo

Assigning permissions for user over a folder:

sudo chown -R www-data permissions/ # assigning right over permissions folder for user www-data.

Manage File and Folder Permissions

Who are we changing the permission for? [ugoa] - user (or owner), group, others, all Are we granting or revoking the permission - indicated with either a plus ( + ) or minus ( - ) Which permission are we setting? - read ( r ), write ( w ) or execute ( x )

chmod [permissions] [path]

Using Binary References to Set permissions: The first number represents the Owner permission; the second represents the Group permissions; and the last number represents the permissions for all other users. The numbers are a binary representation of the rwx string.

chmod 740 file1

Managing firewall:

sudo ufw status                  # check firewall status.
sudo ufw disable
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw enable

Configuration file for nginx:

/etc/nginx/nginx.conf

Websites Folder:

/var/www/

Secure mysql database:

sudo mysql_secure_installation

then basically yes for every question.

Configuration file for nginx:

/etc/nginx/nginx.conf

Websites Folder:

/var/www/

Install and test SSL:

Steps to Install SSL: link
Link to test SSL level of security: link

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published