VALUE-DOMAIN DDNS update shell script (on Synology RT2600ac)
VALUE-DOMAIN ã® DDNSãLinuxã§ä½¿ãã
Â
1. äºåã«ã§ãä¸è¨ã®ãã¼ã ãµã¼ããæå®ãã¦ãããã¨ã
ns1.value-domain.com
ns2.value-domain.com
Â
2.  ãæ¼ãã¦ä¸è¨ã確èª
å¿ è¦ãªãã©ã¡ã¼ã¿æ å ±
ãã¡ã¤ã³ | example.com(ããªãã®åå¾ãããã¡ã¤ã³) |
---|---|
ãã¹ã¯ã¼ãï¼»å¤æ´ï¼½ | âã§ããã ãé·ãããã¤è±æ°è¨å·ãå ¥ãã¾ããã |
ãã¹ãå | * |
IPã¢ãã¬ã¹ | xxx.xxx.xxx.xxx |
Â
3. 次ã«ãã§ãã¯ãå ¥ãã¦ãå¤æ´ã
ãã¤ãããã¯DNSæ©è½
Â
4. ãã¹ã
https://dyn.value-domain.com/cgi-bin/dyn.fcg?
ã«ãã©ã¦ã¶ã§ã¢ã¯ã»ã¹ãã¦æ´æ°ã§ããããã¹ããè¡ãã
ãªããããã¾ã§ã§ã¤ã¾ããããã§ããã°ä¸è¨ã®å ¬å¼ãã«ããåç §
Â
5. ã³ã¼ããµã³ãã«
valuedomainddnsIPupdate.sh
#/bin/sh</p> #VARIABLES #FQDNï¼ãã¡ã¤ã³åï¼ï¼ __DOMAINNAME__="" #ãã¹ã¯ã¼ãï¼ __PASSWORD__="" #ã¦ã¼ã¶ã¼åï¼æ´æ°ãããã¹ãï¼ï¼ __HOSTNAME__="" #å¤é¨ã¢ãã¬ã¹ï¼ __MYIP__="" #å¤é¨IPåå¾ __MYIP__=`wget -q -O - "https://dyn.value-domain.com/cgi-bin/dyn.fcg?ip"` #echo ${MYIP} #value-domainã®cgiããã¾ã«busyã«ãªãã®ã§sleep sleep 5 #æ´æ° wget -q -O - "https://dyn.value-domain.com/cgi-bin/dyn.fcg?d=${__DOMAINNAME__}&;p=${__PASSWORD__}&;h=${__HOSTNAME__}&;i=${__MYIP__}"
ãããã¿ã¦ããæ¸ããã®ã§ãåèã«*1
念ã®ããshã¯700ã«ãã¦ããã¾ãããã
6. ãã¾ã
å®ã¯Synology RT2600ac ã«ã¼ã¿ã¼ã§DDNSãããã¤ãã«VALUE-DOMAINããªãã£ããããããCRONãã¦ã¾ãã
/etc/crontab ã«è¿½è¨ããã
#synoservicectl --reload crond
ãå®è¡ãã¦å®äº
*1:è足ã«ãªãã®ã§ã³ã¼ããµã³ãã«ã«æ»ãå¤ã®å¦çã¯è¼ãã¦ãã¾ãã
Synology RT2600åå¿ã¡ã¢
ï¼æ´æ°ã»è¿½è¨ããï¼
RT2600acã¯SRMï¼ç®¡çOSï¼ã®ãã¼ã¸ã§ã³ã¢ããã§ããã«ã¼ããã©ã¼ã¹å¯¾çã¨ãã¦adminãç¡å¹åããããä¿ãããã«ãªã£ãã
3åãªãã©ã¤ã§Banããè¨å®ãå ¥ãã¦ããã®ã§åé¡ãªãã®ã ããè¦åãããããã®ã§å¥ã¦ã¼ã¶ãadminã«è¨å®ããã
sshæ¥ç¶ãã§ããªããªã£ã¦é©ãããããªãã¨sshæ¥ç¶ã¯ç¡å¹åããadminã®ãã¹ã¯ã¼ããåç §ãããããããã©ããªã£ã¦ãã ããå°ã£ã¦ã人ããã ãâ¦
Â
--2023/01追è¨--
RT2600acã«SRM1.3ãæ¥ãé¢ä¿ã§ä¸è¨ã¯å¤ããªã£ãã
â»ãã ã1.2ç³»ã使ãç¶ããã®ã§ããã°åé¡ã¯ä¸è¨ã®ã¾ã¾
1.3ã§å¤ãã£ãé¨åã移è¡ã«ã¤ãã¦ã¡ã¢ãæ®ãã
1.2â1.3ã¸ã®ãã¼ã¸ã§ã³ã¢ããã§ç¡å¹ã«ããadminãã¹ã¯ã¼ããrootã®ãã¹ã¯ã¼ããã¨ããå±éºãªä»æ§ã¯æ¶ããã
代ããã«ãã¡ããæé ã¨ãªã£ã¦ããã注æãããã
ä¸è¨ãåèã«sudo -iã§ä½¿ãã¨ããè³æ¥µä¸è¬çãªä»æ§ã«å¤ãã£ã¦ããã®ã§ãæ°ãã«å°å ¥ãã人ã¯ããã«å¾ãã¨ããã
ï¼ãã ãããã ã¨å³å¯ã«ã¯ã¿ã¤ãã«ã¯ã¦ã½ã§ããï¼
以å1.2ç³»ã§ãã°ã¤ã³ãã¦ãã人ãªã©ã¯ä»¥ä¸ã«æ³¨æäºé ã
ã»/root é ä¸ã¯åæåãããï¼ãã¡ã¤ã«çã¯æ¶ãã¦ããï¼
ã»/root/.ssh/authentication_keys ã¯å¼ãç¶ããã
ã»/etc/ssh/sshd_conf ã¯åæåï¼ãããâéè¦
 â ãã®ãããéµãã°ã¤ã³ãã¦ããå ´åéµãã¡ã¤ã«çã¯ãã£ããå¼ãç¶ããã¦ããã®ã«åç §ããããã°ã¤ã³ã§ããªãã
Â
linuxã®ããã¹ãsshè¨å®ã¨ãã¦ã¯ PermitRootLogin no ãPasswordAuthentication no ã¯ãã£ã¦ããã¹ããªã®ã§ãã®æã«è¦ç´ãã¦ã¿ã¦ã¯ã©ããã
Â
ã¡ã¢
sshd_configç·¨éå¾ã®ãªã¹ã¿ã¼ãã³ãã³ã
# sudo synoservicectl --reload sshd