Skip to main content

MAC OS TFTP Server

Referring to the link:
MAC TFTP Page
http://takuya-1st.hatenablog.jp/entry/2016/02/27/030544
http://shantiworks.info/2013/10/30/mac-os-x%E3%81%AEtftp%E3%82%B5%E3%83%BC%E3%83%90%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B/

launchctl Command Page
http://macwiki.osdn.jp/wiki/index.php/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/launchctl

TFTP needs file overwrite
http://hints.macworld.com/article.php?story=20070218233806794
"the files must already exist before writing to them"

Step1: MAC OS has pre-set TFTP program. It needs to be activated.

Step2: Create local folder for tftp repository.
$ cd ~
$ mkdir TFTP

$ chmod 755 TFTP
echo hogehoge >> test.html
$ ls
test.html

Step3: replace "/private/tftpboot" with "your created local folder"

$ sudo vi /System/Library/LaunchDaemons/tftp.plist
Finish tftp:
$ sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist
Start tftp:
$ sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist

Step4: Check port 69 is used for tftp service. 
$ sudo lsof -i:69
COMMAND PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
launchd   1 root   42u  IPv4 0x8464b2a1195f48b9      0t0  UDP *:tftp
launchd   1 root   44u  IPv6 0x8464b2a1190da3a1      0t0  UDP *:tftp
launchd   1 root   48u  IPv4 0x8464b2a1195f48b9      0t0  UDP *:tftp
launchd   1 root   49u  IPv6 0x8464b2a1190da3a1      0t0  UDP *:tftp

Step5: MAC's TFTP doesn't allow you to create a new file.
$ ls -al
total 29416
drwxrwxrwx   5 aruba  staff       170 10 12 14:37 .
drwxr-xr-x+ 31 aruba  staff      1054 10 12 13:33 ..
-rw-r--r--@  1 aruba  staff  15056469 10 12 10:51 WB_16_02_0012.swi

-rw-r--r--   1 aruba  staff         0 10 12 14:37 start.cfg


$ touch start.cfg

$ chmod 666 start.cfg
$ ls -al
total 29416
drwxrwxrwx   5 aruba  staff       170 10 12 14:37 .
drwxr-xr-x+ 31 aruba  staff      1054 10 12 13:33 ..
-rw-r--r--@  1 aruba  staff  15056469 10 12 10:51 WB_16_02_0012.swi
-rw-rw-rw-   1 aruba  staff         0 10 12 14:37 start.cfg

-rw-r--r--   1 aruba  staff        10 10 12 13:27 test.html

Notes: If you use "/private/tftpboot" folder, you get errror message with no permission error.

$ tftp localhost
tftp> get test.html
tftp: test.html: Permission denied

Comments

Popular posts from this blog

SNMP mib file installation

Step1: Installing private MIB file and changing SNMP configuration on PC Refeering to the following link for private mibs: http://changineer.info/server/monitoring/monitoring_snmp.html http://wiki.pomme-tech.com/index.cgi?page=%A5%D7%A5%E9%A5%A4%A5%D9%A1%BC%A5%C8MIB%A4%CE%C4%C9%B2%C3&print=1 http://www.lesstep.jp/step_on_board/linux/23/ Refeering to the following link for errors related to mibs: http://www.zabbix.jp/node/3056 http://serverfault.com/questions/440319/did-not-find-zerodotzero-in-module-snmpv2-smi Step2. installing private mib files in an appropriate directory(/usr/share/snmp/private-bims) Step3. changing snmp.conf files. You may need to create an empty new file NOT snmpd.conf. ---------------------------------------- /etc/snmp/snmp.conf MIBDIRS /usr/share/snmp/mibs:/usr/share/snmp/private-bims MIBS all ---------------------------------------- Step4: Checking the output before and after installing private mib files. You don't need to restart th

SNMP mib tips: snmpwalk & snmptranslate

Referring to this web site: https://gist.github.com/bahootyper/575190 The following explanations are about snmpwalk & snmptranslate command options. #Displayes every OID $ snmptranslate -Tp #Dispaly OID label(MIB name) from OID $ snmptranslate .1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2 WLSX-SWITCH-MIB::userPhyAddress #Dispaly MIB tree name from OID label #-IR: label,  -Tp: tree option $ snmptranslate -IR -Tp nUser6Name +-- -R-- String    nUser6Name(3)          Textual Convention: DisplayString          Size: 0..128 #Dispaly MIB tree name from OID label #-IR: label,  -Tp: tree option $ snmptranslate -Tp .1.3.6.1.4.1.14823.2.2.1.14.1.2.1.3 +-- -R-- String    nUser6Name(3)          Textual Convention: DisplayString          Size: 0..128 # OID's detailed option $ snmptranslate -Td .1.3.6.1.4.1.14823.2.2.1.14.1.2.1.3 WLSX-USER6-MIB::nUser6Name nUser6Name OBJECT-TYPE   -- FROM WLSX-USER6-MIB   -- TEXTUAL CONVENTION DisplayString   SYNTAX OCTET STRING (0..1

ettercap on MAC OSX

TK-MBA-2:~ taka$ brew info ettercap ettercap: stable 0.8.2 (bottled), HEAD Multipurpose sniffer/interceptor/logger for switched LAN https://ettercap.github.io/ettercap/ /usr/local/Cellar/ettercap/0.8.2_1 (75 files, 2.3MB) *   Poured from bottle on 2017-05-25 at 14:14:48 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ettercap.rb ==> Dependencies Build: cmake ✘ , ghostscript ✘ Required: pcre ✔ , libnet ✔ , openssl ✔ Optional: ghostscript ✘ , gtk+ ✘ , gtk+3 ✘ , luajit ✘ ==> Options --with-ghostscript Build with ghostscript support --with-gtk+ Build with gtk+ support --with-gtk+3 Build with gtk+3 support --with-luajit Build with luajit support --without-curses Install without curses interface --without-ipv6 Install without IPv6 support --without-plugins Install without plugins support --HEAD Install HEAD version TK-MBA-2:~ taka$ ettercap --with-gtk+ ettercap 0.8.2 copyright 2001-2015 Ettercap