LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LinuxQuestions.org Member Intro
User Name
Password
LinuxQuestions.org Member Intro New to LinuxQuestions.org? Been a long time member but never made a post? Introduce yourself here.

Notices


Reply
  Search this Thread
Old 07-22-2021, 03:22 AM   #1
kva1980
LQ Newbie
 
Registered: Jul 2021
Posts: 3

Rep: Reputation: Disabled
SSH Login Testing Script for Network Devices


I need a script which can use a static username and password to test SSH login is successful or failed in more than 200 devices.

Below Script doesn't have username input.

https://www.programmersought.com/article/8875481072/
 
Old 07-22-2021, 04:20 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,213

Rep: Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400
So what have you tried? What modifications did you try on the script and where do you need help?
 
Old 07-23-2021, 02:50 AM   #3
kva1980
LQ Newbie
 
Registered: Jul 2021
Posts: 3

Original Poster
Rep: Reputation: Disabled
I Didn't try anything as i am new to Unix. Just found this script on the internet, but as far as i understand it will use only password?

But i have a list of IP addresses to which SSH should be done using a common "username" and "password" to provide output with the list of ip where SSH Login was successful and the failed ones.
 
Old 07-23-2021, 03:25 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,213

Rep: Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400
So read the script, try to understand it and then change it to your needs.

If you get stuck and have questions, let us know what you've tried.

Or are you expecting us to do it for you?
 
Old 07-23-2021, 04:11 AM   #5
kva1980
LQ Newbie
 
Registered: Jul 2021
Posts: 3

Original Poster
Rep: Reputation: Disabled
Honestly i don't know how to edit this shell script. If you can edit, it will be helpful.

List of Ip addresses to be taken from ip.txt.

I want to know where i need to supply the username and password.
 
Old 07-23-2021, 04:47 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,426
Blog Entries: 10

Rep: Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249
You need to read the source:
Code:
##########Script Run Instructions####################
 _acc=$1 #The first parameter of the runtime is the account information.
 _pwd=$2 #The second parameter of the runtime is the password information.
$1 and $2 are positional parameters.
But the person who wrote the script didn't even bother to enclose these user-supplied variables in double quotes; that's a very bad sign. Unless you use extremely simple passwords it will fail.

...

So, more questions instead of ready-made solutions.

You should learn some basic shell scripting.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fast login via ssh / Slow login via login manager with machine in AD-domain c01d Linux - Server 2 03-01-2016 01:52 AM
testing iptables performance testing pavan.daemon Linux - Networking 2 09-28-2007 05:22 PM
Replace 'etch' with 'testing' in /etc/apt/sources.list to track 'testing' branch? Akhran Debian 3 04-09-2007 10:45 AM
Sarge-testing To Etch-testing? SMurf7 Debian 3 02-21-2006 10:59 PM
Setup as getting debian testing files from ftp - will it stay with testing BrianHenderson Debian 2 09-02-2004 06:06 PM

LinuxQuestions.org > Forums > LinuxQuestions.org > LinuxQuestions.org Member Intro

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration