quarta-feira, 24 de fevereiro de 2016

How to install and configure Samba service on Rhel or CentOS 7

The Samba is a computer program used in operating Unix-like systems, simulates a Windows server, allowing it to be done management and file sharing on a Microsoft network. This guidance will show how to add and configure the Samba service at a CentOS 7.


1 - To install samba packages go to terminal and as root enter type:

#yum install samba samba-client samba-common -y





















2 - Configure samba and edit the file /etc/samba/smb.conf. Before edit it, we will make a copy of /etc/samba/smb.conf file

#cp -p /etc/samba/smb.conf /etc/samba/smb.conf.bkp
#vi /etc/samba/smb.conf















Edit the smb.conf file and paste it:
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no

#=================Share Definitions ===================
[Anonymous]
path = /samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no

3 - Create a folder to be shared with everyone without security, anonymous:

#mkdir -p /samba/anonymous

4 - Restart the samba services:

#systemctl enable smb.service
#systemctl enable nmb.service
#systemctl restart smb.service


5 - Change the permission for samba share:

#chmod -R 0755 anonymous/











6 - Finally, we will test the access of this new share from Windows system. Go to start>run and type \\[hostname or IP]\share and check out:









For create a Secure folder at samba service, follows:

#useradd joe
#groupadd smbgrp
#usermod -a -G smbgrp joe
#smbpasswd -a joe

#smbpasswd -a joe
New SMB password:  XXXXXX
Retype new SMB password:   XXXXXX
Added user joe.

#mkdir -p /samba/security
chown -R joe:smbgrp /samba/security/
chmod -R 750 /samba/security/
chcon -t samba_share_t /samba/security/












Edit the smb.conf file as below:

#vi /etc/samba/smb.conf

Add the security shared folder

[Security]
path = /samba/security
valid users = @smbgrp
guest ok = no
writable = yes
browsable = yes





















Now, from Windows side check out the folder and access with id create previously:



sexta-feira, 19 de fevereiro de 2016

How to Install Cinnamon on CentOS 7

1 - We need to install an group of packages X Server with GUI. As root from terminal, type:

#yum groupinstall "Server with GUI" -y













2 - Install the EPEL repository which contains the RPMs for Cinnamon:

#yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm -y



















3 - Install the Cinnamon Packages:

#yum install cinnamon -y









4 - Create a link to tell to the systemd to boot into runlevel 5 (desktop environment). The systemd is a replacement for the Linux init daemon and will start, stop the service etc:

#ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target




5 - Reboot and check out the graphic user interface, you may be asked to fill some information:

#reboot





terça-feira, 16 de fevereiro de 2016

How to compile kernel CentOS 7

Pre-requisites:

1 - We need to install some packages, they are gcc* bison ncurses-devel rpm-build make wget openssl-devel bc, see below.

1.1 From terminal like root type yum install gcc* bison ncurses-devel rpm-build make wget openssl-devel bc:









2 - Download the last kernel version Kernel Linux. Go to https://www.kernel.org web site and check out, see below:

2.2 From terminal like root type wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.1.tar.gz:


2.3 Checking the Current kernel; From terminal type uname -r:




 

 

Steps to recompile the kernel

3 - Copy the file previously downloaded to /usr/src, it will be installed and compiled. From terminal like root type cp /<directory-whereis-the-file-downloaded /usr/src:



3.1 - Go to /usr/src directory; Type cd /usr/src.
3.2 - Unzip the file; From terminal type tar -xvf linux-4.4.1.tar.gz:
 


3.3 - Go to the directory where the files were unziped; From terminal type cd linux-4.4.1:




3.4 - Copy the Kernel configurations to the directory; From terminal type  cp /boot/config-$(uname -r) ./.config:



3.5 - Configure the menuconfig; From terminal type make menuconfig
    - On Kernel configuration go to Load an Alternate configuration file and type .config > click OK
    - Save the configuration and close






 

 

Starting the Kernel compilation 

4 - From terminal type make or make -j4:



Wait the compilation finish, it may delay from 2 to 4 hours.

5 - From terminal type make modules_install:



6 - From terminal type cp arch/x86_64/boot/bzImage /boot/vmlinuz-4.4.1:



7 - From terminal type cp .config /boot/config-4.4.1:



8 - From terminal type cp System.map /boot/System.map-4.4.1:


9 - From terminal type dracut /boot/initramfs-4.4.1.img 4.4.1:


10 - Invoke the mkconfig, type sudo /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg:
11 - From terminal type reboot and check the new kernel:
12 - Finally after the reboot, type uname -r to see the current kernel version:
 




 

This is it. I hope it may help someone. See you guys !