LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to share directories between RedHat and Vista? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-share-directories-between-redhat-and-vista-771815/)

th_matt 11-26-2009 09:25 PM

How to share directories between RedHat and Vista?
 
Background:
I do not know about a lot about linux. I’m only a beginner and am hoping to learn by posting questions here. I have a Vista Machine and using VMWare Workstation 7.0, virtualized Red Hat 5.4. Therefore I'd appreciate and additional details that are given to my questions.

Awesome Thanks!!!

Question:
How do I access my shared Vista directories in RedHat. Is this possible?
Or even vice versa, how do I share directories in RedHat that can be accessed in vista.
When I say access, I am looking for both read/write permissions.

Additional Details:
My RedHat hostname is localhost.localhostdomain. This is by default.

bret381 11-27-2009 08:10 PM

give Samba a try

imagine_me2 11-28-2009 04:54 AM

All you need to configure your VMware virtual network interface to connect your host(Windows Vista) and guest(RHEL) os.

After that you can settle down for simple command line ftp or a use a ftp client. Or you can try and use Samba.
For that purpose you have to configure and start Samba server in RHEL.

Regards.

th_matt 12-06-2009 12:21 AM

Please let me know how to configure and start samba server in RHEL. As explained earlier, the more detailed the steps, the better.

Any links which explain (in simple terms) how to perform this will also do.

Thanks.

EricTRA 12-06-2009 01:08 AM

Hello and Welcome to LinuxQuestions,

Google is your friend in all your quests. Have a look at these:

I help you
Guide from RedHat
Yet another one

Kind regards,

Eric

th_matt 12-06-2009 02:57 AM

Thanks Eric.

The first link was funny (and a good tool). I tried that before and it had got be to the second link which I got stuck following. Mainly I get an error when I type this into terminal. 'redhat-config-samba'. Like I said, I'm a real newbie.

But the thrid link looks like its got the right amount of detail and its exactly what I need. Thanks dude.

If anyone one else has anymore links/suggestions. Please feel free to post here. Like I said the simpler more detailed, the better.

EricTRA 12-06-2009 03:14 AM

Hello,

Glad you liked it! Have a look at this site too: http://www.howtoforge.com. If you type Samba in the search box and look at the CentOS guide, you'll get a pretty good idea of how to set it up. CentOS is very similar to RedHat. All the guides on that site are step by step/copy and paste, so that should be the easiest you're going to get other than having someone experienced sitting next to you.

Kind regards,

Eric

malekmustaq 12-06-2009 06:37 AM

Quote:

Please let me know how to configure and start samba server in RHEL. As explained earlier, the more detailed the steps, the better.

th_matt,

Actually there is no better and easier way in learning Samba or other unix networking than through reading a well written tutorial. You can download a good Samba Tutorial here.

Hope it helps. Good luck.

Kenzor 12-06-2009 08:18 AM

I recently set up a samba server myself for a college assignment on a CentOS system, which is a clone of RedHat, and I documented my steps, I'll share them with you.

1) install samba and set it to start automatically after every reboot
# yum install samba
# chkconfig --level 2345 smb on


2) open up the appropriate ports in the firewall

# iptables -I INPUT 1 -p udp --dport 137 -j ACCEPT
# iptables -I INPUT 1 -p udp --dport 138 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 139 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 445 -j ACCEPT
# iptables -I INPUT 1 -p udp --dport 445 -j ACCEPT
# service iptables save
# service iptables restart


Why so many ports? The smb protocol depends on a lot of stuff, including Netbios, which is Microsoft's way of tying computer names to an IP address.

3) the /etc/samba/smb.conf configuration file
The assignment required I shared 2 folders, one read-only, and one with writing permissions.
I also had to secure the /shares/Public/upload folder so only the user "student" could access and write in it.
If you want to use password authentication too, you have to add a user to samba (substitute student with your user name):

#smbpasswd –a student


Code:

# vi /etc/samba/smb.conf
        #======================= Global Settings======================
        [global]
                workgroup = MYGROUP
                server string = Samba Server Version %v
                netbios name = NAS
                hosts allow = 127. 10. 168.
                security = user
                passdb backend = tdbsam
        #====================== Share Definitions =====================
        [Public]
                comment = Public
                path = /shares/Public
                public = yes
                guest ok = yes
                writable = no
                printable = no
        [upload]
                comment = upload
                path = /shares/Public/upload
                public = yes
                guest ok = no
                writable = yes
                printable = no
                valid users = student

The lines "security = user" and "passdb backend = tdbsam" make sure you need to log in with a valid user account to access the share.
The line "valid users = student" makes it so only student can access that particular share.

4) SELinux settings
This is emportant, RedHat systems use Security Enhanced Linux, and it won't just let samba share folders without direct orders from root.
(make sure to replace the "/shares" part with the folder you want to share)
# semanage fcontext -a -t samba_share_t "/shares(/.*)?"
# setsebool -P samba_export_all_rw on


5) accessing the shares
Start up the samba service (we set it up to start after a system reboot in step 1, but it's not actually running yet right now).
# service smb start

point your windows explorer to \\ipaddressofyourlinuxserver

You should see a folder for every share definition you made, in my example, a folder called Public and one called upload, even though in reality upload is inside Public.


I think I have provided you with a complete but minimal list of things to do to get samba working, I hope it helps.

Good luck!


All times are GMT -5. The time now is 10:55 AM.