配置板子用开发环境-之 配置tftp 和tftpd

配置tftp 和tftpd


zhangbin@Ubuntu32:~$ sudo su

[sudo] password for zhangbin: 
root@Ubuntu32:/home/zhangbin# apt-get install tftpd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  xinetd
The following NEW packages will be installed:
  tftpd xinetd
0 upgraded, 2 newly installed, 0 to remove and 7 not upgraded.
Need to get 135 kB of archives.
After this operation, 479 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main xinetd i386 1:2.3.14-7ubuntu4 [121 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/universe tftpd i386 0.17-18ubuntu2 [14.4 kB]
Fetched 135 kB in 1s (91.8 kB/s)
Selecting previously unselected package xinetd.
(Reading database ... 449942 files and directories currently installed.)
Unpacking xinetd (from .../xinetd_1%3a2.3.14-7ubuntu4_i386.deb) ...
Selecting previously unselected package tftpd.
Unpacking tftpd (from .../tftpd_0.17-18ubuntu2_i386.deb) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db ...
Setting up xinetd (1:2.3.14-7ubuntu4) ...
xinetd start/running, process 3473
Setting up tftpd (0.17-18ubuntu2) ...
Note: xinetd currently is not fully supported by update-inetd.
      Please consult /usr/share/doc/xinetd/README.Debian and itox(8).
root@Ubuntu32:/home/zhangbin# apt-get install tftp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  tftp
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 15.6 kB of archives.
After this operation, 81.9 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe tftp i386 0.17-18ubuntu2 [15.6 kB]
Fetched 15.6 kB in 0s (16.3 kB/s)
Selecting previously unselected package tftp.
(Reading database ... 449977 files and directories currently installed.)
Unpacking tftp (from .../tftp_0.17-18ubuntu2_i386.deb) ...
Processing triggers for man-db ...
Setting up tftp (0.17-18ubuntu2) ...

root@Ubuntu32:/home/zhangbin# 




root@Ubuntu32:/home/zhangbin# ufw -disable
Invalid syntax


Usage: ufw COMMAND


Commands:
 enable                          enables the firewall
 disable                         disables the firewall
 default ARG                     set default policy
 logging LEVEL                   set logging to LEVEL
 allow ARGS                      add allow rule
 deny ARGS                       add deny rule
 reject ARGS                     add reject rule
 limit ARGS                      add limit rule
 delete RULE|NUM                 delete RULE
 insert NUM RULE                 insert RULE at NUM
 reset                           reset firewall
 status                          show firewall status
 status numbered                 show firewall status as numbered list of RULES
 status verbose                  show verbose firewall status
 show ARG                        show firewall report
 version                         display version information


Application profile commands:
 app list                        list application profiles
 app info PROFILE                show information on PROFILE
 app update PROFILE              update PROFILE
 app default ARG                 set default application policy


root@Ubuntu32:/home/zhangbin# 



关掉防火墙

root@Ubuntu32:/home/zhangbin# ufw disable
Firewall stopped and disabled on system startup
root@Ubuntu32:/home/zhangbin# 



========================================



root@Ubuntu32:/home/zhangbin# mkdir -p /tftproot
root@Ubuntu32:/home/zhangbin# chmod 777 /tftproot
root@Ubuntu32:/home/zhangbin# ls /
bin    etc             lib         mylog.txt  run      tftproot  vmlinuz
boot   home            lost+found  opt        sbin     tmp       vmlinuz.old
cdrom  initrd.img      media       proc       selinux  usr
dev    initrd.img.old  mnt         root       sys      var
root@Ubuntu32:/home/zhangbin# ls /etc/
acpi                    hostname~            polkit-1
adduser.conf            hosts                popularity-contest.conf
adjtime                 hosts~               ppp
alternatives            hosts.allow          printcap
anacrontab              hosts.deny           profile
apache2                 hp                   profile~
apg.conf                ifplugd              profile.d
apm                     iftab                protocols
apparmor                ImageMagick          pulse
apparmor.d              init                 python
apport                  init.d               python2.7
apt                     initramfs-tools      rc0.d
at.deny                 inputrc              rc1.d
at-spi2                 insserv              rc2.d
avahi                   insserv.conf         rc3.d
bash.bashrc             insserv.conf.d       rc4.d
bash_completion         iproute2             rc5.d
bash_completion.d       issue                rc6.d
bindresvport.blacklist  issue.net            rc.local
blkid.conf              java-6-openjdk       rcS.d
blkid.tab               kbd                  request-key.conf
bluetooth               kernel               resolvconf
bonobo-activation       kernel-img.conf      resolv.conf
brlapi.key              kerneloops.conf      rmt
brltty                  ldap                 rpc
brltty.conf             ld.so.cache          rsyslog.conf
ca-certificates         ld.so.conf           rsyslog.d
ca-certificates.conf    ld.so.conf.d         samba
calendar                legal                sane.d
chatscripts             libnl-3              securetty
checkbox.d              libpaper.d           security
checkinstallrc          libreoffice          sensors3.conf
chromium-browser        libuser.conf         sensors.d
colord.conf             lightdm              services
compizconfig            locale.alias         sgml
ConsoleKit              localtime            shadow
console-setup           logcheck             shadow-
cron.d                  login.defs           shells
cron.daily              logrotate.conf       shells.bak
cron.hourly             logrotate.d          skel
cron.monthly            lsb-base             smi.conf
crontab                 lsb-base-logging.sh  snmp
cron.weekly             lsb-release          sound
cups                    ltrace.conf          speech-dispatcher
cupshelpers             magic                ssh
dbus-1                  magic.mime           ssl
debconf.conf            mailcap              subversion
debian_version          mailcap.order        sudoers
default                 manpath.config       sudoers.d
deluser.conf            menu                 su-to-rootrc
depmod.d                menu-methods         sysctl.conf
dhcp                    mercurial            sysctl.d
dhcp3                   mime.types           systemd
dictionaries-common     mke2fs.conf          terminfo
doc-base                modprobe.d           texmf
dpkg                    modules              thunderbird
emacs                   mono                 timezone
emacs23                 motd                 tpvmlp.conf
environment             mtab                 ts.conf
firefox                 mtab.fuselock        ucf.conf
fonts                   mtools.conf          udev
foomatic                nanorc               ufw
fstab                   netscsid.conf        updatedb.conf
fstab.d                 network              update-manager
fuse.conf               NetworkManager       update-motd.d
gadmin-samba            networks             update-notifier
gai.conf                newt                 UPower
gconf                   nsswitch.conf        usb_modeswitch.conf
gdb                     obex-data-server     usb_modeswitch.d
ghostscript             ODBCDataSources      vdpau_wrapper.cfg
ginn                    odbc.ini             vim
gnome                   odbcinst.ini         vmware-tools
gnome-app-install       openal               vtrgb
gnome-settings-daemon   opt                  wgetrc
gnome-vfs-2.0           os-release           wireshark
groff                   pam.conf             wodim.conf
group                   pam.d                wpa_supplicant
group-                  papersize            X11
grub.d                  passwd               xdg
gshadow                 passwd-              xinetd.conf
gshadow-                pcmcia               xinetd.d
gtk-2.0                 perl                 xml
gtk-3.0                 php5                 xul-ext
hdparm.conf             pkcs11               zsh_command_not_found
host.conf               pm
hostname                pnm2ppa.conf



===================================================================

修改/etc/xinetd.conf 的配置文件


root@Ubuntu32:/home/zhangbin# cat /etc/xinetd.conf 
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/


defaults
{


# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info


}


includedir /etc/xinetd.d
root@Ubuntu32:/home/zhangbin# 


配置板子用开发环境-之 配置tftp 和tftpd_第1张图片


tftp dgram  udp  wait  root  /usr/sbin/in.tftpd  /usr/sbin/in.tfptd  -s /tftproot

====================================================

root@Ubuntu32:/home/zhangbin# file /usr/sbin/in.tftpd 
/usr/sbin/in.tftpd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, BuildID[sha1]=0xbc4d185c104c7860a9fa23e417a17640dfc5ca37, stripped
root@Ubuntu32:/home/zhangbin# 


====================================

配置板子用开发环境-之 配置tftp 和tftpd_第2张图片



/etc/init.d 目录下有个xinetd 的连接


root@Ubuntu32:/etc/xinetd.d# cd /etc/xinetd.d/


这是个连接

root@Ubuntu32:/etc# cd  init.d
root@Ubuntu32:/etc/init.d# file xinetd
xinetd: symbolic link to `/lib/init/upstart-job'
root@Ubuntu32:/etc/init.d# 



root@Ubuntu32:/etc/init.d# ./xinetd 
Usage: ./xinetd COMMAND
root@Ubuntu32:/etc/init.d# 


====================================================

root@Ubuntu32:/etc/init.d# ./xinetd --help
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service xinetd --help


The script you are attempting to invoke has been converted to an Upstart
job, but --help is not supported for Upstart jobs.
root@Ubuntu32:/etc/init.d# ./xinetd 




root@Ubuntu32:/etc/init.d# ./xinetd reload
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service xinetd reload


Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the reload(8) utility, e.g
.
reload xinetd
root@Ubuntu32:/etc/init.d# 



重启xinetd:

root@Ubuntu32:/etc/init.d# reload xined
reload: Unknown job: xined
root@Ubuntu32:/etc/init.d# reload xinetd
root@Ubuntu32:/etc/init.d# 


=======================================================

测试

tftp> send xinetd
?Invalid command
tftp> help
?Invalid command
tftp> h
?Invalid command
tftp> q
root@Ubuntu32:/etc/init.d# touch /tftproot/tttt
root@Ubuntu32:/etc/init.d# tftp 127.0.0.1
tftp> get tttt
tftp> q
root@Ubuntu32:/etc/init.d# ls


参考http://blog.csdn.net/wangpengqi/article/details/8453216

参考飞凌嵌入式的教程





======================20131029============

samba挂载远程主机的文件夹

http://blog.csdn.net/commshare/article/details/13507019



============================================

你可能感兴趣的:(Android)