Access to network File system and LDAP network account settings

Source: Internet
Author: User
Tags ldap command access

Access Network File system 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0028.gif "alt=" J_0028.gif "/>

CIFS Network File system access

1. Install the shared access client

Yum Install Samba-client-y

2. identify shared server shared directory

Smbclient-l//172.25.254.250

3. Accessing the Share (command access)

Smbclient//172.25.254.250/WESTOS1

Mount Access (Temporary mode)

Mount//172.25.254.250/westos1/mnt-ousername=guest



650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8A/22/wKioL1gpESuSU6ghAABe0_nTZzI373.png-wh_500x0-wm_3 -wmp_4-s_1538705132.png "style=" Float:none; "title=" 1.png "alt=" Wkiol1gpesusu6ghaabe0_ntzzi373.png-wh_50 "/>

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8A/25/wKiom1gpES2Amv_IAACtSlsZH2E159.png-wh_500x0-wm_3 -wmp_4-s_816333789.png "style=" Float:none; "title=" 2.png "alt=" Wkiom1gpes2amv_iaactslszh2e159.png-wh_50 "/>

Mount Access (permanent mode)

vim/etc/rc.d/rc.local ( Permanent) recommended to use 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0019.gif "alt= "J_0019.gif"/>

Mount//172.25.254.250/westos1/mnt-ousername=guest

chmod 755/etc/rc.d/rc.local Give permission

Vim/etc/fstab ( permanent) 650 not recommended) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0025.gif "alt=" j_ 0025.gif "/>

172.25.254.250/westos1/mnt CIFS Defaults,username=guest

NFS access to the network file system

1 Install access sharing software

Yum Install Nfs-utils

2. Identify shares

SHOWMOUNT-E 172.25.254.250

3. use Sharing ( no client required )

Mount 172.25.254.250:/nfsshare/nfs1/mnt

4. Auto Mount

vim/etc/fatab ( test: mount-a)

172.25.254.250:/nfsshare/nfs1/mnt nfsdefaults 0 0

vim/etc/rc.d/rc.local ( test: sh/etc/rc.d/rc.local)

Mount 172.25.254.250:/nfsshare/nfs1/mnt

chmod 755/etc/rc.d/rc.local

Default Auto Mount AutoFS Automatic Mount Service (only works for NFS services)

1. Service Function

By default when using Mount Mount sharing, shared server resources are wasted when no share is used

AutoFS can be implemented when used automatically mount, when idle automatically uninstall

2. Service Installation

Yum Install Autofs-y

Systemctl Start AutoFS

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8A/22/wKioL1gpEb2w4JjWAAFYKpiZOFo344.png-wh_500x0-wm_3 -wmp_4-s_2009565308.png "title=" 3.png "alt=" Wkiol1gpeb2w4jjwaafykpizofo344.png-wh_50 "/>

3. Access

Cd/net/172.25.254.250/nfsshare/nfs1

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8A/25/wKiom1gpEczBUAP0AAFNLXCwfoY787.png-wh_500x0-wm_3 -wmp_4-s_2403356677.png "title=" 4.png "alt=" Wkiom1gpeczbuap0aafnlxcwfoy787.png-wh_50 "/>

4. Set idle unload time

Vim/etc/auto.conf

timeout=3// idle three wonderful after automatic unloading

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/22/wKioL1gpEd7ixJzyAAHnA57kqRI462.png-wh_500x0-wm_3 -wmp_4-s_2330964362.png "title=" 5.png "alt=" Wkiol1gped7ixjzyaahna57kqri462.png-wh_50 "/>

Vim/etc/auto.master

/mnt (last-level directory of the final mount point)/etc/auto.nfs

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8A/25/wKiom1gpEeyySRMAAAGjt8kXYy0833.png-wh_500x0-wm_3 -wmp_4-s_465925447.png "title=" 6.png "alt=" Wkiom1gpeeyysrmaaagjt8kxyy0833.png-wh_50 "/>

Vim/etc/auto.nfs

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/25/wKiom1gpEfnAf1trAAAogDX9hyE546.png-wh_500x0-wm_3 -wmp_4-s_2798637828.png "title=" 7.png "alt=" Wkiom1gpefnaf1traaaogdx9hye546.png-wh_50 "/>

LDAP Network account 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0023.gif "alt=" j_0023.gif "/>

1.ldap is what

LDAP Directory service authentication, similar to Windows Active Directory, is a way to record data

2.ldap software required by the client

Yuminstall SSSD Krb5-workstation–y

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8A/25/wKiom1gpEg3hlXZkAAJj3cDZLgc481.png-wh_500x0-wm_3 -wmp_4-s_1422361375.png "title=" 8.png "alt=" Wkiom1gpeg3hlxzkaajj3cdzlgc481.png-wh_50 "/>

