嵌入式 ubuntu12.04下tftp安装、配置、测试
2013-12-02 14:58
495 查看
先说明一下ubuntu默认root是禁用的,所以先要创建root用户,这样以后不用再sudo了:
1.sudo passwd
输入当前用户密码
输入root用户密码
再次确定root用户密码
成功!
su
输入root密码
ok,进入root用户,不用再sudo了!
2.安装tftp-hpa tftpd-hpaxinetd
apt-get install tftp-hpa tftpd-hpaxinetd
3.在创建文件夹/tftpboot(我是装在主目录下的)
修改目录权限chmod -R 777/tftpboot
4.修改tftp配置文件,如果没有就创建
#vi /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /home/zyp/tftpboot (这个看你建在哪!!!!)
source = 11
cps = 100 2
flags =IPv4
}
5.修改inetd.conf文件
# vim /etc/inetd.conf
tftp dgram udp wait nobody/usr/sbin/tcpd
/usr/sbin/in.tftpd /homezyp/tftpboot(tftp共享目录)
6.修改tftpd-hpa文件
# vim /etc/default/tftpd-hpa
#RUN_DAEMON="no"
#OPTIONS="-s /home/zyp/tftpboot -c -p -U tftpd"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/zyp/home/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"
7.在/home/zyp/tftpboot下创建测试文件xxx
#cd /home/zyp/tftpboot
#touch xxx
测试一下 tftp服务:
#cd /home/zyp
#tftp 127.0.0.1
tftp>get xxx
tftp>q
#ls
查看当前目录,发现xxx文件已在当前目录
如果上述设置还不行的话,那么就要把selinux禁用掉:
#vim /etc/selinux/config//如果没有selinux/config这个文件,则创建。
# This file controls the state ofSELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
把上面的SELINUX=enforcing改为:SELINUX=disable 禁用SeLinux
然后reboot重启PC
重启后再进行tftp测试。
1.sudo passwd
输入当前用户密码
输入root用户密码
再次确定root用户密码
成功!
su
输入root密码
ok,进入root用户,不用再sudo了!
2.安装tftp-hpa tftpd-hpaxinetd
apt-get install tftp-hpa tftpd-hpaxinetd
3.在创建文件夹/tftpboot(我是装在主目录下的)
修改目录权限chmod -R 777/tftpboot
4.修改tftp配置文件,如果没有就创建
#vi /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /home/zyp/tftpboot (这个看你建在哪!!!!)
source = 11
cps = 100 2
flags =IPv4
}
5.修改inetd.conf文件
# vim /etc/inetd.conf
tftp dgram udp wait nobody/usr/sbin/tcpd
/usr/sbin/in.tftpd /homezyp/tftpboot(tftp共享目录)
6.修改tftpd-hpa文件
# vim /etc/default/tftpd-hpa
#RUN_DAEMON="no"
#OPTIONS="-s /home/zyp/tftpboot -c -p -U tftpd"
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/zyp/home/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"
7.在/home/zyp/tftpboot下创建测试文件xxx
#cd /home/zyp/tftpboot
#touch xxx
测试一下 tftp服务:
#cd /home/zyp
#tftp 127.0.0.1
tftp>get xxx
tftp>q
#ls
查看当前目录,发现xxx文件已在当前目录
如果上述设置还不行的话,那么就要把selinux禁用掉:
#vim /etc/selinux/config//如果没有selinux/config这个文件,则创建。
# This file controls the state ofSELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
把上面的SELINUX=enforcing改为:SELINUX=disable 禁用SeLinux
然后reboot重启PC
重启后再进行tftp测试。
相关文章推荐
- 嵌入式 netperf2交叉编译
- 嵌入式 简单邮件传输协议(SMTP)
- 嵌入式 RTP通话:视频流(H.264)的传输
- 嵌入式 h264基础以及rtp封包详解
- 嵌入式 php实现文件下载
- 嵌入式 php中使按钮居中处理
- 嵌入式 php中为按钮设置超链接
- 嵌入式 php中select控件当前值的获取
- 嵌入式 php在下拉菜单中显示已经存在用户名
- 嵌入式 php语言中 button onclick 代码的问题
- 嵌入式 php或者html中get和post的区别
- 嵌入式 Source Insight阅读PHP项目的代码的详细配置
- 嵌入式 window下php无法连接到数据库mysql的解决方法
- 嵌入式 ubuntu12.04下配置php开发环境
- 嵌入式 phpwork搭建php环境
- 嵌入式 RSTP交互
- 嵌入式 RTP协议详解以及其他相关协议
- 嵌入式 rtp、rtsp、trcp的区别
- 新安装XAMPP,phpMyAdmin错误:#1045 - Access denied for user 'root'@'localhost' (using password: NO)
- 嵌入式 CRAMFS + YAFFS2文件系统的制作和注意事项