阿里云Linux下进行FTP设置

login as: root
[email protected]‘s password:
Last login: Fri Jul 25 21:53:25 2014 from 125.112.89.75


Welcome to aliyun Elastic Compute Service!


[root@iZ232dsevumZ ~]# rmp -qa|grep vsftpd
-bash: rmp: command not found
[root@iZ232dsevumZ ~]# cd /etc/yum.repos.d/
[root@iZ232dsevumZ yum.repos.d]# cd /
[root@iZ232dsevumZ /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 20G 1.3G 18G 7% /
tmpfs 503M 0 503M 0% /dev/shm
[root@iZ232dsevumZ /]# fdisk -l


Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000702c2


Device Boot Start End Blocks Id System
/dev/xvda1 * 1 2611 20970496 83 Linux


Disk /dev/xvdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xecf34547


Device Boot Start End Blocks Id System
/dev/xvdb1 1 1305 10481388+ 7 HPFS/NTFS
[root@iZ232dsevumZ /]# cat /etc/fstab


#
# /etc/fstab
# Created by anaconda on Thu Jul 3 10:43:49 2014
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk‘
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=03da1dcd-6e56-464b-bc7c-331e8fc967ce / ext4 defaults,barrier=0 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
none /proc/xen xenfs defaults 0 0
[root@iZ232dsevumZ /]# echo ‘/dev/xvdb1 /mnt ext3 defaults 0 0‘ >> /etc/fstab
[root@iZ232dsevumZ /]# cat /etc/fstab


#
# /etc/fstab
# Created by anaconda on Thu Jul 3 10:43:49 2014
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk‘
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=03da1dcd-6e56-464b-bc7c-331e8fc967ce / ext4 defaults,barrier=0 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
none /proc/xen xenfs defaults 0 0
/dev/xvdb1 /mnt ext3 defaults 0 0
[root@iZ232dsevumZ /]# mount -a
[root@iZ232dsevumZ /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 20G 1.3G 18G 7% /
tmpfs 503M 0 503M 0% /dev/shm
/dev/xvdb1 9.9G 151M 9.2G 2% /mnt
[root@iZ232dsevumZ /]# yum -y install yum-fastestmirror
Loaded plugins: security
base | 3.7 kB 00:00
base/primary_db | 3.5 MB 00:00
epel | 4.4 kB 00:00
epel/primary_db | 5.2 MB 00:01
extras | 3.4 kB 00:00
extras/primary_db | 18 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.5 MB 00:00
Setting up Install Process
Package yum-plugin-fastestmirror-1.1.30-17.el6_5.noarch already installed and la test version
Nothing to do
[root@iZ232dsevumZ /]# yum -y install vsftpd
Loaded plugins: security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.i686 0:2.2.2-11.el6_4.1 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
vsftpd i686 2.2.2-11.el6_4.1 base 157 k


Transaction Summary
================================================================================
Install 1 Package(s)


Total download size: 157 k
Installed size: 344 k
Downloading Packages:
vsftpd-2.2.2-11.el6_4.1.i686.rpm | 157 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : vsftpd-2.2.2-11.el6_4.1.i686 1/1
Verifying : vsftpd-2.2.2-11.el6_4.1.i686 1/1


Installed:
vsftpd.i686 0:2.2.2-11.el6_4.1


Complete!
[root@iZ232dsevumZ /]# useradd -d /alidata/www/wwwroot -s /sbin/nologin pwftp
useradd: cannot create directory /alidata/www/wwwroot
[root@iZ232dsevumZ /]# ^C
[root@iZ232dsevumZ /]# bash update_source.sh
bash: update_source.sh: No such file or directory
[root@iZ232dsevumZ /]# cd /
[root@iZ232dsevumZ /]# ps -ef |grep vsftpd
root 2759 943 0 23:06 pts/0 00:00:00 grep vsftpd
[root@iZ232dsevumZ /]# vim /etc/vsftpd/vsftpd.conf
[root@iZ232dsevumZ /]# chkconfig --list
abrt-ccpp 0:off 1:off 2:off 3:off 4:off 5:off 6:off
abrtd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
acpid 0:off 1:off 2:off 3:off 4:off 5:off 6:off
aegis 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
auditd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
blk-availability 0:off 1:on 2:off 3:off 4:off 5:off 6:off
cpuspeed 0:off 1:on 2:off 3:off 4:off 5:off 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
gshelld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
haldaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ip6tables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
irqbalance 0:off 1:off 2:off 3:off 4:off 5:off 6:off
kdump 0:off 1:off 2:off 3:off 4:off 5:off 6:off
lvm2-monitor 0:off 1:on 2:off 3:off 4:off 5:off 6:off
mdmonitor 0:off 1:off 2:off 3:off 4:off 5:off 6:off
messagebus 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nscd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off
postfix 0:off 1:off 2:off 3:off 4:off 5:off 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rngd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
svnserve 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off
udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off
vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@iZ232dsevumZ /]# chkconfig --level 35 vsftpd on
[root@iZ232dsevumZ /]# chkconfig --list
abrt-ccpp 0:off 1:off 2:off 3:off 4:off 5:off 6:off
abrtd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
acpid 0:off 1:off 2:off 3:off 4:off 5:off 6:off
aegis 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
auditd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
blk-availability 0:off 1:on 2:off 3:off 4:off 5:off 6:off
cpuspeed 0:off 1:on 2:off 3:off 4:off 5:off 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
gshelld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
haldaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ip6tables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
irqbalance 0:off 1:off 2:off 3:off 4:off 5:off 6:off
kdump 0:off 1:off 2:off 3:off 4:off 5:off 6:off
lvm2-monitor 0:off 1:on 2:off 3:off 4:off 5:off 6:off
mdmonitor 0:off 1:off 2:off 3:off 4:off 5:off 6:off
messagebus 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nscd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off
postfix 0:off 1:off 2:off 3:off 4:off 5:off 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rngd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
svnserve 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off
udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off
vsftpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@iZ232dsevumZ /]# cd /alidata/
-bash: cd: /alidata/: No such file or directory
[root@iZ232dsevumZ /]# cd /alidatal/
-bash: cd: /alidatal/: No such file or directory
[root@iZ232dsevumZ /]# cd /alidata1/
-bash: cd: /alidata1/: No such file or directory
[root@iZ232dsevumZ /]# mkdir alidata
[root@iZ232dsevumZ /]# cd /alidata
[root@iZ232dsevumZ alidata]# useradd ftpadmin -s /sbin/nologin -d /alidata/www/
[root@iZ232dsevumZ alidata]# passwd ftpadmin
Changing password for user ftpadmin.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
[root@iZ232dsevumZ alidata]# ls -lrth
total 4.0K
drwx------ 2 ftpadmin ftpadmin 4.0K Jul 25 23:23 www
[root@iZ232dsevumZ alidata]# chown ftpadmin www
[root@iZ232dsevumZ alidata]# ls -lrth
total 4.0K
drwx------ 2 ftpadmin ftpadmin 4.0K Jul 25 23:23 www
[root@iZ232dsevumZ alidata]# servivc vsftpd start
-bash: servivc: command not found
[root@iZ232dsevumZ alidata]# service vsftpd start
Starting vsftpd for vsftpd: [ OK ]
[root@iZ232dsevumZ alidata]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:0B:B2
inet addr:10.171.209.74 Bcast:10.171.215.255 Mask:255.255.248.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10654 errors:0 dropped:0 overruns:0 frame:0
TX packets:622 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:470723 (459.6 KiB) TX bytes:50486 (49.3 KiB)
Interrupt:164


eth1 Link encap:Ethernet HWaddr 00:16:3E:00:2A:40
inet addr:121.40.82.40 Bcast:121.40.83.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2096734 errors:0 dropped:0 overruns:0 frame:0
TX packets:6385 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:101173604 (96.4 MiB) TX bytes:496775 (485.1 KiB)
Interrupt:163


lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


[root@iZ232dsevumZ alidata]# ^C
[root@iZ232dsevumZ alidata]# 121.40.82.40^C
[root@iZ232dsevumZ alidata]# ^C
[root@iZ232dsevumZ alidata]#

 

以为步骤完成后,就可以以ftpadmin帐户名链接服务器的FTP了,

转载原文地址: http://bbs.aliyun.com/read/165377.html?fpage=3

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。