3. How to turn on LADP user authentication

Authconfig-tui



650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8A/22/wKioL1gpEiug_3ObAADf_X4UZaY523.png-wh_500x0-wm_3 -wmp_4-s_900500675.png "style=" Float:none; "title=" 9.png "alt=" Wkiol1gpeiug_3obaadf_x4uzay523.png-wh_50 "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8A/22/wKioL1gpEiyjKKBXAABUbQXUeN8608.png-wh_500x0-wm_3 -wmp_4-s_1081065037.png "style=" Float:none; "title=" 10.png "alt=" Wkiol1gpeiyjkkbxaabubqxuen8608.png-wh_50 "/>

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8A/26/wKiom1gpEi7yT6iwAACJSawZhZo282.png-wh_500x0-wm_3 -wmp_4-s_3336907028.png "style=" Float:none; "title=" 11.png "alt=" Wkiom1gpei7yt6iwaacjsawzhzo282.png-wh_50 "/>

An error is found because the CA certificate is missing

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8A/26/wKiom1gpEkaQNg1dAAGZUYbEQQ4512.png-wh_500x0-wm_3 -wmp_4-s_3246932984.png "style=" Float:none; "title=" 12.png "alt=" Wkiom1gpekaqng1daagzuybeqq4512.png-wh_50 "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8A/22/wKioL1gpEkeyhKuVAABXFzADgm0622.png-wh_500x0-wm_3 -wmp_4-s_695765923.png "style=" Float:none; "title=" 13.png "alt=" Wkiol1gpekeyhkuvaabxfzadgm0622.png-wh_50 "/>

Test: Getent passwd ldapuser1

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8A/26/wKiom1gpEl7gIObyAABtqqCfJIE337.png-wh_500x0-wm_3 -wmp_4-s_1080414983.png "title=" 14.png "alt=" Wkiom1gpel7giobyaabtqqcfjie337.png-wh_50 "/>

4. automatically mount the user home directory (no home directory, users can not log in)

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/22/wKioL1gpEm2xX5yhAAGXJ7vBUvs469.png-wh_500x0-wm_3 -wmp_4-s_3001718172.png "title=" 15.png "alt=" Wkiol1gpem2xx5yhaagxj7vbuvs469.png-wh_50 "/>

Yuminstall autofs-y

Vim/etc/autofs.master

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8A/26/wKiom1gpEnuD_b1vAAGULrmguzU379.png-wh_500x0-wm_3 -wmp_4-s_489602389.png "title=" 16.png "alt=" Wkiom1gpenud_b1vaagulrmguzu379.png-wh_50 "/>

/home/guests/etc/auto.ldap

showmount-e 72.25.254.254 ( See what's in the home directory you share vim/etc/autofs.master what you write)

Vim/etc/auto.ldap

Ladpuser1172.25.254.254://home/guests/ldapuse1

*172.25.254.254://home/guests/&

systemctlenable autosf.service ( automatic mount on boot)

List all Users

Vim/etc/sssd/sssd.conf

Enumerate= True

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/22/wKioL1gpEpGxZ9hfAAFi8QrH3Kw164.png-wh_500x0-wm_3 -wmp_4-s_3730319040.png "title=" 17.png "alt=" Wkiol1gpepgxz9hfaafi8qrh3kw164.png-wh_50 "/>

Systemctl Restart SSSD

Getent passwd

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8A/26/wKiom1gpEqKCYA4OAAQEPYLu9VI474.png-wh_500x0-wm_3 -wmp_4-s_501618452.png "title=" 18.png "alt=" Wkiom1gpeqkcya4oaaqepylu9vi474.png-wh_50 "/>

shall script Mode configuration 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0020.gif "alt=" j_0020.gif "/>

#!/bin/bash

echo "Install software ing ..."

Yuminstall SSSD krb5-workstation autofs-y &>/dev/null

echo "Config LDAP auth client ing ..."

Authconfig\

--enableldap\

--enablekrb5\

--disableldapauth\

--enableldaptls\

--ldaploadcacert=http://172.25.254.254/pub/example-ca.crt\

--ldapserver= "classroom.example.com" \

--ldapbasedn= "dc=example,dc=com" \

--krb5realm= "example.com" \

--krb5kdc= "classroom.example.com" \

--krb5adminserver= "classroom.example.com" \

--enablesssd\

--enablesssdauth\

--update

echo "Config LDAP user\ ' s home directory ing ..."

Echo/home/guests/etc/auto.ldap >>/etc/quto.master

echo "* 172.25.254.254:/home/guests/&" >>/etc/auto.ldap

Systemctlrestart AutoFS

Systemctlenable AutoFS


Access to network File system and LDAP network account settings

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.