Advertisement
Guest User

Untitled

a guest
Apr 25th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.42 KB | None | 0 0
  1.  #!/bin/sh
  2.      
  3.     copyright()
  4.     {
  5.            echo -e "\
  6.          THE \"AULIX_UTILS FOR DEBIAN AND CENTOS\" \n\
  7.   }
  8.  
  9.   copyright;
  10.  
  11.  
  12.   echo "Examples:";
  13.    
  14.    
  15.    test_protocol()
  16.    {      
  17.            Find=$1;
  18.          
  19.            if ! cat /tmp/ssh_debug1.log | grep "$Find"; then
  20.            {
  21.                    echo "Trying to find: $Find";
  22.                    echo "ERROR! Incorrect:";
  23.                    cat /tmp/ssh_debug1.log | grep "$Find";
  24.                    return 1;
  25.            } fi;
  26.            return 0;
  27.    }
  28.    
  29.    
  30.    
  31.    ( verify )
  32.    
  33.    #set -x;
  34.    
  35.            SSHServer=$2;
  36.            ssh -v $SSHServer exit 2>/tmp/ssh_debug1.log;
  37.            if \
  38.    
  39.                    test_protocol "server->client" && \
  40.                    test_protocol "server->client chacha20-poly1305@openssh.com" && \
  41.                    test_protocol "client->server" && \
  42.                    test_protocol "client->server chacha20-poly1305@openssh.com" && \
  43.                    test_protocol "Server host key:" && \
  44.                    test_protocol "Server host key: ED25519" && \
  45.                    test_protocol "Offering" && \
  46.                    test_protocol "Offering ED25519 public key";
  47.            then
  48.                    echo; echo "All tests passed.";
  49.            else
  50.                    echo; echo "Some tests failed!";
  51.            fi;
  52.    ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement