Skip to content

Instantly share code, notes, and snippets.

Chris himynameschris

Block or report user

Report or block himynameschris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
himynameschris /
Created Jul 25, 2015
Check if Linux user exists then test ssh login
while read u; do
echo "checking for username: "$u
getent passwd $u > /dev/null
if [ $? -eq 0 ]; then
id $u
status=$(ssh -o BatchMode=yes -o ConnectTimeout=5 $u@ -p 22 echo ok 2>&1)
echo $status
You can’t perform that action at this time.