Getting Help
SourceForge.net Logo


Man pages

Content-type: text/html


Section: Applications/Network (1)
Updated: January 1, 2008
Index Return to Main Contents


ws (WinShares)- automates mounting of samba and windows shares using CIFS  


ws [options] [on | off]
ws [-V | --version] [-s] [-h | --help] [-al] [-a [authfile]] [-ax [authfile]] [-c] [-cx]
ws [-q] [-i] [-U] [--debug] [-u username] [-p password] on
ws [-f] [-q] off



ws is a shell script that works in text mode (no need for      graphical interface) and is used to automatically mount and unmount windows and samba shares using CIFS.

A configuration file can be shaped to each user (see man ws.conf)
Ws needs sudo, mount.cifs and umount.cifs (included in samba package) to run.
For security reasons, only non-root users can use ws.
Root is allowed to run exclusively ws-install, ws-uninstall, ws-auto and ws-confsudo

ws on - mounts the shares
ws off - unmount the shares

ws on command forces the user to enter the password to authenticate against samba server.
The authentication (username and password) can be automated creating an authentication file ( -a option).
To bypass the auth file use the -u and/or -p options (ws -u name -p pass on)
Several optional authentication files can be created to automate distinct servers with different authentications (ws -a server).
The -U option allows to automate mounting the shares during login and unmounting during logout.
If you are working in a text mode environment, add the command ws -U on to user's file .bashrc, and the command ws -f off to .bash_logout.
Then, the user who wishes to mount automatically, have to change the configuration file option AUTO="yes".
If you are working in a graphical environment with GDM (Gnome Display Manager), you can run the command ws-auto on and change the configuration file option AUTO to "yes", in each user you want to automate mounting.
A new directory named WinShare is created in user's home directory hosting the mounted samba and windows shares. If you are in a graphical environment, a WinShare soft link in Desktop is automatically created.
This name may be changed in the configuration file (see man ws.conf)  


-f off
= Force unmount. Only valid with "off"
= Interactive. Bypass the authentication file allowing to enter name and password
-a [file]
= Authentication file creation. Optional authfile name
-ax [file]
= Authentication file deletion. Optional authfile name
= Authentication files list
= Configuration file creation or edition
= Configuration file deletion
= Input username manually without using authentication file
= Input password manually without using authentication file
= Automatic apply of login user in setup scripts.
= Status (default).Output authentication file and mounted shares
= Quiet. Do not write anything to standard output. Only to logfile.
-V | --version
= Version
-h | --help
= Help
= Debug mode.Verbose messages with line number.



ws on - mounts shares with username and password contained in the authfile. If authfile doesn't exist it asks for the actual unix user password. If there is a /etc/ws.conf file, with the option override=1, all mounting is based on that file. If override=0 in /etc/ws.conf, all mounting is based in the user configuration file (~/.ws/ws.conf).

ws off - unmount shares and delete directories created for the effect.

ws - is the same as ws -s. It shows if the configuration file is owned by the user or by the system. If a default authfile exists, how many shares are mounted by this user, and the shares list. Shares mounted by other users are not showed.

ws -i on - Bypass authfile, asking for username and password instead of using   authentication file.

ws -a - Creates a new default authentication file. It asks for username and password to be entered.

ws -a name_auth - Creates a new authentication file with any name you wish. This is different from the default one. This authfile can be linked to a server or share in the ws.conf file, if for some reason the username and passwords are different from the default one.

ws -ax - Deletes the default authfile.

ws -al - Lists all user authentication files.

ws -ax name_auth - Deletes the optional authfile.

ws -c - Creates or edit the configuration file for the actual user. This option uses the default editor to open the ws.conf file. If there is a /etc/ws.conf (the winshares system configuration file), the user configuration file is copied from that one. If there is no system configuration file, it creates a hardcoded new file.

ws -cx - Deletes the configuration file.

ws -u name on - Mount the shares using a default username different from the actual user.

ws -u name -p pass - use a different username and password. This parameters are usefull to build a script.

ws -U on - This parameter is only used in a startup script. -U means the unix username. When loging in, it takes the unix username login automatically, searches the default authfile and automatically mounts the filesystem as configured in ws.conf. This command can be included in /etc/gdm/PostLogin/Default (or /etc/X11/gdm/PostLogin/default ). To unmount the shares when loging out, the comand ws -f off must be included in /etc/gdm/PostSession/Default. A command named ws-auto on can be used to automate the inclusion of those commands. ws-auto off delete these commands from those files. This command may not work in some distributions.  


ws.conf(5), ws-utils(8), mount.cifs(8), umount.cifs(8)  


M.Carreira Silva  


Report bugs to <mcls@users.sourceforge.net>.
Web: http://winshares.sourceforge.net/  


Copyright (C) 2007-2008 M.Carreira Silva.
Ws comes with NO WARRANTY, to the extent permitted by law.
This is free software and you may redistribute copies under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING.




This document was created by man2html, using the manual pages.
Time: 17:13:20 GMT, January 19, 2008

Winshares Copyright (C) 2007 M.Carreira Silva