Copy to Windows hidden share


 
Thread Tools Search this Thread
Operating Systems AIX Copy to Windows hidden share
# 1  
Old 06-21-2017
Copy to Windows hidden share

Hi,

I need to find a solution for backing up/transferring BACKUP (dump file) from AIX (specifically) to Windows 2012 Hidden Share.

The vendor says that he cannot do a copy from his system to hidden share because it requires a password...

Personally, I think that there should be a solution (probably simple). I am not a Unix expert but cannot believe that in 2017 the password for Windows hidden share could be an obstacle.

Currently, we have an awkward solution and using Backup to tape for this system. We need to be able to copy first to DISK.

I did a quick search and found a way to do it from Linux... (didn't look closely yet).

Want to ask forum for a pro solution for the question if exists.

Thanks.
# 2  
Old 06-22-2017
Not an AIX man, but do you have / can you use smbclient on your AIX installation ?

You will have to provide a user / password to connect and copy file to windows, either directly or via files etc.

Hope that helps
Regards
Peasant.
# 3  
Old 06-22-2017
What exactly did you find that works on Linux? Maybe we can help you implement equivalent functionality on an AIX system.
# 4  
Old 06-22-2017
You might want to install the cifs filesets, if not already done and try it out.

Here are two pages from IBM about cifs:
1. IBM Knowledge Center - SMBFS mounting

(scroll a bit down on the next one)
2. IBM How to export a share in Windows and mount the share on AIX using CIFS.
# 5  
Old 06-22-2017
Hello,
first thanks to all for trying to help...

to Don Cragun:

here is a link to Linux instructions:
geekyboy.com/archives/200
NOTE!:
My TrendMicro agent produce an Alert about blocking a further link from this site as malicious...
Most probably false positive... but just in case if you don't want to touch the link I copy- paste the text from the blog.

I don't manage the server (it is vendor's ). I will greatly appreciate if somebody can really test a copy to hidden share on Windows (2012) and provide the exact workaround/instruction...

Here is a quick suggestion from an another forum:
*********************************************************
I don't think the password is the problem. I think the admin just needs to escape the "$" in the hidden share with a backslash. e.g.
Code:
mount -t cifs //server/hiddenshare\$ -o username=adminUserName,password=myPassword /mnt/srvshare

*******************************************

and here is a text from the blog (from site with an alert)

Backup files from Linux to a Windows server
Ok, this may be my last disaster recovery and backup blog for a long time. As you can probably tell from the title this blog entry is all about keeping backup strategies as cheap as possible.
My strategy is to backup all of my Windows and Linux servers to one central Windows server that is running a Tivoli backup agent. All of my servers are hosted elsewhere, and since it costs $99.00 per server to backup I am getting the most for my money by only backing a single server to tape/SAN. However that single server carries all of the files that need to be remotely backed up to tape/SAN.
My earlier posts show how to backup the Windows servers:
Windows backup bat script using xcopy
Also, how to backup the Windows Domain Controller:
Backup Windows Domain Controller using NTBACKUP via cmd
And I also showed how to backup a Linux server to a local file:
Linux backup using CRON to local directory
Now I will show how I moved the files backed up on the Linux servers to the Windows server prior to tape/SAN backup. I have decided to use Samba and mount a directory pointing to a shared folder on the Windows server. Lets begin:
Create a share on the Windows server to use as your backup location.
Create a user to use this share, and give the user permissions to use it.
Pick, or create, a user that you’re going to use to backup the files. Log in as this user and type ‘id’ to get the numeric ID of the user in the Linux OS. (You will need it later.)
Become ‘root’. (This will enable you to perform the next tasks without problems.)
Install samba and samba-client if they are not installed yet.
Code:
yum install samba
yum install samba-client

You will need to answer ‘y’ to when prompted.
By default only the root user can mount or unmount a cifs, so we must open it to other users.
Code:
chmod 4755 /sbin/mount.cifs
chmod 4755 /sbin/umount.cifs

Now we need to make a directory to use as our mount point.
Code:
mkdir /mnt/sharename

To enable our desired user to mount and unmount this we need to assign ownership to that user. Changing permissions with chmod is not enough.
Code:
chown userfrom#1 /mnt/sharename

Now we need to edit the /etc/fstab file and add an entry. Replace the user ID of 500 with your user ID from #1. Replace sharename with your Windows share name. Replace WINDOWSHOST with your hostname or IP address. If you don’t know the shares run
Code:
smbclient -L WINDOWSHOST //WINDOWSHOST/sharename /mnt/sharename cifs credentials=/root/smblogin,uid=500,noauto,user 0 0

Create/Edit a file /root/smblogin and put the following two lines in it.
Code:
username=WINDOWS USERNAME
password=WINDOWS PASSWORD

Now we must give our user from #1 access to the file, but still protect it.
Code:
chown userfrom#1 /root/smblogin
chmod 600 /root/smblogin

If you have IPTABLES active on your server you will need to make sure to add a policy to allow OUTPUT port 445.
Log in as the user from #1
Try to mount the share:
Code:
mount /mnt/sharename
ls -la /mnt/sharename
umount /mnt/sharename

If that was successful you are now ready to write a script that will automate the moving of your backup files from the Linux to the Windows share. (Script/File = backup.sh)
Code:
#!/bin/sh
mount /mnt/sharename
*
cp -r /path/to/file.tar.gz /mnt/sharename/path/to/file.tar.gz
*
umount /mnt/sharename

Of course you can add this to the end of the file described in Linux backup using CRON to local directory which would create a complete solution for backing up files, then relocating them to a remote Windows server.
Next you will add an entry to the crontab of the user from #1 to happen automagically.
Code:
crontab -e -u userfrom#1

