Tag: shell
-
How to automate ssh
Please find below the script and run form client machine from where you want to set login without password. #!/bin/bash #withoutPasswordLogin.sh #Author : Mahendra Pratap Singh #Created on : Dec 18, 2013 #Modified on : Dec 18, 2013 #Version : 1.1 #Description : This script is to automate login on linux machine without password, Script…
-
How to get IP address in shell script
There is many ways to get IP address some popular and easier are mentioned below- In Example 2 we may get IP from particular interface. Example 1: !/bin/bash IPADDRESS=`ifconfig | awk -F’:’ ‘/inet addr/&&!/127.0.0.1/{split($2,_,” “);print _[1]}’` echo “Machine IP address is: $IPADDRESS” Example 2: !/bin/bash IPADDRESS=`ifconfig eth0 | grep ‘inet addr:’ | cut -d: -f2…