Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[unit7 & unit9] cifs network file system access; vsftp service

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

* *

* 7. Access the network file system *

* *

* cifs network file system access *

1. Install a shared access client

Yum install samba-client-y

two。 Identify shared directory

Smbclient-L / / 172.25.254.253

[root@netfsclient mnt] # smbclient-L / / 172.25.254.253

Enter root's password: (enter directly)

Domain= [USER-20161030DE] OS= [Windows 5.1] Server= [Windows 2000 LAN Manager]

Sharename Type Comment

-

IPC$ IPC remote IPC

Westos Disk

Domain= [USER-20161030DE] OS= [Windows 5.1] Server= [Windows 2000 LAN Manager]

Server Comment

--

Workgroup Master

--

3. Access Shar

Command access)

[root@netfsclient mnt] # smbclient / / 172.25.254.253/westos

Enter root's password:

Domain= [USER-20161030DE] OS= [Windows 5.1] Server= [Windows 2000 LAN Manager]

Smb:\ >

Mount access)

Mount / / 172.25.254.253/westos / mnt-o username=guest

4. Automatically mount cifs on boot

Method 1)

Vim / etc/fstab

/ / 172.25.254.253Universe westosUniverse mntcifsdefaultsjournal usernamekeeper guest 0 0

Method 2)

Vim / etc/rc.d/rc.local

Mount / / 172.25.254.253/westos / mnt-o username=guest (written on the last line)

Chmod 755 / etc/rc.d/rc.local

* access to nfs network file system *

1. Install access sharing softwar

Yum install nfs-utils

two。 Identify sharing

Showmount-e 172.25.254.250

3. Use Sharin

Mount 172.25.254.250:/nfsshare/nfs1 / mnt

4. Automatic mount

Method 1)

Vim / etc/fstab

172.25.254.250:/nfsshare/nfs1 / mnt nfsdefaults0 0

Method 2)

Vim / etc/rc.d/rc.local

Mount 172.25.254.250:/nfsshare/nfs1 / mnt

Chmod 755 / etc/rc.d/rc.local

* autofs auto-mount service *

1. Service function

By default, when using mount to mount a share, it will be mounted when the share is not used.

Waste of shared server resources

Autofs can be automatically mounted when in use and unloaded automatically when idle

two。 Installation service

Yum install autofs-y

Systemctl start autofs

3. Visit

Cd / net/172.25.254.250/nfsshate/nfs1

4. Set idle unloading time

Vim / etc/autofs.conf

15 timeout = 3 minutes * the system automatically uninstalls the network equipment after it is idle for 3 minutes

5. Implement a custom shared mount point

Vim / etc/auto.master

Finally, the upper directory word configuration file of the custom mount point

/ mnt/etc/auto.nfs

Vim word profile

Final mount point network shared directory

Vim / etc/auto.nfs

Pub1 172.25.254.250:/nfsshare/nfs1

* 172.25.254.250 Drexample nfssharepool mounts * specify any shared mounts

* *

* 9.vsftp service *

* *

1. What is ftp?

FTP is the English abbreviation of File Transfer Protocol (File transfer Protocol), while the Chinese abbreviation is "text transfer Protocol". Used for two-way transfer of control files on Internet. It is also an application (Application). There are different FTP applications based on different operating systems, and all of these applications follow the same protocol to transfer files. In the use of FTP, users often encounter two concepts: "Download" and "Upload". To "download" a file is to copy a file from a remote host to your own computer, and to "upload" a file is to copy a file from your own computer to a remote host. In the Internet language, users can upload (download) files to (from) a remote host through a client program.

two。 Install ftp

Yum install vsftpd-y

Systemctl start vsftpd

Systemctl stop firewalld

Systemctl enable vsftpd

Setenforce 0permission * adjust selinux to warning mode to prevent blocking my access

Lftp ip** can log in and display, indicating that the installation is successful

3.vsftpd file information

/ var/ftp** default release directory

/ etc/vsftpd** configuration directory

Configuration parameters of the 4.vsftpd service

1) Anonymous user settings

Anonymous_enable=YES | NO** anonymous user login permissions

#

Vim / etc/vsftpd/vsftpd.conf

Write_enable=YES

Anon_upload_enable=YES

