FTP commands and problems in Linux

Source: Internet
Author: User
Tags ftp commands ftp site ftp client nameserver

Local user/home/Username

We strongly recommend that you configure vsftpd
· # Cp/etc/vsftpd. conf/etc/vsftpd. conf1 <enter> // backup, vsftpd. conf is a relatively harsh main file. When you modify it, adding a space after the valid line will cause the service to fail to be enabled.
# Diff/etc/vsftpd. CONF/etc/vsftpd. conf1 <enter> // File Content Comparison
· Do one step, restart and Test

# Vi/etc/vsftpd. conf <enter>
Anonymous_enable = Yes //: 7 <enter>. you can log on to an anonymous account.
Local_enable = Yes //: 10 <enter>. you can log on to the local account.
Write_enable = Yes //: 13 <enter>, whether the user has the write permission on the server through FTP
Local_umask = 022 //: 17 <enter>, default permission when creating. Folder = 777-umask, file = 666-umask
Anon_upload_enable = Yes //: 22 <enter>, allows anonymous account upload
Anon_mkdir_write_enable = Yes // 26 <enter>, allows anonymous accounts to create folders.
Chown_uploads = Yes //: 41 <enter>, enable the anonymous account upload function to automatically change its ownership
Chown_username = Bob //: 42 <enter>. Change the owner to Bob.
Idle_session_timeout = 600 //: 52 <enter>, idle session timeout
Ascii_upload_enable = Yes //: 76 <enter>, uploaded in ASCII format
Ftpd_banner = welcome to blah FTP service. //: 80 <enter>. Welcome to the page.
Chroot_list_enable = Yes //: 91 <enter>, enable the user to change the root directory function, which is disabled by default.
Chroot_list_file =/etc/vsftpd. chroot_list //: 93 <enter>, all users in this file cannot change the root
View other file parameters # Man vsftpd. conf <enter>
Anon_other_write_enable = Yes // allows anonymous accounts to be deleted or renamed
Anon_root =/FTP // change the root directory of the anonymous account. The default value is "/var/ftp"
Local_root =/local // change the root directory of the local account to/local. The default directory is the user's main directory ~
Userlist_enable = Yes // enable the user list Function
Userlist_deny = Yes // all accounts in the user list file are rejected. No, only users in the list can log on
Userlist_file =/etc/vsftpd. user_list // user list file
Anon_max_rate = 0 // The maximum transmission rate of anonymous users. The value 0 indicates no limit.
Local_max_rate = 0 // maximum local user transmission rate, 0 is unlimited
Max_clients = 0 // maximum number of client connections, 0 is unlimited
Pasv_max_port = 0 // maximum client port limit, 0 is unlimited
Pasv_min_port = 0 // The minimum port limit on the client. The value 0 indicates no limit.

Test:
Method 1. IE (not recommended)
Method 2: cmd (strongly recommended) with a echo prompt.

FTP common test commands
? Help
Exit bye
Quit exit
Exit (Linux client only)
CD server path change
LCD local path change
PWD displays the current path of the server.
DIR Displays the content in the current directory of the server (display permission)
Ls displays the content in the current directory of the server (permissions are also displayed in Linux)
Put upload
Get download
Create a folder using mkdir
Rmdir Delete folder
Rename
Delete Delete File

Experiment 1. settings for Local Users
1. Only local accounts can log on, But anonymous accounts cannot log on.
2. The local account Bob cannot change directories other than the home directory.
3. Only Bob can log on to the local account, and Alice cannot log on to the local account.
4. Local Accounts can upload files in ASCII format
5. "Welcome to my FTP site" is displayed during login"

