Posts

Showing posts from August, 2021
Image
 MT FIRST BASH SHELL SCRIPT .. This  script pings every ip address in a subnet and outputs the status of that ip whether that  particular ip is assigned to a device or not. STEPS::::::: step 1------- open a new file(here i am using nano )  Now write the first line as : #!bin/bash This helps the shell to recognise the file as a script. Now you can add  comments just by putting "#" symbol before your comment . step 2----- Write your script  Here i am  using For loop since, i have to ping multiple times  here i also used exit status. Exit status tells whether the previous command was successfull or failled with any error. 0 means the command was succesfull and 1-255 any number in this range means an error(command failed to execute or unsuccessfull) In ping command 0 means there was a reply from ip address and 1 means no reply, rest may be for other network errors. Here to minimize time i used -c and -w options in ping command. -c is used to terminate...
Image
Setting up an sftp server.. Establishing a sftp server with only access to sftp(no access to shell) QuickGo step1--Enable ssh step2--turn firewall of on the port 22(or any static port you set for ssh) step3--create users/groups and setting up passwords for created users step4--create folders for the users to upload and download files( land on)(set permissions accordingly) step5--Edit the sshd_config file to set the users permissions step6--restart the sshd service step7--login with your user.. Step by step procedures are as follows::::::  (note:::here i am using ubuntu as my server) --Step1 First install ssh (ignore if already installed) use command:- "apt-get install openssh-server" --Step 2 Disable blocking by firewall on port 22 .(since it is the default port for ssh) use command: "ufw allow ssh" --Step3 Now comes the main part, Create users  (here i created 5 users two in one group and two in other the 5th one in both) now check whether they are created now crea...
Image
Advanced uses of ssh Advance usage of SSH SSH -LOCAL PORTFORWARDING Usually Ssh is used for connecting remote servers only, but it can be more complex by tweeking tools. for example, local and dynamic port forwarding. Using Local portforwarding to create a private tunnel between client and a secondary server in the network of primary server. General understanding--- Step 1 First connect the client and primary server(mentioned in prev blog..) follow the step provided in the image below: connection succesfull!! Step 2 Once connected, open any browser and mention the listening port of client it will redirect to the destination port and IP.
Image
Advanced uses of ssh Advance usage of SSH What is Authentication? Authentication is the process of taking an identity and using some form of verification, the identity can be verified as being legitimate. Privacy and Confidentiality. Why Authentication? it is used for users.. Privacy security Confidentiality Popular Types of ssh Authentication these types are the most general and used by many users Password Public key Eshtablishing a passwordless connection with the remote host using ssh here's the image explaining the working of Public key authentication mechanism in ssh- What generally happens? When the user first connects to the server via ssh,the client asks the user whether to trust the server or not , if the user says yes, then it saves the server hash into a folder called known_hosts. Hence, the next time the user connects to the same se...