bashrc/.bashrc.d/cnssh.sh

16 lines
330 B
Bash

cnssh() {
# Usage: cnssh <ip address> [command]
# sshpass -p "" ssh Crestron@192.168.0.51
local uname="Crestron"
local pass=""
local addr="$1"
shift
local cmd="$@"
sshpass -p "$pass" ssh \
-o StrictHostKeyChecking=no\
-o GlobalKnownHostsFile=/dev/null\
-o UserKnownHostsFile=/dev/null\
"$uname"@"$addr" "$cmd"
}