
SSH login Alert Telegram bot
from https://github.com/vdeville/ssh-login-alert-telegram apt-get -y install git cd /opt/ && git clone https://github.com/vdeville/ssh-login-alert-tel..
ยกตัวอย่างเช่น ssh จากเครื่อง A ไปเครื่อง B โดยไม่ใช้รหัสผ่านในการ ssh
@เครื่อง A
ssh-keygen -t rsa
(มีอะไรขึ้นมาก็กด enter ผ่านไปให้หมด แล้วพิมพ์คำสั่งด้านล่าง เพื่อเตรียมก็อบค่าไว้)
cat /root/.ssh/id_rsa.pub
id_rsa.pub = publickey ก๊อปไปใส่เครื่องปลายทาง B
id_rsa = privatekey เก็บไว้บนเครื่องต้นทาง A
*แบบดี ๆ หน่อยก็ ssh-keygen -t ed25519 แล้วใส่ passphrase เพื่อกรอกพาสอีกครั้งกันเหนียวเวลา privatekey/putty.ppk หลุด
@เครื่อง B
vim /root/.ssh/authorized_keys
ก็อบค่า id_rsa.pub ของเครื่อง A มาใส่(ต่อท้าย กรณีทำ A หลายเครื่อง)
คราวนี้ลอง ssh จากเครื่อง A -> B โดยไม่ต้องใส่พาสก็ได้แล้วล่ะ
+ล๊อคอินแบบไม่ใช้พาส
vim /etc/ssh/sshd_config
เปลี่ยน #PermitRootLogin yes เป็น PermitRootLogin without-password เพื่อใช้ rsa ด้านบนคอนเฟิร์มแม้จะพิมพ์พาส root ถูก
หรือเปลี่ยน PasswordAuthentication yes เป็น no เพื่อบังคับไม่ใช้ password ตั้งแต่ล๊อคอินในการเข้าใช้งาน
หรือจัดเต็ม
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
service sshd restart
rsa with allowip https://unix.stackexchange.com/a/490120
vim /etc/ssh/sshd_config
AllowUsers [email protected].* [email protected].* otherid1
vim /root/.ssh/authorized_keys
from="192.168.1.*,192.168.2.*" ssh-rsa AAAAB3NzaC1yc2EAA........
ref: blog.rtsp.us/–9dc83e2aaa90
ref: linuxproblem.org/art_9.html
check ssh login
journalctl -u sshd --since -3d | grep "Accepted password for root"
journalctl -u sshd --since -3d | grep "198.23.148.137"
cat /var/log/auth.log* | grep "Accepted password for"
cat /var/log/secure-* | grep "password changed for"
July 11, 2011
Blog | #Command #Linux #Security
from https://github.com/vdeville/ssh-login-alert-telegram apt-get -y install git cd /opt/ && git clone https://github.com/vdeville/ssh-login-alert-tel..
#การใช้ netstat ตรวจสอบการถูกยิงด้วย syn คำสั่ง netstat -ntu | grep SYN_RECV | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nrอันนี้จะบอกว่..
find /home/*/domains/*/public_html/ -maxdepth 2 -type f -name '.htaccess' -print0 | xargs -0 grep -il '(py|exe|php)' find /home/*/domains/*/public_htm..
example error curl -I https://www.google.com/ curl: (60) SSL certificate problem: unable to get local issuer certificate . . ..
วิธีติดตั้ง EA เพื่อให้ MT4 สามารถรันได้นั้น เราต้องมี Expert Advisor (EA) ที่เป็นรูปแบบไฟล์ .ex4 มาก่อน หรือถ้ามีแบบ ea-บลาๆ.mq4 เราก็จะทำการคอมไพล์ ..
พักนี้ขอวุ่นๆเรื่อง MySQL หน่อย เพราะว่า Dedicated Server ของลูกค้าๆ จะกิน MySQL ขึ้นมาหน่อยนึง เลยต้องมีอุปกรณ์ที่ช่วยจูน MySQL ให้เหมาะสมกับเครื่อง ..