# Vi/etc/vsftpd. conf <enter>
Anonymous_enable = No // 1,: 7 <enter>; change
Local_enable = Yes // 1,: 10 <enter>; by default, OK
230 login successful. Have fun. Verification: logon success prompt
Login Failed. Verification: logon Failure prompt
Chroot_list_enable = Yes // 2,: 91 <enter>; Delete the note at the beginning #.
Chroot_list_file =/etc/vsftpd. chroot_list // 2,: 93 <enter>; Delete NOTE at the beginning #
Ftp> pwd <enter>
257 "Verification: displayed successfully
257 "/home/Bob" Verification: displayed before modification
Userlist_enable = Yes // 3. Add
Userlist_deny = No // 3. Add
Userlist_file =/etc/vsftpd. user_list // 3. Add
Write_enable = Yes // 4,: 13 <enter>; by default, OK
Ascii_upload_enable = Yes // 4,: 76 <enter>; Delete the note at the beginning #.
Ftpd_banner = welcome to my ftpsite // 5,: 80 <enter>; you must Delete the note at the beginning of # and modify it.
X:> FTP 192.168.1.201 <enter>
Connected to 192.168.1.201.
220 welcome to my FTP site verification: No Logon prompt
# Echo Bob>/etc/vsftpd. user_list <enter> // 3. Add a new line Bob
# Echo Bob>/etc/vsftpd. chroot_list <enter> // 2. The file must exist.
# Chkconfig vsftpd on <enter> // super daemon starts immediately and automatically starts upon startup
# Service xinetd restart <enter> // restart the vsftpd service.

Test:
X:> FTP linux.wn.com.cn <enter>

Experiment 2: anonymous account settings
1. Only anonymous accounts can log on
2. Create an incoming directory under the FTP directory
3. Anonymous access is allowed, but cannot be created or deleted in the FTP directory.
4. allows anonymous users to upload, create, and delete directories in the incoming directory.
5. The File Uploaded By the anonymous account will automatically become the file to which Alice belongs.
6. Automatic interruption in 600 seconds when the user is idle
7. Maximum transfer rate of anonymous accounts: 50 Kbytes/sec
8. client port connection range: 50000 to 60000.

# Vi/etc/vsftpd. conf <enter>
Anonymous_enable = Yes // 1,: 7 <enter> or "/anonymous" <enter> OK
Local_enable = No // 1,: 10 <enter> or "/local" <enter> modify
Anon_upload_enable = Yes // 4,: 22 <enter> or "/upload" <enter> Delete comment
Anon_mkdir_write_enable = Yes // 4,: 26 <enter> or "/mkdir" <enter> Delete comment
Anon_other_write_enable = Yes // 4,: 27 <enter> Add
Chown_uploads = Yes // 5,: 41 <enter> or "/chown" <enter> Delete comment
Chown_username = Alice // 5,: 42 <enter> Delete the comment, and then modify
Idle_session_timeout = 600 // 6,: 52 <enter> or "session" <enter> Delete comment
Anon_max_rate = 50000 // 7. Add
Pasv_min_port = 50000 // 8. Add
Pasv_max_port = 60000 // 8. Add
# Mkdir/var/FTP/incoming <enter> // 2,
# Chmod go + w/var/FTP/incoming <enter> // 4, g (Group) group, O (other) others all have write permission
# Chkconfig vsftpd on <enter >=> # service xinetd restart <enter>

Experiment 3: security restrictions for super daemon (8. Version 0 is configurable because it is 9. If vsftpd is changed to an independent daemon after 0, this method cannot be used)
1. Restrict Access To 192.168.1.0/24
2. 10.0.0.0 cannot be accessed.
3. Maximum number of connections per client: 1
4. the maximum number of server connections is 200.
5. You can only access the FTP server from.

# Vi/etc/xinetd. d/vsftpd <enter> <==# man xinetd. conf <enter>
Only_from = 192.168.1.0 // 1. Add it to brackets.
No_access = 10.0.0.0 // 2. Add it in brackets
Per_source = 1 // 3. Add it to brackets.
Instances = 200 // 4, added in brackets
Access_times =-// 5, added in brackets

FTP client connection failures
Symptom 0:
> Ftp: CONNECT: the connection is rejected.
Cause: the service is not started.
Solution: # chkconfig vsftpd on <enter>

Symptom 1:
500 Oops: cannot open user list file
Cause: the file "/etc/vsftpd. user_list" does not exist or the account does not exist in the file.
Solution: # echo username>/etc/vsftpd. user_list <enter>

Symptom 2:
530 Permission denied.
Login Failed.
Cause: the current login user does not exist in the "/etc/vsftpd. user_list" file.
Solution: # echo username>/etc/vsftpd. user_list <enter>

