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

Linux network management configuration

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

The role of file sharing between samba windows and Linux

Ftp

Nfs

Nfs between linux and linux

CIFS between windows and windows

DOS

DEC Unix

Sun unix

SMB Service message block

Samba

= =

Server:

Yum-y install samba

Vim / etc/samba/smb.conf

[pub] / / share name

Comment = Pub Stuff / / share description information

Path = / common / / shared directory

Public = yes / / whether to allow guest users to access

Writable = yes / / whether the shared directory is scientific or not

Printable = no / / whether to print

Write list = huahua / / users who allow write operations

Valid users = huahua / / users who are allowed to access the share

Systemctl restart smb

New user: useradd username

Set the samba password for the user: smbpasswd-a username

UGO permission: if you need the user to have permission to write, you need to set the user's w permission on the shared directory.

=

Client:

Windows:\\ samba server address\ share name

Linux: mount-t cifs 192.168.2.222:/pub / media-o username=huahua

The following aspects are considered when there are permission issues:

1. Program setting permissions

2.UGO permission

3.Selinux permission

Ftp file transport protocol

21 control connection command channel

20 data transmission data channel

Active mode POST

Passive mode PASV

User Type:

(1) Anonymous user: anon

(2) Local user: / etc/passwd

(3) Virtual user: map the logged-in user to a specified system account (/ sbin/nologin) to access FTP resources

/ etc/vsftpd/vsftpd.conf main configuration file

Anonymous_enable=YES / / allow anonymous access

Local_enable=YES / / allow local users to access

Write_enable=YES / / Local users can read and write

Local_umask=022 / / default permissions for local users to create files (umask)

Anon_upload_enable=YES / / whether anonymous users can upload files

Dirmessage_enable=YES / / if there is a .message hidden file in the directory, enter the directory and the .message will be displayed.

Xferlog_enable=YES / / whether to continue uploading and downloading logs

Connect_from_port_20=YES / / Connect from port 20

Chroot_local_user=YES / / imprison local users to their own home directory

Xferlog_std_format=YES / / log format

Listen=NO / / whether to monitor or not

Listen_ipv6=YES

Pam_service_name=vsftpd / / lists the file names related to pam, that is, the file names in the / etc/pam.d/ directory

Userlist_enable=YES

Tcp_wrappers=YES / / supports tcp wrappers

Virtual user:

(1) install the package: yum install pam libdb libdb-utils

(2) Editing the user password file

Vim / etc/vsftpd/ftpuser.txt

Test

123456

(3) generate database files

Db_load-T-t hash-f / etc/vsftpd/ftpuser.txt / etc/vsftpd/vsftpd_login.db

(4) configure auth and account modules

Cd / etc/pam.d/

Vim vsftpd

Auth sufficient / lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

Account sufficient / lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

(5) add system users

Useradd-s / sbin/nologin ftpuser

(6) configure the main configuration file

Vim / etc/vsftpd/vsftpd.conf

Pam_service_name=vsftpd

Userlist_enable=YES

Tcp_wrappers=YES

Guest_enable=YES

Guest_username=ftpuser

Virtual_use_local_privs=YES

(7) start the service

Systemctl restart vsftpd

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

Network Security

Wechat

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

12
Report