November 19

Linux: A server build with cifs share example

Cloned the server from a template

On the server:

Setup repository with satellite:
subscription-manager register --org="ORG-NAME" --activationkey="KEY"
subscription-manager subscribe --auto

Activated puppet:
Puppet agent setup from client
puppet agent -tv

Puppet agent setup from server
puppet cert sign --all

Setup SNMP using Satellite:
yum install -y net-snmp net-snmp-utils net-snmp-libs net-snmp-devel

mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old ; echo "snmpd: ALL" >> /etc/hosts.deny ; echo "snmpd:" >> /etc/hosts.allow ; echo "snmpd:" >> /etc/hosts.allow ; echo "snmpd:" >> /etc/hosts.allow ;  echo "snmpd:" >> /etc/hosts.allow ; echo "snmpd:" >> /etc/hosts.allow ; echo "sysname `hostname`" >> /etc/snmp/snmpd.conf ; echo "syslocation HQ Server Room" >> /etc/snmp/snmpd.conf ; echo "syscontact [email protected]" >> /etc/snmp/snmpd.conf ; echo "rocommunity communityname" >> /etc/snmp/snmpd.conf ; systemctl enable snmpd.service ; systemctl restart snmpd.service

Install LANSWEEPER using Satellite:
cd /root ; wget http://satelliteservername/pub/ ; chmod 744

cd /root ; ./ --server --port 9524 --mode unattended

Installed Mcafee using Satellite:
firewall-cmd --permanent --add-port=8081/tcp ; firewall-cmd --add-port=8081/tcp ; firewall-cmd --reload

cd Downloads/ ; wget http://satelliteservername/pub/ ; unzip ; sh -i ; rm -f inst*

cd Downloads/ ; wget http://satelliteservername/pub/ ; unzip ; ./isectp-setup ; rm -f isectp* ; rm -f PkgCatalog.z

Added a second scsi controller and a 60GB drive

Drive configuration:

yum install cifs-utils

pvcreate /dev/sdb
vgcreate VG_DATA /dev/sdb
lvcreate -l 100%FREE -n lv_data VG_DATA

mkfs.xfs /dev/VG_DATA/lv_data

mkdir /data
chown -R localuser1:localuser1 /data/

Remote share setup:
useradd -u 1110 localuser2
useradd -u 1120 localuser3

mkdir /share1
chown -R localuser2:localuser2 /irfile/

mkdir /mnt/data1
chown -R localuser3:localuser1 /mnt/Linuxmnt/

mkdir /root/creds



chmod 0600 /root/creds/localuser2_creds
chmod 0600 /root/creds/localuser3_creds

Added the following to fstab:

/dev/mapper/VG_DATA-lv_data  /data          xfs     defaults        1 1
//fileserver1/share1  /share1 cifs credentials=/root/creds/localuser2_creds,vers=2.0,uid=1110,gid=1110,file_mode=0773,dir_mode=0773 0 0
//fileserver2/data1  /mnt/data1 cifs credentials=/root/creds/localuser3_creds,vers=2.0,uid=1120,gid=1000,file_mode=0775,dir_mode=0775 0 0

mount -a
df -h

Copyright 2021. All rights reserved.

Posted November 19, 2021 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B