Enter this into the crontab.
Code:
# Backup at 1:00 A.M. every day. Call 'man 5 crontab' for more information
* 1 * * * /path/to/backup.sh

Now once this is all done you can rest a little bit easier knowing that your servers are backed up. Published by

Last edited by rbatte1; 06-22-2017 at 12:48 PM.. Reason: Added CODE tags to make it more readable
# 6  
Old 06-22-2017
I realize that I'm coming to this thread very late. I'm not an AIX man either but I've had a few confrontations with accessing MS-shares from Unix/Linux/whatever boxes. Before I post anymore, I must state that everything I write is purely generic Unix speak and NOT AIX specific.

1. Usually, the MS admin creates a share (hidden or visible) with the Unix users username and password. Then the Unix/Linux user simply logs in and his password is transmitted to the MSbox to access the share.
2. The Unix admin installs an SMB client and declares (adds) the specific Unix user as an SMB user.
3. At this point you would expect a connection to the MS share to work BUT IT Doesn't. The reason is that the SMB password to be transmitted to the MSbox has to be hashed in (typically) '/var/smb/smbpasswd' but when you look in there, that users hashed record is not there. However, now the Unix box is aware that the user is an SMB client user, if the sysadmin (or the user themselves) resets that user's password with the 'passwd' command (even if it's set to what is was already), the hash will be put in '/var/smb/smbpasswd' file. It miraculously appears. Until that hash is in the smbpasswd file there isn't a hope in hell of it working.

As I said, this may or may not be relevant. Others subscribed to this thread may know better but I just thought I'd chip in with that.

Best of luck.
# 7  
Old 06-22-2017
From all the above answers I understand that it is not a trivial task... and probably our AIX application vendor is right...
Since I asked the question about copying files from AIX to Windows HIDDEN share you are trying to give some advises...
Let me ask the question another way...
Finally, the goal is to have AIX files available for backing up by VEEAM. That currently backing up 100+ VMs servers from ESX to StoreOnce HP storage (backup to disk)...
I need to have AIX data on the same DISK Storage
I just got couple of ideas...

1. I guess that there should not be a problem of automating file copy from AIX to LINUX
VM. If this is not possible than I give UP Smilie
2. If the 1 is correct, than the problem is solved. I will have have a Linux VM on ESX containing AIX files that could be easily restored or pushed to Tape library for off site purposes.

Another thought...
is it possible to create a task that will run PSCP for transferring files from AIX to WINDOWS machine? I used this not once from Linux machines in the past. Remember that actually credentials were used.

It should not be pushed from AIX. I need to find a way to pull it may be from Windows or Linux machine.

May be better suggestion in this direction?

Thanks all.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync - how to copy hidden folder or hidden files when using full path

Hello. I use this command : rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command. And no full source directories are in use, only some files. Source example... (2 Replies)
Discussion started by: jcdole
2 Replies

2. UNIX for Beginners Questions & Answers

Copy files to samba share Ubuntu 14.04

I am trying to use mv or cp rsync to copy folders to a samba share. I can manually copy the folders to the share, but can not seem to access it using command line. Thank you :). smbclient //path/to/cifs/share <password> -W <domain> -u <user> WARNING: The "syslog" option is deprecated... (2 Replies)
Discussion started by: cmccabe
2 Replies

3. UNIX for Dummies Questions & Answers

Windows Share

Hi guys I have some Windows Shares and I need to mount those shares on my Suse 10 SP3 I would like to know how to mount those? do I need to enable Samba? or is it just a simple mount command? thanks a lot (2 Replies)
Discussion started by: karlochacon
2 Replies

4. Shell Programming and Scripting

Script to copy User home folders to mounted windows share

First of all, let me state that I am a windows admin. I have a windows share mounted to /mnt/server I need a script that will either login as sudo or perform commands with sudo rights. I need the script to copy all of the users /home folders to the mounted windows share. Now If I can... (7 Replies)
Discussion started by: EricM
7 Replies

5. UNIX for Advanced & Expert Users

windows printers share

Hello, My network environment is: The server is Linux, all the clients are win2000 professional, the PC names are(ws00201, ws00202,ws00203,ws00204,ws00205,ws00206,ws00207,ws00208,ws00209), I have 3 printers connected through USB to ws00201, ws00204,ws00207, I want ws00201,ws00202,ws00203... (1 Reply)
Discussion started by: truelyli
1 Replies

6. AIX

Need help with Windows Share please

I have a windows 2003 server with services for unix installed I have create a folder c:\nfsshare and set it as an nfs share named nfsshare. now I am trying to mount it from my aix system using mount <server ip>:/nfsshare /mnt the filesystem mounts , but I cannot change into /mnt, I get a... (4 Replies)
Discussion started by: bbbngowc
4 Replies

7. IP Networking

how to share with windows

i m using Linux Mint on my computer and i m the server of shared Internet connection with windows machines. Internet sharing is working well with all the machines but file sharing is not working well. I can access the shared folders of other system with windows machine the windows machines cannot... (1 Reply)
Discussion started by: giri.nitp
1 Replies

8. UNIX for Dummies Questions & Answers

how to copy hidden files from one folder to another

dear all, i want to copy all files in my home dir to another. from my home dir i have given ls -la then some hidden files are there with dot . .. and i also want to copy all dirs in my home as it is . because iam upgrading the system how to copy all files and dirs in my home dir... (1 Reply)
Discussion started by: rajan_ka1
1 Replies

9. UNIX for Advanced & Expert Users

recursive copy of hidden files

I need to know how to copy hidden files recursively? cp -r sourceDir/* targetDir/. ignores the hidden files. Thank you!! (2 Replies)
Discussion started by: usfrog
2 Replies
Login or Register to Ask a Question