Posts

Showing posts from September, 2021

SSH Key with Google cloud

Image
 We can create 2 type of SSH key for google  1) which connect to all instance 2) which connect to particular 1 instance 1) Generate SSH key via     a) Go to a place where you want to generate ssh key     b)   ssh-keygen -t rsa -b 4096 -C keyName          Note keyName is your ssh key you can replace with any other     c) Provide path and name of ssh      d) Copy the content of keyName.pub file     e) Visit your console.google.com     Go to compute engine -> Setting -> MetaData     Add the key    2) Create a firewall rule or edit the existing ssh firewall rule with source ip with your IP if you want to secure it 3) Create an instance 4)After that got for edit 5) Option want for the person for this particular instance then click SSH Block  Final in your terminal sudo ssh -i keyName keyName@IP_ADDRESS

Add SSL in django or apche php file

 Go to https://certbot.eff.org/lets-encrypt/ubuntufocal-apache and select your software and os and get a command to install certbot 1) Install snap sudo apt install snapd 2)  Install Cert-Bot sudo snap install core; sudo snap refresh core sudo snap install --classic certbot

Create user in Linux

adduser username   Copy Set and confirm the new user’s password at the prompt. A strong password is highly recommended! Set password prompts: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Follow the prompts to set the new user’s information. It is fine to accept the defaults to leave all of this information blank. User information prompts: Changing the user information for username Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] Use the  usermod  command to add the user to the  sudo  group. usermod -aG sudo username   Copy By default, on Ubuntu, members of the  sudo  group have sudo privileges. Test sudo access on new user account Use the  su  command to switch to the new user account. su - username   Copy As the new user, verify that you can use sudo by prep...