Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (Not For Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (Not For Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 2nd May 2012, 03:18 AM
sea Offline
"Shells" (of a sub world)
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 37
Posts: 4,277
Lightbulb Script: Connect and Debug to Samba NAS


As some might have recently, i've had some issues to connect to my NAS.
Figured i made mistakes, but have learned a bit on the road, which the Fedora Community shall benefit from.
At least i hope its helpful

* Create a credentials file
* Connect to a single share on NAS, using cli.
* Mount all directory to local environment
* Easier debugging, collect data that helps you debugging.
* Change the default variables in the script, so you can just hit enter for your hardcoded default values -> easier re-usage.

For best results, and previous to first execution of the script:
  1. mkdir $HOME/bin
  2. chmod +x sea-samba.sh
  3. mv sea-samba.sh /$HOME/bin
  4. su
  5. yum install cifs-utils samba-client
  6. sea-samba

Once the credentials are created, its quiete easy to use:
Mounting all shares from NAS to local might look similar to this, whilst using sea-samba.sh mn
		sea's Samba script tool (0.5)
Moutning to /nas
Mounting:	//    to /nas/priv   	 done   
Mounting:	//     to /nas/pub    	 done   
Mounting:	// to /nas/TimeMachine     done   
Mounting:	// to /nas/Pictures        done   
Mounting:	//   to /nas/Music  	 done   
Mounting:	//  to /nas/Movies 	 done   
Mounting:	//   to /nas/Linux  	 done   
Mounting:	// to /nas/Backups         done
Where the 'main' menu looks like:
Domain=[OGOG] OS=[Unix] Server=[Samba 3.5.6]
Domain=[OGOG] OS=[Unix] Server=[Samba 3.5.6]
		sea's Samba script tool (0.5)
1) Exit
2) Single connection to 1 share on "ocean"
3) Mount all shares on "ocean" to "/nas"
4) Debug 
5) Edit: /etc/samba/smb.cred
6) Edit: /etc/samba/smb.conf
7) Edit: /etc/samba/nas.conf
Have to cut out the "help-command"-part as its too large...
for arg in $@
do 	if [ "h" = "$arg" ] || [ "-h" = "$arg" ] || [ "--h" = "$arg" ] || [ "--help" = "$arg" ]  || [ "-help" = "$arg" ]
cat << EOF
    There are no arguments required.
    Simply edit the variables in the script and/or
    provide the information to create the configuration
    and credential files.
    These files will not only ease the use of this script,
    but are also more secure (credential) than using those
    values as plain text (hard coded) in your scripts.
    If you need root access, it is suggested to use a term like:
      *)       su -c /path/to/sea-samba
      *)       su -c sea-samba
    To perform action right from the command line use these arguments:
      *)	mn	= 	Mount Nas ; Connects to your NAS,
      				if not root a password is required
      *)	co	= 	Connect to Share
      				Reads the shares on the NAS and ask you to
      				which you want to connect.
    If you have any ideas to improve this script, 
    find bugs or a solution for them, feel free to send me an
    email to: < erat.simon AT gmail.com > ... with the subject "samba".

Attached Files
File Type: sh sea-samba.sh (10.3 KB, 198 views)
EFI Cheatsheet :: http://forums.fedoraforum.org/showthread.php?t=298546
Video Handler Script (VHS) (mass re-encode videos, screenrecorder, console music/webradio player, ...) :: http://forums.fedoraforum.org/showthread.php?t=299182
Windows 8+ & Fedora 20+ Dualboot :: http://forums.fedoraforum.org/showthread.php?t=298161

Last edited by sea; 16th May 2012 at 10:55 AM.
Reply With Quote

connect, debug, nas, samba, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple script problem OR need to debug WPA? Dunhausen Using Fedora 0 17th December 2006 12:00 PM
cannot connect to mysql with php script? shams Using Fedora 3 29th April 2006 02:02 AM
MYSQL won't let me connect from PHP script Sail@ Servers & Networking 13 16th October 2004 01:46 AM

Current GMT-time: 06:58 (Thursday, 24-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat