How to push files to windows server on a domain environment

If it doesn't fit in another category, ask it here.
Post Reply
V4705
Posts: 12
Joined: 2011/01/11 02:22:31

How to push files to windows server on a domain environment

Post by V4705 » 2012/06/04 09:11:31

Good morning!

I need to schedule a cronjob to push a folder from a CentOS box to a Windows server 2008 R2 (on a domain).
I'm really a newbie to linux administration and I'm not sure what are the right steps to make it happened.

Any tips/suggestions would be highly appreciated,
Thanks :-)

allamiro
Posts: 21
Joined: 2009/07/30 20:43:36

How to push files to windows server on a domain environment

Post by allamiro » 2012/06/05 21:25:08

I did some Googling for you

http://stackoverflow.com/questions/289760/automatically-copying-files-from-a-linux-machine-to-a-windows-machine

:-D

V4705
Posts: 12
Joined: 2011/01/11 02:22:31

Re: How to push files to windows server on a domain environment

Post by V4705 » 2012/06/06 21:56:58

Thanks for the reply, unfortunately my knowledge isn't good enough to understand what they're talking about...


I have 2 ideas of how to make it work in kind of an easy way:

1. Can I authenticate to active directory and mount a shared folder from server 2008 that doesn't have public access? (the linux box can get it's own domain user).

2. Can I share a folder on the linux box and access it with "windows explorer" (with no 3rd-party software) and protect it by password (no AD integration) OR give access to specific domain users (with AD integration)?


Please help me choose the easiest way, and if you can, please give me some basic guidelines on how to start doing that.

Many thanks!

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to push files to windows server on a domain environment

Post by TrevorH » 2012/06/06 23:20:42

You can use

[code]
mount -t cifs -o username=userid,password=X //your.windows.server.ip/sharename /mnt/windows
[/code]

That will mount the share on /mnt/windows with whatever permissions 'userid' has. The drawback to that is that if the share hangs it can produce some odd results. An alternative is to configure autofs to automatically mount the same share on that same directory on demand - so whenever anything looks at /mnt/windows you can have it mount the share for you. Using either of those two methods, you can use a credentials file to hold the username and password and chmod it 600 and owned root:root to keep it from being read.

An alternative might be to use the smbclient utility like this

[code]
/usr/bin/smbclient -U userid //192.168.1.12/Sharename password -c "put $thisfile"
[/code]

Last option, install, configure and use samba to provide a share on the Linux side of things.

V4705
Posts: 12
Joined: 2011/01/11 02:22:31

Re: How to push files to windows server on a domain environment

Post by V4705 » 2012/06/12 03:53:22

Thanks for the reply, TrevorH,
Are those commands supports Active Directory username and password? if so, where do I specify the domain?

V4705
Posts: 12
Joined: 2011/01/11 02:22:31

Re: How to push files to windows server on a domain environment

Post by V4705 » 2012/06/13 13:45:41

After the password=, I added domain=, and it's working great.

Many thanks!

Post Reply