Changed LXC records to more generic name (DNS zone updates required). Updated README.

pull/9/head
Aaron Johnson 7 years ago
parent 6c6409599b
commit 124f07022a

@ -58,8 +58,17 @@ export SORC_PASS_FILE="$HOME/.some_file"
## DNS Setup
You'll likely want to create a DNS zone specifically for this script for better control over the hosts included. I would recommend using a TLD not normally available, to be sure you don't have any overlap with existing DNS names. This domain doesn't need to be publicly queried, and actually it's probably in interest of security if it isn't.
The best way to explain the zone set up is by example. Let's assume you create the zone "**not-a-real.lan**" and you have 5 hosts, known as *host1.not-a-real.lan* through *host5.not-a-real.lan*.
If you create the following entries (BIND format shown):
There are 4 types of hosts supported right now, which are identified by accompanying TXT records. The default (no TXT record) is to use SSH with your normal configured username. The other 3 types require a TXT record to match the A record of the host, and have the following properties:
| TXT value | Effect |
|-----------|-----------------------------------------|
| [none] | Log in as configured user over SSH |
| `logroot` | Log in as 'root' user over SSH |
| `windows` | Log in over RDP (rdesktop) |
| `cisco` | Log in with a generic telnet connection |
As an example, let's assume you create the zone "**not-a-real.lan**" and you have 5 hosts, known as *host1.not-a-real.lan* through *host5.not-a-real.lan*.
Let's assume you create the following entries (BIND format shown):
```
$ORIGIN not-a-real.lan.

@ -9,7 +9,7 @@ scan_domain=$1
scan_ns=$2
# Static Configuration (Do not edit)
dns_time=5
dns_time=4
dns_tries=1
#icmp_fail_text="$(tput bold)Tab Sorcery: $(tput setaf 1)ICMP connection to ${scan_ns} failed!$(tput sgr0)"
dns_fail_text="$(tput bold)Tab Sorcery: $(tput setaf 1)DNS connection to ${scan_ns} failed!$(tput sgr0)"
@ -45,7 +45,7 @@ while read host <&3; do
connect_cmd="ssh -t"
host_short=`echo ${host} | awk -F. '{print $1}'`
if echo $zone_xfer | grep $host | grep TXT; then
if [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"lxc"' ]; then
if [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"logroot"' ]; then
user_name="root"
get_hostip ${host}
alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}"

Loading…
Cancel
Save