Script to mount nas-share using generated credentials (mount EC 13,32)
Heyas
At home i have 1 nas with 3 shares, of which i used to mount 2 of them using a script with hardcoded password and username in it.
EDIT: Turns out, its not the script, but 'how i access' the nas share.. (-o user=XY,password=... VS. -o credentials=...).
Figured about credential files, on a home computer, i tried to match this task into a script.
Idea is to provide all infos at the first time, like:
In practice, it mounts the public one, but wont the private one (error codes: 13 & 32).
The 2 handling scripts are these: umount-nas:
mnt-nas:
During the 'tests' both shares have the same password, but for some reason, one gets mounted the other not.
The actual script is: mount_nas
PHP Code:
#!/bin/sh export LC_ALL=C # # Author: sea (Simon Arjuna Erat) # Contact: erat.simon@gmail.com # Created: 2014.17.11 # Description: If all required variables (2-3) are provided, it creates # a credentials file which it'll be using at 2nd usage, # if you just pass the sharename of an already used NAS entry. # NOTE: There must be no identical names on diffrent NAS! # # Variables # ME=$(basename $0) source ~/.config/user-dirs.dirs script_version=0.1 hlp_txt="\n$ME ($script_version)\nUsage:\t\t$ME //IP/SHARE /mount/point [username password [domain]] \rExample:\t$ME //$(for STR in [a-z];do ip addr|awk '{print $2}'|grep ^$STR -A2|grep -iv ::|grep -iv 127|grep [0-9].[0-9].[0-9]|sed s,"/"," ",g|awk '{print $1}';done)/Public $XDG_PUBLICSHARE_DIR$USER ABCDEFG $(hostname|sed s,'\.',' ',g|awk '{print $2}')\n\nOnce configured, simply call:\n\t\t$ME SHARENAME\n\t\tWhere SHARENAME will be the credential filename, and was the full //IP/SHARENAME...\n" NAS_CFG_DIR="$HOME/.config/script-tools/nas" [ ! -d "$NAS_CFG_DIR" ] && mkdir -p "$NAS_CFG_DIR NAS="$1" ; MP="$2" ; CREDS=""
Trying to mount the 'missing' share manualy and the regarding credential file is looking like:
Any ideas apreciated.
Thank you in advance
- Simon
---------- Post updated at 10:28 ---------- Previous update was at 06:35 ----------
Just to be sure i'm trying to mount an existing share...
But its kidding with me...
Works like a charm, while
results in the 'plain and known error':
How the credentials file looks like is shown in the first post...
Of couse, password, username and domain are verified.
Anything i missed?
Any ideas please?
---------- Post updated at 11:15 ---------- Previous update was at 10:28 ----------
Also tried: chmod [644|400] /path/of/cred
As well as: ...,sec=[ntlmssp|ntlmv2,ntlm]
Digging deeper than google's 2nd page, reading the repeating solutions (if even) is quite disencouraging.
EDIT:
EDIT2:
I really dont get it
Both shares share the same uid/pw combination, they just differ by the Sharename.
Ok, the credential file is formatted incorrectly.. both times, but only one doesnt work.
If both would not work, i'd sure say its because i stored the full-adress (//IP/sharename) as well as the mountpoint (/home/sea/priv/nas).
But since 1 of 2 work, me back at the beginning... :clueless:
My HP-UX server currently mounts a directory on a Windows 2012 server. The Windows server allows anonymous connections for RW and this configuration has worked well for years. Now, due to tightening security requirements I can't use anonymous. I also can't setup Identity Mapping on the Windows... (5 Replies)
I need a help of good people with effective bash script to mount nfs shared,
By the way I did the searches, since i haven't found that someone wrote a script like this in the past, I'm sure it will serve more people.
The scenario as follow:
An NFS Client with Daily CRON , running bash script... (4 Replies)
The UPS connected to the Disk Array portion of my Windows 2003 NAS burned up over the weekend. Reconnected it to a new UPS and re-booted the NAS box. Since then I have not been able to get my HPUX 10.2 box to mount the shared drives on the NAS. At boot, the NFS client & server subsystems do a... (0 Replies)
HI
I would like to ask about my virtualbox 4.0.4 in my lucyd lynx box
My shared forlder isn't auto mount in my linux guest OS. And everytime i manually mount using command sudo mount -t vboxsf <shared_folder_name> <Guest_location> it throw an error msg "/sbin/mount.vboxsf: mounting failed... (1 Reply)
all,,i need help,,i try to mount a windows 2000 share folder to my system,,i already userd smb mount,mount -F and bunch of stuff and none is working,,can anyone give me a script to this??
PS : when i use mount -F i got this message :
nfs mount: insufficient privileges ,,,
is it must be root ? (6 Replies)
Hello,
I have a few Ubuntu 9.10 laptops I'm trying to learn NFS sharing with. I am just experimenting on this right now, so no harsh words about the security of what I'm playing with, please ;)
Below are the configs
/etc/exports on host
/home/woodnt/Homeschool... (2 Replies)
Hi, How can i mount an NFS share on a solaris machine a filesystem ?
I have enabled nfs on a windows server and the shares has given read/write access to it to all the users. I would like to mount it on around 10 different solaris boxes with different versions of solaris.
Thanks in advance. (2 Replies)
Hi,
I try to mount an external USB HD on a solaris 10 without any success.
Machine hardware: i86pc
OS version: 5.10
Processor type: i386
Hardware: i86pc
The HD is a zfs, but I installed this with a Ubuntu 8.10.
iostat -En displays this:
--> so the system... (0 Replies)
Hello,
I am having difficulty compressing the files using compress or GZIP utility on NAS share NFS mounted on my linux server. Any one have idea on how to do this ? I get the followign error but the trying to compress the files
STRP2> compress STR_OUTBOUND_CDM_LOG_LOB.PRT2008_26.txt... (1 Reply)
I've got a Sco 5.0.6 box and an Ubuntu box on my network. i want to backup certain directories onto a share on the Ubuntu box. how do i mount a linux share onto the Sco box? (1 Reply)