User Tools

Site Tools


linux:bash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:bash [2023/07/11 07:10] – [Set VIM as visudo] bstaffordlinux:bash [2023/07/25 15:20] (current) – [Read File] bstafford
Line 8: Line 8:
 EDITOR="$VISUAL" ; export EDITOR</code> EDITOR="$VISUAL" ; export EDITOR</code>
  
-===== No Passwd Sudo =====+===== Read File ===== 
 +Read a list of words from a file [[https://blog.apnic.net/2023/07/19/the-joy-of-txt/|source]] 
 + 
 +<code>#!/bin/bash 
 +domainsfile="domains.txt" 
 + 
 +while read domain 
 +do 
 +    echo "--" 
 +    echo "[$(date)] CHECKING DOMAIN $domain" 
 +    echo "--" 
 + 
 +    host -W 5 -t txt "$domain". # -W 5 for a 5 second timeout 
 +done < "$domainsfile"</code> 
 +<code>./get-txt-records.sh > host.out 2>&1</code> 
 +===== Sudo ===== 
 +Add user to sudo list in ''visudo'' 
 +<code>username ALL=(ALL:ALL) ALL</code> 
 +The add user where they don't need password, use the following. 
 + 
 +REMEMBER: put this at the bottom of the file or other lines may get applied after this and change the user permission.
 <code>username ALL=(ALL) NOPASSWD: ALL</code> <code>username ALL=(ALL) NOPASSWD: ALL</code>
 =====Toggle Bash History===== =====Toggle Bash History=====
linux/bash.1689059407.txt.gz · Last modified: by bstafford