Chgrp ftp/ var/ftp/pub [generally error 550indicates that the service is not allowed to enter anonymously, and 553 indicates that the file does not have the permission to execute]

Chmod 775 / var/ftp/pub

#

Anon_root=/direcotry

#

Anon_umask=xxx

#

Anon_mkdir_write_enable=YES | NO

#

Anon_world_readable_only=YES | NO * * set the parameter to no to indicate that anonymous users can download

#

Anon_other_write_enable=YES | NO

#

Chown_uoloads=YES

Chown_username=student

#

Anon_max_rate=102400

Yum install lftp** download

Yum install vsftpd-y

Vim / etc/sysconfig/selinux** Open File change

SELINUX=disabled** does not detect selinux [restart the machine after executing this command]

Max_clients=2

2) Local user settings

Local_enable=YES | NO

Write_enable=YES | NO

#

Local_root=/directory

#

Local_umask=xxx

#

All users are locked into their home directory

Chroot_local_user=YES

Chmod Umurw / home/*

User blacklist creation?

Chroot_local_user=NO

Chroot_list_enable=YES

Chroot_list_file=/etc/vsftpd/chroot_list

User whitelist? (change the first line to YES: indicates that it cannot access the root directory)

Chroot_local_user=YES

Chroot_list_enable=YES

Chroot_list_file=/etc/vsftpd/chroot_list

# [after setting, it means that you cannot log in to the user of the machine] [if you set it in this, you turn off / etc/vsftpd/chroot_list, otherwise it will affect the operation]

Vim / etc/vsftpd/ftpusers** user blacklist

Temporary blacklist of vim / etc/vsftpd/user_list** users

User whitelist setting

Userlist_deny=NO

/ etc/vsftpd/user_list** parameter setting, this file becomes whitelist

Users who appear on the list can log in to ftp

#

Create a virtual account identity)

Vim / etc/vsftpd/userfile** file name is arbitrary

HXL1

one hundred and twenty three

HXL2

one hundred and twenty three

HXL3

one hundred and twenty three

Db_load-T-t hash-f userfile userfile.db * * encrypted files [T: conversion;-t hash: encrypted conversion is hash;-f: file] (after conversion, you can delete the source file, which is useless anyway)

Vim / etc/pam.d/vmuser

Account requiredpam_userdb.sodb=/etc/vsftpd/userfile [userfile is not followed by a suffix, this command will automatically add a suffix, too much will cause problems]

Authrequiredpam_userdb.sodb=/etc/vsftpd/userfile

Vim/etc/vsftpd/vsftpd.conf [check files, do not enable whitelist function, otherwise you can't wait]

Pam_service_name=vmuser [points pam to your own function file written under pam] [if this is changed, you won't be able to access student or anything.

You can only access the users written in your virtual file]

Guest_enable=YES [allow visitors to visit]

Guest_username=ftp [all visitors are ftp]

Virtual account identity assignment)

Guest_username=ftpuser [this identity is specified to be the same as the group of the directory accessed, and add 775, whatever you want to call it, consistent]

Chmod Umurw / home/ftpuser [subtract w from u, which is more logical, so that the group is a personal directory, and you super users can't modify private things at will]

The virtual account home directory is set independently) [sometimes the service transfer is too slow, you have to wait for a while, because you think it has failed at the beginning, speechless]

[root@server60 ~] # mkdir / ftpdir/HXL1-p

[root@server60 ~] # mkdir / ftpdir/HXL2-p

[root@server60 ~] # mkdir / ftpdir/HXL3-p

[root@server60 ~] # touch / ftpdir/HXL1/HXL1file

[root@server60 ~] # touch / ftpdir/HXL2/HXL2file

[root@server60 ~] # touch / ftpdir/HXL3/HXL3file

Vim / etc/vsftpd/vsftpd.conf

Local_root=/ftpdir/$USER [specify the home directory of the virtual account below]

User_sub_token=$USER [virtual user word token, which is used in conjunction with the above]

[supplementary record]

Firewall-cmd--list-all [check the services allowed by the firewall. There is a ssh by default]

Firewall-cmd--permanent--add-server=ftp [add the format of the service, use ftp as an example]

Firewall-cmd--reload [should be loading service information]

Firewall-cmd--list-all [after OK, you are checking the following and are guaranteed to be inside]

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report