美文网首页
LinuxCommand

LinuxCommand

作者: LiamBao | 来源:发表于2018-04-08 18:52 被阅读0次
  • Troubleshooting ssh
listening on 0.0.0.0 port 10222.
  • EXPECT spawn ssh ProxyCmd
exp_cmd="set timeout 10 
spawn ssh $login@$target_ip -p 22 -o \"ProxyCommand=ssh -p 22  root@$jump_ip -W %h:%p\";
expect \"password\"
"
expect -c "$exp_cmd" > $conf_log
  • ssh ProxyCommand
    ProxyCommand ssh ssh_jump_host "nc %h %p"
─ One layer of encryption
═ Two layers of encryption
┏━━━━━━━━━━━━━━┓          ┏━━━━━━━━━━━━━┓          ┏━━━━━━━━━━━━━━━━━┓         
┃  SSH client  ┃══════════┃  Jump host  ┃──────────┃  Target server  ┃
┗━━━━━━━━━━━━━━┛          ┗━━━━━━━━━━━━━┛          ┗━━━━━━━━━━━━━━━━━┛



ssh liam@10.10.10.167 -p 22 -o ProxyCommand='ssh -p 22 root@192.168.234.4 -W %h:%p'
  • SCP ProxyCmd
    ssh_rsa file,no password input

scp -o ProxyCommand="ssh $jump_host nc $host 22" $local_path host:$destination_path


scp  -o ProxyCommand="ssh -i /root/.ssh/ssh_rsa root@192.168.234.4 -W %h:%p" /tmp/file liam@10.10.10.166:root/file
  • decrypt pwd
echo "74gwRasdClz9kjvw" | openssl enc -d -base64 -aes-256-ctr -nopad  \ 
      -nosalt -k "$(sha256sum "/root/.pki/cert.seed" |  \
      cut -d' ' -f1 | tr -d "\r\n")"

 openssl enc -e    "encrypt pwd"
  • retrieve of CA certificate SHA1 fingerprint
keytool -printcert -file ca_cert.cer |  \
    egrep SHA1 | cut -d ':' -f 2-
  • retrieve CA certificate Issuer
keytool -printcert -file ca_cert.cer | egrep Issuer \
    | cut -d ',' -f 2
  • console print pfx certificate info
openssl pkcs12 -in $radius_ecc_pfx.pfx -clcerts -out  ecc_radius_cert.pem  -nokey
  • calculate ipv6
res=“$(ipcalc -c -6 $ipv6_addr 2>/dev/null)"
  • check status of radius database:
mysql -uradius —password=“xx” -e “USE radius;”
  • initial radius database
mysql -uroot —password=‘xxx’ radius < radius_scripts_path/schema.sql 2>/dev/null
  • remote command
ssh -o TCPKeepAlive=yes -o ConnectTimeout=30 -o StrictHostKeyChecking=no \
     -i /root/.ssh/konw id_rsa 192.168.234.2 "vim-cmd vmsvc/power.on vmid”

相关文章

  • LinuxCommandLine -- 0

    http://www.linuxcommand.org/http://www.linuxcommand.org/t...

  • LinuxCommand

    Troubleshooting ssh EXPECT spawn ssh ProxyCmd ssh ProxyCo...

  • 掌握Linux命令行必读

    http://linuxcommand.org/ 这个网站是一本书《The Linux Command Line ...

  • 小错误集锦

    Linuxcommand not foundLinux命令找不到?(找不到命令)这个问题其实很简单,如果你在终端输...

  • Linux Is About Imagination

    本文摘自免费书http://linuxcommand.org/tlcl.php 此书pdf版可下载。作为一个在w...

网友评论

      本文标题:LinuxCommand

      本文链接:https://www.haomeiwen.com/subject/kcephftx.html