ubantu16.04权限不够2.04tftp配置不成功怎么回事

ubuntu 12.04环境下(10)
需要安装的服务:
1.远程登录:方式1-VNC:1.1安装VNC
Server:apt-get install vnc4server
& & & & & & & & & & & & & & & & & & & & & & & & 1.2启动VNC
Server服务器:vnc4server
& & & & & & & & & & & & & & & 1.3&用VNC
Client端软件连接:除了一个终端啥都没有
& & & & & & & & & & & & & & & & & &1.4开始配置远程桌面参数,先Kill远程桌面的进程:vnc4server
& & & & & & & & & & & & & & & & & & & &&打开配置文件:cat
& & & & & & & & & & & & & & & & & & & & & & & &1.5重新连接VNC
& & & & & & & & & & 方式2-putty:sudo apt-get install openssh-server
2.windows和linux互传文件:
& & & & & & & & & & & &方式1-winscp514:ssh
& & & & & & & & & & & & & & & & & &1.检查是否安装 & $ssh localhost ssh
& & & & & & & & & & & & & & & & & &2.安装 & $sudo apt-get install openssh-server
& & & & & & & & & & & & & & & & & & & & & & & &(若失败,可 $sudo apt-get update 然后执行&$sudo apt-get install openssh-server,若果需要依赖文件 $sudo apt-get install openssh-client=1:5.9p1-5ubuntu1)
& & & & & & & & & & & &方式2-smb
3.TFTP与NFS服务器配置:
& & &3.1 tftp& & &
& & & & &3.1.1安装tftp-hpa&& tftpd-hpa& xinetd
& & & & & & & & &apt-get install tftp-hpa tftpd-hpa xinetd
& & & & &3.1.2在创建文件夹/tftpboot& (我装在主目录下的)
& & & & & & & & & 修改权限chmod -R 777 /tftpboot& & &&
& & & & & 3.1.3修改tftp配置文件,如果没有就创建
& & & & & & & & & #sudo vi& /etc/xinetd.d/tftp
& & & & & & & & &&
& & & & & &&3.1.4.修改inetd.conf文件
& & & & & & & & & & #sudo &vim /etc/inetd.conf
& & & & & & & & & & &&tftp& dgram&&& udp&&& wait&&& nobody&&& /usr/sbin/tcpd &/usr/sbin/in.tftpd&& /tftpboot(tftp共享目录)
& & & & & & &
& & & & & &3.1.5修改tftpd-hpa文件
& & & & & & & & &# sudo vim /etc/default/tftpd-hpa
& & & & & & & & &&
& & & & & &&
& & & & & & &3.1.6在/tftpboot下创建测试文件1.c &test
& & & & & & & & & & #cd /tftpboot
& & & & & & & & & & #touch xxx
& & & & & & 测试一下 tftp服务:
& & & & & & & &#sudo tftp 192.168.1.100
& & & & & & & & & & &tftp&get test
& & & & & & & & & & &tftp&q
& & & & & & & #ls
& & & & & windows测试
& & & & & & &
& & & & & &
& & & & &3.2 NFS
& & & & &3.2.1&$sudo apt-get
install nfs-kernel-server
3.2.2配置/etc/exports
vim /etc/exports
*(rw,sync,no_root_squash)
3.2.3nfs重启服务
service portmap restart
$sudo service nfs-kernel-server restart
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:5531次
排名:千里之外
转载:35篇
(2)(7)(6)(2)(2)(8)(13)(1)>Tcp_wrapper-->>PAM-->>SElinux-->>FTPService-->> File.
First Check if the given user is blocked or not in
/etc/vsftpd/ftpusers
/etc/vsftpd/user_list
Check SElinux Context or Boolean for the Same.
Check in PAM directory
/etc/pam.d/vsftpd
pam_shells.so
if user is not having required shell like in
/etc/shells
then it will give same error
check getent passwd username
match given shell with /etc/shells.
Try to first login to the FTP through firefox or a browser, so you are sure to get a response why you are not able to log in.
This is just as a precausion to confirm if it is the login credentials itself or not.
It seems that current pam configuration for vsftp includes a requirement to have a valid shell something you want to avoid in case of an FTP user.
# Standard behaviour for ftpd(8).
pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
# Note: vsftpd handles anonymous logins on its own. Do not enable pam_ftp.so.
# Standard pam includes
@include common-account
@include common-session
@include common-auth
pam_shells.so
The only thing you have to do is to comment last line auth
pam_shells.so. So this is no required.
Or add a login to all your ftp users.
Changing the name as suggested in the other comment is no point as you loose the deny file.
If running an amd64 kernel, you will need to add the following to your /etc/vsftpd/vsftpd.conf
seccomp_sandbox=NO
1,99931024
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .25478
Ubuntu and Canonical are registered trademarks of Canonical Ltd.
Ask Ubuntu works best with JavaScript enabled1634人阅读
嵌入式学习---mini2440(24)
虽然ubuntu/centos/redhat都是linux,但是内核其中存在一定的修改,所以对于tftp服务器的安装存在不同的命令。在这里由于自己安装的是ubuntu&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& (其中redhat,采用rpm方式安装)
安装tftp-hpa&& tftpd-hpa& xinetd
sudo apt-get install tftp-hpa tftpd-hpa xinetd
在根目录下创建文件夹/tftpboot/root
修改目录权限chmod -R 777 /tftpboot/root
&修改tftp配置文件,如果没有就创建
#vim /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 /tftpboot/root
&&&&&&&&&&&& source&&&&&&&&& = 11
&&&&&&&&&&&& cps&&&&&&&&&&&& = 100 2
&&&&&&&&&&&& flags =IPv4
&&&&&&&& }
修改inetd.conf文件
# vim /etc/inetd.conf
&tftp& dgram&&& udp&&& wait&&& nobody&&& /usr/sbin/tcpd
&/usr/sbin/in.tftpd&& /tftpboot/root
其中/tftpboot/root为 tftp共享目录
修改tftpd-hpa文件
# vim /etc/default/tftpd-hpa
#RUN_DAEMON=&no&
#OPTIONS=&-s /tftpboot/root -c -p -U tftpd&
TFTP_USERNAME=&tftp&
TFTP_DIRECTORY=&/tftpboot/root&
TFTP_ADDRESS=&0.0.0.0:69&
TFTP_OPTIONS=&-l -c -s&
在/tftpboot/root下创建测试文件xxx
&在测试之前要先启动服务器:
方法有两种:
1.service xinetd restart
2./etc/init.d/xinetd restart
#cd /tftpboot/root
#touch xxx
#chmod 777 xxx
测试一下 tftp服务:
#tftp 127.0.0.1
tftp&get xxx
查看当前目录,发现xxx文件已在当前目录
如果上述设置还不行的话,那么就要把selinux禁用掉:
#vim /etc/selinux/config&&&&& //如果没有selinux/config这个文件,则创建。
# This file controls the state of SELinux 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测试。
开发板测试:
此外,确保/tftpboot目录存在,而且有访问权限(至少应该&dr-xr-xr-x&)。
或者把disable = yes 改为 disable = no
这样就已经打开了主机linux中的tftp服务。下面我们可以用uboot的tftp命令来传输文件到目标板的ram中运行。
我们在目标板用命令printenv查看ip地址。
serverip 192.168.2.1 //主机ip,也就是eth0,因为pc和开发板连接默认是以太网
ipaddr 192.168.2.10& //目标机也就是开发板的ip
setenv命令可以修改主机和目标机的ip地址。
#setenv serverip&<span style="color:#2.168.2.1 & //该命令可设置主机ip,该命令只是把设置保存到ram中,如果重启的话设置会重新回到原来的设置。这时我们用saveenv命令把设置保存到flash中。
配置好各个参数后,我们在uboot命令窗口中使用tftp命令把内核,文件系统拷贝到ram中。
首先 ping 192.168.2.1如果成功就进行下载,不过在ping以前需要在终端设置号eth0:sudo ifconfig eth0 192.168.2.1 netmask 255.255.255.0 up
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
zImage& //在主机 /tftpboot目录中的zImage文件下载到目标板内存的地址中。
参考内容:/hicjiajia/archive//2583683.html
对于ip设置详见:/view/490a9a07de80d4d8d15a4f5a.html
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:884336次
积分:11254
积分:11254
排名:第1100名
原创:298篇
评论:162条
文章:15篇
阅读:10188
文章:13篇
阅读:33103
阅读:6883
(17)(2)(1)(1)(1)(2)(4)(6)(22)(3)(1)(7)(10)(9)(1)(4)(1)(4)(1)(4)(14)(30)(27)(5)(40)(15)(11)(11)(6)(16)(7)(5)(10)(4)(1)(4)博客访问: 6793592
博文数量: 555
注册时间:
认证徽章:
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Linux
FTP和TFTP是我们经常使用的文件传输协议。在Linux中,sftp协议由于其安全性的优点,被作为默认的链接协议。但是,一些场合下,我们依然需要使用ftp和tftp协议进行文件传输。本篇主要介绍配置方法,供有需要的朋友待查。
1、 环境准备
我们选择Linux 2.6内核进行测试。
[root@SimpleLinuxUp ~]# uname -r
2.6.18-128.el5
当前OS运行在level 3模式下。
[root@SimpleLinuxUp ~]# grep init /etc/inittab
# inittab&&&&&& This file describes how the INIT process should set up
#&& 0 - halt (Do NOT set initdefault to this)
#&& 6 - reboot (Do NOT set initdefault to this)
id:3:initdefault:
# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit
默认情况下,tftp服务器包是安装上的,而FTP服务器没有安装。
[root@SimpleLinuxUp Server]# rpm -qa | grep ftp
tftp-server-0.42-3.1
ftp-0.17-35.el5
lftp-3.5.1-2.fc6
2、TFTP服务器安装配置
TFTP是一种比较特殊的文件传输协议。相对于FTP和目前经常使用的SFTP,TFTP是基于TCP/IP协议簇,用于进行简单文件传输,提供简单、低开销的传输服务。TFTP的端口设置为69。
相对于常见的FTP,TFTP有两个比较好的优势:
ü& TFTP基于UDP协议,如果环境中没有TCP协议,是比较合适的;
ü& TFTP执行和代码占用内存量比较小;
默认情况下,Linux内部是安装了tftp服务器包的。但是默认是不启动的。
[root@SimpleLinuxUp ~]# chkconfig --list tftp
tftp&&&&&&&&&& &off
启用和禁用tftp服务是通过配置文件/etc/xinetd.d/tftp,将其中参数设置。
[root@SimpleLinuxUp ~]# vi /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#&&&&&& protocol.& The tftp protocol is often used to boot diskless \
#&&&&&& workstations, download configuration files to network-aware printers, \
#&&&&&& and to start the installation process for some operating systems.
service tftp
&&&&&&& socket_type&&&&&&&&& &&&= dgram
&&&&&&& protocol&&&&&&&&&&&&&&& = udp
&&&&&&& wait&&&&&&&&&&&&&&&&&&& = yes
&&&&&&& user&&&&&&&&&&&&&&&&&&& = root
&&&&&&& server&&&&&&&&&&&&&&&&& = /usr/sbin/in.tftpd
&&&&&&& server_args&&&&&&&&&&&& = -s /tftpboot -c
&&&&&&& disable&&&&&&&&&&&&&&&& = no
&&&&&&& per_source&&&&&&&&&&&&& = 11
&&&&&&& cps&&&&&&&&&&&&&&&&&&&& = 100 2
&&&&&&& flags&&&&&&&&&&&&&&&&&& = IPv4
配置文件中,将disable默认值从yes改为no。适当修改server_args参数,主要是其中的tftp根目录地址。
Tftp服务是不需要单独启动的,是作为xinetd服务的一个附属对象连带启动。
[root@SimpleLinuxUp ~]# service xinetd status
xinetd (pid 2194) is running...
[root@SimpleLinuxUp ~]# cd /
[root@SimpleLinuxUp /]# mkdir /tftpboot
mkdir: cannot create directory `/tftpboot': File exists
[root@SimpleLinuxUp /]# cd /tftpboot/
[root@SimpleLinuxUp tftpboot]# cd ..
[root@SimpleLinuxUp /]# chmod -R 777 /tftpboot/
由于连接使用UDP端口,我们将防火墙和SELinux配置关闭。
[root@SimpleLinuxUp /]# service iptables stop
[root@SimpleLinuxUp /]# service iptables status
Firewall is stopped.
对xinetd服务重启,连带将tftp服务启动。
[root@SimpleLinuxUp /]# service xinetd restart
Stopping xinetd: [& OK& ]
Starting xinetd: [& OK& ]
[root@SimpleLinuxUp /]# chkconfig --list tftp
tftp&&&&&&&&&&& on
使用netstat判断UDP端口开启。
[root@SimpleLinuxUp /]# netstat -nlp | grep udp
udp&&&&&&& 0&&&&& 0 0.0.0.0:772&&&&&&&&&&&&&&&& 0.0.0.0:*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 1868/rpc.statd&&&&&
udp&&&&&&& 0&&&&& 0 0.0.0.0:775&&&&&&&&&&&&&&&& 0.0.0.0:*&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&1868/rpc.statd&&&&&
udp&&&&&&& 0&&&&& 0 0.0.0.0:69&&&&&&&&&&&&&&&&& 0.0.0.0:*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3869/xinetd&&&&&&&&
(篇幅原因,有省略……)
从远程服务器启动连接,笔者从windows环境客户端启动。TFTP是可以不输入用户名和密码的,所以对于安全文件传输是不满足的。
C:\Documents and Settings\liuzy>tftp
Transfers files to and from a remote computer running the TFTP service.
TFTP [-i] host [GET | PUT] source [destination]
& -i&&&&&&&&&&&&& Specifies binary image transfer mode (also called
&&&&&&&&&&&&&&&&& octet). In binary image mode the file is moved
&&&&&&&&&&&&&&&&& literally, byte by byte. Use this mode when
&&&&&&&&&&&&&&&&& transferring binary files.
& host&&&&&&&&&&& Specifies the local or remote host.
& GET&&&&&&&&&&&& Transfers the file destination on the remote host to
&&&&&&&&&&&&&&&&& the file source on the local host.
& PUT&&&&&&&&&&&& Transfers the file source on the local host to
&&&&&&&&&&&&&&&&& the file destination on the remote host.
& source&&&&&&&&& Specifies the file to transfer.
& destination&&&& Specifies where to transfer the file.
测试客户端与服务器根目录之间的文件互相拷贝传输。
C:\Documents and Settings\liuzy>tftp 192.168.0.100 put cogtrwin.ini
Transfer successful: 536 bytes in 1 second, 536 bytes/s
[root@SimpleLinuxUp tftpboot]# ls -l
-rw-rw-rw- 1 nobody nobody& 507 Jan 28 10:39 cogtrwin.ini
drwxrwxrwx 4 root&& root&& 4096 Dec 26 09:46 linux-install
D:\>tftp 192.168.0.100 get cogtrwin.ini
Transfer successful: 536 bytes in 1 second, 536 bytes/s
TFTP是一种简单的文件传输解决方案。
3、FTP配置
目前成熟系统设计中,都将FTP协议和传输定性为非安全传输协议。它和telnet登录方式,逐渐为SFTP和SSH协议所取代。在Linux流行版本中,SFTP已经成为默认配置项目。
在Linux发行版的光盘中,已经包括了vsftp服务器安装包,是需要手工安装。
--判断没有安装vsftp
[root@SimpleLinuxUp ~]# rpm -qa | grep vsftp
加载安装光盘到一个目录中。
[root@SimpleLinuxUp /]# ls -l | grep rdcom
drwxr-xr-x& 2 root&& root&&&&& 4096 Dec 26 10:29 rdcom
[root@SimpleLinuxUp /]# cd rdcom/
[root@SimpleLinuxUp rdcom]# ls -l
[root@SimpleLinuxUp rdcom]# mount /dev/cdrom /rdcom/
mount: block device /dev/cdrom is write-protected, mounting read-only
安装vsftp-server包。
[root@SimpleLinuxUp rdcom]# cd Server/
[root@SimpleLinuxUp Server]# pwd
/rdcom/Server
[root@SimpleLinuxUp Server]# ls -l | grep vsftp
-r--r--r--& 99 root root&& 141003 Dec 17& 2007 vsftpd-2.0.5-12.el5.i386.rpm
[root@SimpleLinuxUp Server]# rpm -ivh vsftpd-2.0.5-12.el5.i386.rpm
warning: vsftpd-2.0.5-12.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID
Preparing...&&&&&&&&&&&&&&& ########################################### [100%]
&& 1:vsftpd&&&&&&&&&&&&&&&& ########################################### [100%]
安装后,vsftpd是没有自动启动的,作为系统服务也不能自动启动。
[root@SimpleLinuxUp Server]# service vsftpd status
vsftpd is stopped
[root@SimpleLinuxUp Server]# chkconfig --list vsftpd
vsftpd&&&&&&&&& 0:off&& 1:off&& 2:off&& 3:off&& 4:off&& 5:off&& 6:off
启动服务,并且配置vsftp服务到适合的level等级。
[root@SimpleLinuxUp Server]# service vsftpd start
Starting vsftpd for vsftpd: [& OK& ]
[root@SimpleLinuxUp Server]# service vsftpd status
vsftpd (pid 4030) is running...
[root@SimpleLinuxUp Server]# chkconfig --level 2345 vsftpd on
[root@SimpleLinuxUp Server]# chkconfig --list vsftpd
vsftpd&&&&&&&&& 0:off&& 1:off&& 2:on&&& 3:on&&& 4:on &&&5:on&&& 6:off
远程从客户端进行访问,直接使用ftp命令行客户端。
ftp> open 192.168.0.100
Connected to 192.168.0.100.
220 (vsFTPd 2.0.5)
User (192.168.0.100:(none)): oracle
331 Please specify the password.
230 Login successful.
注意,处于安全的考虑,并不是所有的用户都可以使用ftp远程连接,比如root。
ftp> open 192.168.0.100
Connected to 192.168.0.100.
220 (vsFTPd 2.0.5)
User (192.168.0.100:(none)): root
530 Permission denied.
Login failed.
如果确实需要root登录,可以修改配置文件/etc/vsftpd/ftpusers和/etc/vsftpd/user_list,将其中的root屏蔽住。就可以支持登录。
[root@SimpleLinuxUp Server]# cat /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftp
[root@SimpleLinuxUp Server]# cat /etc/vsftpd/user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
安装成功。
在Linux、AIX中,很多的配置内容都是命令行+文本配置的方法来实现的。本篇介绍了Linux环境下tftp和ftp的配置手段,留待需要朋友待查。
阅读(23319) | 评论(0) | 转发(1) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。tftp - tftpd-hpa + 12.04 LTS - Ask Ubuntu
to customize your list.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. J it only takes a minute:
Here&#39;s how it works:
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I installed the tftp server using
sudo apt-get install tftpd-hpa
I then created a directory sudo mkdir /home/tftp, changed the owner and permissions
sudo chmod 777 /home/tftp
sudo chown nobody:nogroup /home/tftp
I then changed the /etc/default/tftpd-hpa file and it looks like this:
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --create"
I then restarted the service:
sudo service tftpd-hpa restart
however I am unable to upload or download from the tftp server
I verified that the service is running and here is the output of sudo service tftpd-hpa status:
tftpd-hpa start/running, process 3117
Here are the permissions of the directory:
sudo ls -l /home | grep tftp
drwxrwxrwx
nogroup 4096 Jul
6 16:09 tftp
Any ideas?
your help is much appreciated and thank you in advance!
30.9k1583110
Here is my working one.
There is a workaround for the fore mentioned IPv4 issue.
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftp"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="-4 --secure --create"
The --create allows users to upload without having to do a touch.
4,60893142
I hade the same problem here.
Well, I solved the problem for me :
You can find in the wiki (German wiki!) a chapter about inetd.conf
openbsd-inetd
The Autor is writing about a bug with IPV4 s.o.
Well, the whole inetd service in Ubuntu 12.04 LTS (Desktop version) is missing.
I upgraded my ubuntu with the "openbsd-inetd" service and configure the inetd.conf.
sudo apt-get install openbsd-inetd
sudo nano /etc/inetd.conf
tftp dgram udp4 wait
root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /home/tftp
/etc/init.d/openbsd-inetd restart
Kind regards
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you&#39;re looking for?
Browse other questions tagged
rev .25478
Ubuntu and Canonical are registered trademarks of Canonical Ltd.
Ask Ubuntu works best with JavaScript enabled}

我要回帖

更多关于 ubantu14.04下载 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信