Skip to content

Instantly share code, notes, and snippets.

@rizemon
Created March 31, 2024 14:41
Show Gist options
  • Save rizemon/35678c34214123cca90df4dd0cd4c4f3 to your computer and use it in GitHub Desktop.
Save rizemon/35678c34214123cca90df4dd0cd4c4f3 to your computer and use it in GitHub Desktop.
#!/bin/bash
WORKING_DIRECTORY="/home/kali/Desktop/"
cd $WORKING_DIRECTORY
mkdir -p "$WORKING_DIRECTORY/logs/
DATE=`date +%d.%m.%y`
TIME=`date +%H.%M.%S`
LOGFILE="$WORKING_DIRECTORY/logs/$DATE-$TIME.commands.log"
USERNAME="kali"
PASSWORD="kali"
HOSTNAME="kali"
gnome-terminal --tab -- script -f "$LOGFILE" -c "sshpass -p $PASSWORD ssh -o \"StrictHostKeyChecking no\" $USERNAME@$HOSTNAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment