I am using CentOS and I need to connect to a file server running on windows. My friend told me that I need to install SAMBA to be able to do that. and so I installed samba and when I try to check if the installation is successful, this command
smbclient //[hostname]/[sharename] -U [username]
gave me this
timeout connecting to XXX.XXX.XXX.XXX:XXX Error Connecting to XXX.XXX.XXX.XXX (No route to host) Connection to XXX.XXX.XXX.XXX failed (Error NT_STATUS_HOST_UNREACHABLE)
How do I fix this?
Here's the step by step instruction how I installed SAMBA. Kindly check if I'm missing something.
Check if SAMBA is already installed using the command below : $ rpm -q samba
If SAMBA is not yet installed. Type the command shown below to have a root access $ su –
Then you will be asked to type in your password.
Download and install the Linux SAMBA package using the command : yum install samba
Configure the Linux Firewall so that it will allow the SAMBA traffic by following the steps below. a. Click the System >> Administration > Security Level and Firewall b. Type the root password> in the textbox provided c. In “Firewall Options” tab, Check the SAMBA > Combo box. d. Apply and press ok.
Configure the SAMBA config file. In the terminal, you should have a root access, (do as told in number 2) and type in the command below.
gedit /etc/samba/smb.conf
this will open the smb.conf and it is ready for any modification.
Spot the part of the config file which contains workgroup. Edit that part, change the value to “workgroup”
workgroup = workgroup
And add this section [NetApps]
path = /data/network-applications writeable = yes browseable = yes valid users = administrator Save all the changes.
Create a SAMBA user a. You must gain root privileges by doing the command in number 2. b. Add administrator as a user smbpasswd -a > administrator
c. Then it will ask you to type the password for that > account. d. To know if you have any error with the configuration, use > this command TestparmStart SAMBA and NetBios Service a. To start the SAMBA and NetBios Service /etc/init.d/smb {start|stop|restart|reload|status|condrestart}
Accessing Windows Shares From CentOS a. Gain root privileges by doing number 2. b. Download and install samba-client $ Yum install > samba-client