#由于dpi项目目前阶段的需要,再配置个ftp用户,然后再写监控脚本,使用sendmail发送邮件通知。11:00 2012/1/31
- [root@admin ~]# useradd --help
-
Usage: useradd [options] LOGIN
-
-
Options:
-
-b, --base-dir BASE_DIR base directory for the new user account
-
home directory
-
-c, --comment COMMENT set the GECOS field for the new user account
-
-d, --home-dir HOME_DIR home directory for the new user account
-
-D, --defaults print or save modified default useradd
-
configuration
-
-e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-
-f, --inactive INACTIVE set password inactive after expiration
-
to INACTIVE
-
-g, --gid GROUP force use GROUP for the new user account
-
-G, --groups GROUPS list of supplementary groups for the new
-
user account
-
-h, --help display this help message and exit
-
-k, --skel SKEL_DIR specify an alternative skel directory
-
-K, --key KEY=VALUE overrides /etc/login.defs defaults
-
-m, --create-home create home directory for the new user
-
account
-
-l, do not add user to lastlog database file
-
-M, do not create user's home directory(overrides /etc/login.defs)
-
-r, create system account
-
-o, --non-unique allow create user with duplicate
-
(non-unique) UID
-
-p, --password PASSWORD use encrypted password for the new user
-
account
-
-s, --shell SHELL the login shell for the new user account
-
-u, --uid UID force use the UID for the new user account
-
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
- [root@admin ~]# usermod --help
- Usage: usermod [options] LOGIN
- Options:
- -a, --append append the user to the supplemental GROUPS
- (use only with -G)
- -c, --comment COMMENT new value of the GECOS field
- -d, --home HOME_DIR new home directory for the user account
- -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
- -f, --inactive INACTIVE set password inactive after expiration
- to INACTIVE
- -g, --gid GROUP force use GROUP as new primary group
- -G, --groups GROUPS new list of supplementary GROUPS
- -h, --help display this help message and exit
- -l, --login NEW_LOGIN new value of the login name
- -L, --lock lock the user account
- -m, --move-home move contents of the home directory to the new
- location (use only with -d)
- -o, --non-unique allow using duplicate (non-unique) UID
- -p, --password PASSWORD use encrypted password for the new password
- -s, --shell SHELL new login shell for the user account
- -u, --uid UID new UID for the user account
- -U, --unlock unlock the user account
- -Z, --selinux-user new selinux user mapping for the user account
- [root@admin ~]#
-
-
[root@admin ~]# useradd -g ftp -M -s /sbin/nologin -d /yk/changshang/royal/ -l royal
[root@admin ~]# useradd -g ftp -d /yk/dpipaiqi -s /sbin/nologin paiqibiao
[root@admin ~]# passwd paiqibiao
Changing password for user paiqibiao.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@admin ~]#
#修改/etc/vsftpd/vsftpd.conf,设置chroot,anonymous,userlist。
[root@admin vsftpd]# service vsftpd restart
关闭 vsftpd: [确定]
为 vsftpd 启动 vsftpd: [确定]
[root@admin vsftpd]#
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>ftp 61.*.***.132
连接到 61.*.***.132。
220 (vsFTPd 2.0.5)
用户(61.*.***.132:(none)): paiqibiao
331 Please specify the password.
密码:
500 OOPS: cannot change directory:/yk/dpipaiqi
500 OOPS: child died
远程主机关闭连接。
[root@admin /]# ll |grep yk
drwx------ 7 yangkai root 4096 01-31 10:35 yk
[root@admin /]# chmod +x yk/
[root@admin /]# ll |grep yk
drwx--x--x 7 yangkai root 4096 01-31 10:35 yk
[root@admin /]#
C:\Users\Administrator>ftp 61.*.***.132
连接到 61.*.***.132。
220 (vsFTPd 2.0.5)
用户(61.*.***..132:(none)): paiqibiao
331 Please specify the password.
密码:
230 Login successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
[root@admin ~]# cp /etc/vsftpd/vsftpd.conf /yk/dpipaiqi/
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
vsftpd.conf
226 Directory send OK.
ftp: 收到 13 字节,用时 0.00秒 13.00千字节/秒。
ftp> get vsftpd.conf
200 PORT command successful. Consider using PASV.
550 Failed to open file.
[root@admin ~]# chmod 777 /yk/dpipaiqi/vsftpd.conf
ftp> get vsftpd.conf
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for vsftpd.conf (4648 bytes).
226 File send OK.
ftp: 收到 4648 字节,用时 0.00秒 4648.00千字节/秒。
ftp>
[root@admin ~]# cd /yk/dpipaiqi/vsftpd.conf
-bash: cd: /yk/dpipaiqi/vsftpd.conf: 不是目录
[root@admin ~]# cd /yk/dpipaiqi/
[root@admin dpipaiqi]# mv vsftpd.conf vsftpd.conf.bak
[root@admin /]# echo $LANG
zh_CN.UTF-8
[root@admin /]#
ftp> put vsftpd.conf
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
ftp: 发送 4648 字节,用时 0.02秒 193.67千字节/秒。
ftp>
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
vsftpd.conf
vsftpd.conf.bak
226 Directory send OK.
ftp: 收到 30 字节,用时 0.00秒 30.00千字节/秒。
ftp> cd ..
250 Directory successfully changed.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-r--r-- 1 507 50 4648 Jan 31 02:44 vsftpd.conf
-rwxrwxrwx 1 0 0 4648 Jan 31 02:42 vsftpd.conf.bak
226 Directory send OK.
ftp: 收到 142 字节,用时 0.00秒 71.00千字节/秒。
ftp> quit
221 Goodbye.
C:\Users\Administrator>
#ok,测试完成,配置结束。
----------------------------------------------------------------------------------------------
find用法
阅读(3960) | 评论(0) | 转发(1) |