how to access cents7 by hostname from windows
Create And Configure Samba Shares In CentOS 7
- Installing Samba in CentOS 7
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
[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
[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
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 httpdsudo service httpd start
Thanks for posting such a Useful Information. Good Blog!!
ReplyDeleteDevOps Training
DevOps Online Training
you are welcome
Delete