NETWORKSTIP Networking CCNA,Centos,Ubuntu,Sql,

Made By Muhammad Nafees

Breaking

Thursday 12 April 2018

how to access centOS by hostname from windows

how to access cents7 by hostname from windows 

Create And Configure Samba Shares In CentOS 7 

  • Installing Samba in CentOS 7
Next, logon to your CentOS 7 server and install Samba and other samba packages. To do that, run the commands below.
yum -y install samba samba-client samba-common

After running the above commands, go and create a backup of Samba default configuration file. To do that, run the commands below.
mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

Then create a new configuration file with the information below.
vi /etc/samba/smb.conf 




  • Samba global parameters
In the new smb.conf file, set the global parameters that will allow Samba to share it shares.
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = nafees.local
security = user
map to guest = bad user
dns proxy = no 


  • First share to allow everyone access
Below the [global] parameters, add the below shares definitions that will allow everyone access to the shared directory.

[allaccess]
path = /samba/allaccess
browsable = yes
writable = yes
guest ok = yes
read only = no 


Save the file and restart Samba services and continue..
Next, run the commands below to create the allaccess folder that you shared above.

mkdir -p /samba/allaccess


Then enable and start Samba services using the commands below

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



  • Open the firewall to allow access
By default all incoming ports are denied when you installed CentOS. To allow external access to Samba in CentOS 7, you must open the firewall to allow traffic to Samba. To do that, run the commands below. 


cd /samba
chmod -R 0755 allaccess/  
chown -R nobody:nobody allaccess/

Next, we want to allow selinux for the share folder above. To do that, run the commands below from the /samba directory.

chcon -t samba_share_t allaccess/
Now go to Windows machine and select Run then type the folder path to access it.



Step 2


1.Stop firwall or add rule
To disable firewalld, run the following command as root:
systemctl disable firewalld
To stop firewalld, run the following command as root:
systemctl stop firewalld
And finally, to check the status of firewalld, run the following command as root:
systemctl status firewalld
2.Disable SELINUX gedit /etc/selinux/config

Install the Apache web server

sudo yum install httpd

sudo service httpd start

 

2 comments: