meta data for this page
  •  

Különbségek

A kiválasztott változat és az aktuális verzió közötti különbségek a következők.

Összehasonlító nézet linkje

Előző változat mindkét oldalonElőző változat
Következő változat
Előző változat
Következő változatKövetkező változat mindkét oldalon
linux:network [2020/02/05 11:54] – [Egyéb okosságok] adminlinux:network [2023/08/15 17:06] – [Port tesztelés BASH-sel] admin
Sor 1: Sor 1:
 ====== Hálózati okosságok ====== ====== Hálózati okosságok ======
 +
 +==== Rsync ====
 +
 +To create a new directory at the destination and back up your files there, add a trailing slash (/) at the end of the destination path. If you add the trailing slash to the source, then the source directory will not be created at the destination. Rsync only transfers its content in that case.
 +Kulcs használat:
 +
 +  rsync e "ssh -i $HOME/.ssh/somekey"
 +
 +==== Firewalld ====
 +
 +[[https://linuxconfig.org/introduction-to-firewalld-and-firewall-cmd-command-on-linux]]
 +
 +==== Port tesztelés BASH-sel ====
 +
 +/dev/tcp/host/port: (If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open a TCP connection to the corresponding socket.)
 +
 +/dev/udp/host/port: (If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open a UDP connection to the corresponding socket.)
 +
 +So you could use something like this:
 +
 +  xenon-lornix:~> cat < /dev/tcp/127.0.0.1/22
 +  SSH-2.0-OpenSSH_6.2p2 Debian-6
 +  ^C pressed here
 +
 +Szkriptbe:
 +
 +  (echo > /dev/tcp/localhost/1500) >/dev/null 2>&1 && echo "It's up" || echo "It's down"
 +  timeout 1s bash -c "true <>/dev/tcp/localhost/443" >/dev/null 2>&1 && echo "It's up" || echo "It's down"
 +  while [[ -n $((echo > /dev/tcp/$TCPS/$TCPP) 2>&1 > /dev/null) ]]; do echo varunk; sleep 10; done
 +  
 +Windows PowerShell:
 +
 +  Test-NetConnection -ComputerName myserver.com -Port 443
 +==== NFS okosságok ====
 +
 +Portcheck ([[http://bluefinch-nl.blogspot.com/2014/04/mounting-nfs-shares-from-linux-server.html|link]])
  
 ==== SSH okosságok ==== ==== SSH okosságok ====
 +
 +[[linux:ssh-exit-codes.sh|SSH exit kódok]]
  
 === SSH-n másolás köztes állomáson át === === SSH-n másolás köztes állomáson át ===
Sor 56: Sor 94:
       expect eof"       expect eof"
 </file> </file>
 +
 +Az ssh parancs ne hajtsa végre a hibás RC kódú parancs utáni többi parancsot: set -e
  
 === SFTP leírások === === SFTP leírások ===
Sor 84: Sor 124:
   ftp> bin   ftp> bin
   ftp> put "| dd if=/dev/zero bs=32k count=10000 " /dev/null   ftp> put "| dd if=/dev/zero bs=32k count=10000 " /dev/null
 +
 +=== Hálózat felderítés ===
 +
 +  nmap -sP hoszt/hálózat
 +
 === Port scanning === === Port scanning ===
  
Sor 103: Sor 148:
         VLANS=$(timeout ${VLAN_SNIFF_TIME} tcpdump -c 1000 -nni $ETH -e vlan 2>/dev/null | grep -o 'vlan [0-9]*' | sort | uniq | awk '/vlan/{print $2}' | tr '\n' ' ')         VLANS=$(timeout ${VLAN_SNIFF_TIME} tcpdump -c 1000 -nni $ETH -e vlan 2>/dev/null | grep -o 'vlan [0-9]*' | sort | uniq | awk '/vlan/{print $2}' | tr '\n' ' ')
         SLAVES=""         SLAVES=""
-        for BOND in `ls /proc/net/bonding/*`; do+        for BOND in `ls /proc/net/bonding/2>/dev/null`; do
             if [[ $(grep -c "Slave.*$ETH" $BOND) -gt 0 ]]; then             if [[ $(grep -c "Slave.*$ETH" $BOND) -gt 0 ]]; then
                 MAC=$(grep -A5 "Slave.*$ETH" $BOND | tail -n1 | grep -oP '(?<=addr: ).*$')                 MAC=$(grep -A5 "Slave.*$ETH" $BOND | tail -n1 | grep -oP '(?<=addr: ).*$')
Sor 138: Sor 183:
  
 [[http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html#MULTICAST]] [[http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html#MULTICAST]]
 +
 +[[https://www.aelius.com/njh/subnet_sheet.html|Subnet Mask Cheat Sheet]]