现在的位置: 首页 > 综合 > 正文

【Android-tools】Install TFTP,NFS,Samba,SSH(Based on Ubuntu9.04)

2013年08月04日 ⁄ 综合 ⁄ 共 2845字 ⁄ 字号 评论关闭

TFTP installation and setting

Trivial File Transfer Protocol (TFTP) is a file transfer protocol, with the functionality of a very basic form of File Transfer Protocol (FTP). You may use this tool to download your kernel and filesystem image to your target board.

1. Install tftpd and related packages.

$ sudo apt-get install xinetd tftpd tftp

You can also install these software through System->Administraion->Synaptic Package Manager

2. Create /etc/xinetd.d/tftp and put this entry:

$ sudo vim tftp

   service tftp

   {

   socket_type = dgram

   protocol = udp

   wait = yes

   user = root

   server = /usr/sbin/in.tftpd

   server_args = -s /tftpboot

   disable = no

   per_source = 11

   cps = 100 2

   flags = IPv4

   }

3. Make /tftpboot directory

$ sudo mkdir /tftpboot

$ sudo chmod -R 777 /tftpboot

$ sudo chown -R nobody /tftpboot

4. Start tftpd through xinetd

$ sudo /etc/init.d/xinetd restart

5. Testing. Tranfering file hda.txt from 192.168.1.100 (Client using tftp) to 192.168.1.100 (Server 192.168.1.100). Get an example file to transfer (eg. hda.txt)

$ touch /tftpboot/hda.txt

$ chmod 777 /tftpboot/hda.txt

$ ls -l /tftpboot/

total 0

-rwxrwxrwx 1 magicyu magicyu 0 2009-08-27 23:04 hda.txt

$ tftp 192.168.1.100

tftp> put hda.txt

Sent 722 bytes in 0.0 seconds

tftp> quit

$ ls -l /tftpboot/

total 4

-rwxrwxrwx 1 magicyu magicyu 707 2009-08-27 23:07 hda.txt

NFS installation and setting

NFS stands for Network File System, a file system developed by Sun Microsystems, Inc. It is a client/server system that allows users to access files across a network and treats them as if they resided in a local file directory. You may use this tool to mount the net file system located on your development machine through your target board.

1. Install nfs and related packages.

$ sudo apt-get install nfs-kernel-server nfs-common portmap

You can also install these software through System->Administraion->Synaptic Package Manager

2. Add nfs path to /etc/exports:

$ sudo vim /etc/exports

Add a line

For example: /home/nfs *(rw,sync,no_root_squash)

1.      Start NFS

$ sudo /etc/init.d/nfs-kernel-server restart

2.      Testing

$ sudo mount –t nfs 127.0.0.1:/home/nfs  /mnt

Note: if you modify /etc/export, please use $ sudo exportfs –r to renew. And use $ sudo /etc/init.d/nfs-kernel-server to restart the nfs service.

Samba installation and setting

Samba is a popular freeware program that allows end users to access and use files, printers, and other commonly shared resources on a company's intranet or on the Internet.

1. Install samba and related packages.

$ sudo apt-get install samba-common

You can also install these software through System->Administraion->Synaptic Package Manager

2. configure /etc/samba/smb.conf

$ sudo vim /etc/samba/smb.conf

Note: you can follow the instruction in the smb.conf

  1 [global]
  2
  3 workgroup = Magic
  4 server string=SmabaServer
  5 security=share
  6 guest ok=yes
  7
  8 [MagicYu]
  9 path=/home/samba
 10 browseable=yes
 11 writeable=yes
 12
 13 [autobuild]
 14 path=/autobuild
 15 browseable=yes
 16 writeable=yes

3. Start samba

$ sudo /etc/init.d/samba restart

4. Test samba

You can login a Window PC, run->//10.38.164.137(Your IP address)

Ssh installation

1. Install ssh and related packages.

$ sudo apt-get install ssh

You can also install these software through System->Administraion->Synaptic Package Manager

抱歉!评论已关闭.