主机 centos5.1
ftp:gssftp
远程主机一样环境
gssftp里修改为如下:
service ftp
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/kerberos/sbin/ftpd
server_args = -l
log_on_failure += USERID
disable = no
}
测试如下:
1直接根目录传
ftp> pwd
257 "/" is current directory.
ftp> put /1t
local: /1t remote: /1t
227 Entering Passive Mode (172,16,4,179,134,188)
553 /1t: Permission denied.
2传到另一主机/tmp下
226 Transfer complete.
ftp> pwd
257 "/tmp" is current directory.
ftp> put /oracle.tar
local: /oracle.tar remote: /oracle.tar
227 Entering Passive Mode (172,16,4,179,198,221)
553 /oracle.tar: Permission denied.
3在/tmp/下传到另一主机的/tmp/下
ftp> put /tmp/1t
local: /tmp/1t remote: /tmp/1t
227 Entering Passive Mode (172,16,4,179,149,202)
150 Opening BINARY mode data connection for /tmp/1t.
226 Transfer complete.
5 bytes sent in 0.0003 seconds (16 Kbytes/s)
开始以为(root用户登录)ftp上传以ftp用户读取文件再传送
如下测试:
[root@yao1 /]# ll
total 162
-rw-r--r-- 1 ftp ftp 5 May 13 14:27 1t
drwxr-xr-x 2 root root 4096 May 12 09:53 bin
ftp> put /1t
local: /1t remote: /1t
227 Entering Passive Mode (172,16,4,179,152,62)
553 /1t: Permission denied.
ftp> pwd
257 "/" is current directory.
ftp> cd /tmp
250 CWD command successful.
ftp> pwd
257 "/tmp" is current directory.
ftp> put /1t
local: /1t remote: /1t
227 Entering Passive Mode (172,16,4,179,183,198)
553 /1t: Permission denied.
结果是:linux gssftp上传不能传/目录上的文件
晚上又测试了:
结果如下
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put /1t /tmp/1t
local: /1t remote: /tmp/1t
227 Entering Passive Mode (172,16,4,179,48,36)
150 Opening BINARY mode data connection for /tmp/1t.
226 Transfer complete.
6 bytes sent in 0.00028 seconds (21 Kbytes/s)
说明只要上传后的路径有绝对路径和文件名一定行的。如上面的我设上传路径和文件名为/tmp/1t就ok了。
所以gssftp只要put 之后源地址 目标地址正确,不要缺省的认为你ftp后用cd 进入目录,然后和windows一样put 在源文件之后一定放在刚才你cd进来的目录,linux 这个上传需要设置目标地址的绝对路径,不是你cd进入一个目录就行。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22608279/viewspace-662621/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22608279/viewspace-662621/