Symptom 3:
500 Oops: cannot open chroot () user list file
Login Failed.
Cause: the file "/etc/vsftpd. chroot_list" does not exist"
Solution: # echo username>/etc/vsftpd. chroot_list <enter>

Symptom 4:
500 Oops: Missing Value in config file
Connection closed by remote host.
Cause: "=" there is a problem with the value before the equal sign, or there is only one space
Solution: Correct the corresponding value, and compare and search through diff.

Symptom 5:
500 Oops: Bad bool value in config file
Connection closed by remote host.
Cause: the value after equal sign (=) is incorrect.
Solution: Confirm and modify the value after "= ".

Symptom 6:
500 Oops: unrecognised variable in config file
Connection closed by remote host.
Cause: there is a space before the Parameter
Solution: Delete the space before the Parameter

Symptom 7,
Check whether "local_enable = yes" exists, but the local user cannot log in.
Cause: the verification parameter is deleted by mistake.
Solution: Add "pam_service_name = vsftpd"

Symptom 8,
500 Oops: chdir
500 Oops: child died
Connection closed by remote host.
Cause: the user's home directory has no permission or has no home directory
Solution: correctly set the user's home directory permissions

Basic elements of X: server and clientProgram, Communication channel, window manager, and desktop environment

Typical Linux desktops: GNOME and KDE

Switch character to graph
# Init 5 <enter> // switch to running level 5
# Startx <enter> // convert the current environment to the graph type as the current identity
<Ctrl> + <alt> + <backspace> // return character
<Alt> + <F1> // menu
<Alt> + <F2> // run

Install a Chinese font to display Chinese Characters
Insert the first disc
# Mount/mnt/CDROM <enter>
# Rpm-IVH/mnt/CDROM/RedHat/RPMS/ttfonts-zh_CN * <enter>
# Init 5 <enter>
Lower left corner "language" => Simplified Chinese

Display resolution changes
# Vi/etc/X11/xf86config <enter>
Defaultdepth 16 // "/depth <enter>" 16 colors (color quality)
<= Defaultdepth 24 // 24 bits (color quality)
Depth 16 // "/depth <enter>"
<= Depth 24
Modes "640x480" // screen resolution (pixels), prior to priority
<= Modes "1024x768" "800x600" "640x480"

X cannot be started, common faults
Symptom: The image cannot be started.
Cause: The xfs service is not started.
Solution: # service XFS start & chkconfig XFS on <etner>

Samba-SWAT
Purpose: use IE to configure the samba Service
Daemon: SWAT (super daemon)
Protocol: TCP/901 <==# grep SWAT/etc/services <enter>
# Chkconfig SWAT on <enter>
# Init 5 <enter>
Open the ILA browser http: // 127.0.0.1: 901/in the local image/
Enter the Administrator account % password, root % offline

Linux Internet access (ADSL)
· Route the cat to access the Internet
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0 <enter>
Device = eth0
Onboot = Yes
Bootpro = static
Ipadd = 192.168.1.100
Netmask = 255.255.255.0
Gateway = 192.168.1.1
# Service network restart <enter>
# Vi/etc/resolv. conf <enter>
Nameserver 202.96.69.38
Nameserver 202.96.64.68
Nameserver 202.96.75.68
· Dial-up cat surfing the internet
# ADSL-setup <enter>
Enter you login name (Default Root): suzhen @ 163 <enter>
Interface (default eth0): <enter>
Enter the demand value (default no): <enter>
Enter the DNS information here: 202.96.69.38 <enter>
Enter the secondary DNS server address here: 202.96.64.68 <enter>
Please enter your password: Enter not displayed <enter>
Please re-enter your password: Enter not displayed <enter>
Userctrl (default yes): <etner>
Choose a type of firewall (0-2): 1 <enter>
Start this connection at boot time, please enter NO or yes: Yes <enter>
Accept these settings and adjust configuration files (y/n )? Y <enter>
# ADSL-start <enter>
# ADSL-connect <enter>
# ADSL-status <enter>
# ADSL-Stop <enter>

From: http://pingzhicao.blog.sohu.com/73739523.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.