Problems accessing Windows PC from Centos

Issues related to configuring your network
Post Reply
jeffw_00
Posts: 60
Joined: 2006/12/17 02:55:29

Problems accessing Windows PC from Centos

Post by jeffw_00 » 2011/07/29 21:37:38

Hi - I have a small network with my Centos 5.6 box and a Win XP PC on it. I can access the files on the PC from the Centos box by bringing up the RUN window (ALT-F2 in Gnome) and typing smb://192.168.1.X/C (where X is the address of the PC), and I get a window with the C:\ drive from my PC. I can then drag/drop files between the Centos box and the PC. Here are my questions:

1) I want to script the file transfer, so how do I do this from the command line?
2) On the PC, I have 2 drives C, and E. They appear to be set up the same, but the E drive looks empty when I do this using the interactive method above.

I found this tutorial http://forum.vectorlinux.com/index.php?topic=84.0, which seemed helpful, but I can't get my PC "visible" in the smbtree.

Really, I just want to write a script that does a backup on the Centos box and copies it to the E (External) Drive on the PC. Hopefully there is an easy way to do this (I'm a novice when it comes to administration)

Thanks!
/j

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Problems accessing Windows PC from Centos

Post by pschaff » 2011/07/31 19:49:57

No idea what's with the E: drive - perhaps a Windows permission issue.

You can mount the share[s] using cifs. See the example in the [url=http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html-single/Deployment_Guide/index.html]Deployment Guide[/url]. You can make an entry in /etc/fstab if you want it mounted automatically. Do "cat /etc/mtab" after mounting to get an idea what the /etc/fstab line should look like. After the shares are mounted they should be accessible with regular Linux command line methods.

Just copying files you are likely to lose file ownership and permissions on the PC filesystem. I'd tend to back up to tar archives which should preserve file attributes.

jeffw_00
Posts: 60
Joined: 2006/12/17 02:55:29

Re: Problems accessing Windows PC from Centos

Post by jeffw_00 » 2011/07/31 19:55:58

E drive turned out to have a poorly chosen sharename

As for my main question. I appreciate the pointer to the general manual, but if I could find what I needed there I wouldn't have posted 8-}
Anyway, I found a friend who knew the answer - as simple as

mount -t cifs //servername/sharename /mnt/foldername -o username=***,password=***,rw

Just thought i'd post so others don't have to go through what I was 8-}

/j

Kill_Switch
Posts: 1
Joined: 2014/11/14 15:49:40

Re: Problems accessing Windows PC from Centos

Post by Kill_Switch » 2014/11/14 16:05:46

I had the same Problem and i use the same command like you. Takes me a long time...

Now i want to mount the share automaticlly and i didn't get it work.

I tried an entry in the /etc/fstab

//server/hare /mnt_directory cifs username=***, domain=***,password=*** 0 0

When i boot the system they required a password and i tried the the root password of the system and the users password but i got an error.

Can i use the fstab to mount a cifs drive?

Regards
Lynn

Post Reply