ãã¹ãåã®è¨å® ãã¹ãåã¯... kurosheeva ã¨ããååã§ã¤ã³ã¹ãã¼ã«ããã®ã§ãããã /etc/hostname ã«è¨è¼ããã¦ããããºã root@kurosheeva:~# cat /etc/hostname kurosheeva ããããªè¨è¼ããã¦ãã¾ããããã¹ãåãå¤æ´ããå ´åããã®å 身ãä¿®æ£ãã¾ãã å¤æ´ãããã¹ãããå ´åããsudo hostname --file /etc/hostnameãã§åæ ããã¾ãã ãªãã sudo /etc/init.d/networking restart ã§ã¯åæ ããã¾ãã...ã /etc/hosts ãããã¤ã³ã¹ãã¼ã«ç´å¾ã§ã¯ãªããå¾ãã /etc/hostname ãå¤æ´ããå ´åã/etc/hosts ãå¤æ´ãå¿ è¦ã§ããã ãããã¯ååã§ãè¨å®ãå¿ è¦ãªã®ããããã¾ããããããååã¯è¨å®ããªãã¦ãåãã¦ããããª?[è¬] ã¨ãã
ansible ã§è¨å®ãã¡ã¤ã«å ã®æååãç½®æãããã£ãã®ã§ã lineinfile ã¢ã¸ã¥ã¼ã«ã試ãã¦ã¿ã¾ããã lineinfile http://www.ansibleworks.com/docs/modules.html#lineinfile 対象ãµã¼ãã«ä»¥ä¸ã®ãããªãã¡ã¤ã«ãç¨æã /tmp/test.conf foo bar baz bar bar bar foo ãã®ãã¡ã¤ã«å ã®æååãç½®æãã¦ã¿ã¾ãã 以ä¸ã®ãã㪠Playbook ãä½æãã¾ããã lineinfile.yml - hosts: all user: root vars: target_file: /tmp/test.conf tasks: - name: lineinfile example task lineinfile: dest=${target_file} state=present regexp
dscacheutil ãç´ãå¿ãã¦ãã¾ãã®ã§ã¡ã¢ # Hoster 使ãã°ãããã ãã©ã趣å³ã§ããã¨ãã¯ã³ãã³ã使ãããã®ã§ã»ã» Leopard ããå $ sudo vi /etc/hosts $ sudo lookupd -flushcache Leopard, Snow Leopard $ sudo vi /etc/hosts $ sudo dscacheutil -flushcache Lion $ sudo vi /private/etc/hosts $ dscacheutil -flushcache (ããã㯠sudo killall -HUP mDNSResponder )
使ç¨ä¾â ã³ãã¼å ã®ãã¡ã¤ã«(tmp.txtï¼ããªã¢ã¼ããã·ã³ï¼IPã¢ãã¬ã¹ï¼aaa.bbb.ccc.dddï¼ã®ãã¼ã ãã£ã¬ã¯ããªï¼/home/karumaï¼ã«ã³ãã¼ãã¾ããIPã¢ãã¬ã¹ï¼ã¾ãã¯ãã¹ãåï¼ã¨ã³ãã¼å ãã£ã¬ã¯ããªã®éã¯ãã³ãã³ã:ãã§åºåãã¾ãã $ scp tmp.txt [email protected].ccc.ddd:~/ [email protected].ccc.ddd's password: tmp.txt 100% 31 0.0KB/s 00:00 ãã¹ã¯ã¼ãèªè¨¼ã®å ´åãsshã¨åãããã«ãã¹ã¯ã¼ããè¦æ±ããã¾ãã 使ç¨ä¾â¡ ã³ãã¼å ã®ãã£ã¬ã¯ããªï¼dirï¼ããã¹ãåï¼example.comï¼ã®/tmpã«ã³ãã¼ãã¾ããã¾ãããªãã·ã§ã³ -C ã§éä¿¡ãå§ç¸®ãã¦ãã¾ãã $ scp -rC dir [email protected]:/tmp /tmp ã«ãã£ã¬ã¯ããªï¼dir
~/.ssh/config ãã¡ã¤ã«ãæ¸ããã¨ã§ãµã¼ãã¼æ¯ã«æ¥ç¶è¨å®ãå¤ãããã¨ãåºæ¥ã.ã¨è¨ã話ãåã«æ¸ãã¾ããã .ssh/config ã¯ã¤ãã¤ã便å©ãªã®ã§ï¼ããä¸åº¦ã¾ã¨ãã¦è¦ã¾ããã ãã¹ãæ¯ã«ã¦ã¼ã¶ã¼åãå¤ãã ~/.ssh/config è¨è¿°ä¾ Host 192.168.2.5 User takuya_1stãã®è¨è¿°ã§ ssh [email protected] ã ssh 192.168.2.5 ãåãã«ãªãã¾ãï¼ãã¦ã¼ã¶ã¼åãçç¥åºæ¥ã¾ããã ãã¹ãåãçç¥ãã Host s0 Hostname 192.168.2.5ãã®è¨è¿°ã§ ssh s0ã ssh 192.168.2.5ã¨åçã«ãªãã¾ãï¼IPçç¥ã§ããã /etc/hostsã®æ¸æããè¦ããªãã楽ã¡ãã§ãï¼ï¼ ãµã¼ãã¼æ¯ã«éµãå¤ãã SSHã®ç§å¯éµããµã¼ãã¼æ¯ã«å¤ããå ´å. Host 192.168.2.5
SSH (Secure Shell)ã使ã£ã¦ãªã¢ã¼ããã¹ãã«æ¥ç¶ããå ´åããã¡ãã¡ãã¹ã¯ã¼ããå ¥ããã®ã¯é¢åã§ããããã¾ãæã¡ééããæ¼æ´©ã®å±éºãå¢ãããããã§ã証ææ¸ã使ã£ã¦æ¥ç¶ããæ¹æ³ãå°å ¥ããã¨ä¾¿å©ã§ããã ãã®ããã«ã¯ã次ã®ãããªæé ãè¸ããã¨ã«ãªãã以ä¸ã¯ç«¯æ«ã§è¡ã£ãæ¹ãããã®ã§ããããããGNOME端æ«ãç«ã¡ä¸ãã¦ããã ã¾ããèªåã®ç«¯æ«å´ã§ãç§å¯éµã¨å ¬ééµãä½æããã æåã«ããã£ã¬ã¯ã㪠.ssh ãä½æããããã®ãã£ã¬ã¯ããªã¯èªåã ããèªã¿æ¸ãã§ããããã«ãªã£ã¦ããå¿ è¦ãããã ç¶ãã¦ãéµãä½æããã æåã« "Enter which ..." ã¨èããã¦ããé¨åã¯ãããã©ã«ãã§ããã°ãã®ã¾ã¾ãªã¿ã¼ã³ã§ããã 次ã«ãã¹ãã¬ã¼ãºãå ¥åããããã®ãã¹ãã¬ã¼ãºã¯ã§ããã ãé·ãæ¹ãããã "-t dsa" ãçç¥ããã¨ãRSAå½¢å¼ã§éµãä½ãã test1:~> ssh-keyge
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}