安装 上传 和 下载 ,可以在 软件中心 安装。
搜索tftp-hpa tftpd-hpa
安装 openbsd
sudo apt-get install tftp-hpa
sudo apt-get install tftpd-hpa
sudo apt-get install openbsd-inetd
sudo apt-get install xinetd
去建立一个根目录,然后设置对应的访问属性:
1. mkdir /tftpboot
2. cd /
3. chmod 777 tftpboot/
(a) 在 根目录 下 建立 tftpboot 这个文件夹存放 可以通过ftp协议 传输的文件。注意 该文件夹 及 文件的权限。
(b) chmod 777 就是更改该目录权限 更改配置文件/etc/default/tftpd-hpa
sudo vim /etc/default/tftpd-hpa
去修改配置文件,修改好后,内容如下:
1. # /etc/default/tftpd-hpa
2. RUN_DAEMON="yes"
3. OPTIONS="-l -s -c /tftpboot" 如果是10.04之前的版本 把下面四行注释掉,如果是 10.04以后的含10.04 把上面两行注释掉
4. TFTP_USERNAME="用户名"
5. TFTP_DIRECTORY="/tftpboot"
6. TFTP_ADDRESS="0.0.0.0:69"
7. TFTP_OPTIONS="-l -s -c"
绿色部分是要修改的, OPTIONS="-l -s -c /tftpboot" 绿色部分是 tftpboot 路径, TFTP_USERNAME="用户名" 绿色部分是用户名
TFTP_DIRECTORY="/tftpboot"绿色部分是 路径
OPTIONS="-l -s -c
中的参数含义为:
-l Run the server in standalone (listen) mode, rather than run from inetd. Inlisten mode, the -t option is ignored, and the -a option can be usedto specify a specific local address or port to listen to.
-a [address][:port]
Specify a specific address and port to listen to when called with the -loption. The default is to listen to the tftp port specified in /etc/services onall local addresses.
-c Allow new files to be created. By default, tftpd will only allow upload offiles that already exist. Files are created with default permissions allowinganyone to read or write them, unless the -p or -U options are specified.
-s (决定tftp根目录)Change rootdirectory on startup. This means the remote host does not need to pass alongthe directory as part of the trans-fer, and may add security. When -s isspecified, exactly one directory should be specified on the command line. Theuse of this option is recommended for security as well as compatibility withsome boot ROMs which cannot be easily made to include a directory name in itsrequest.
启动tftp 服务
sudo service tftpd-hpa restart
摘抄博友:
(1)关于重启 某个服务,之前的Linux(Ubuntu是10.10之前)都是这样操作的: