Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, April 6, 2012

CIFS Share Mount as non-root


Trying to run smbmount as a non-root I received the error:

mount.cifs: permission denied: no match for...

Option 1 - Permanent:


Set this up in fstab would be a permanent solution on every boot.
Add a line like this to your fstab file.

Open Share:

//server/path/to/share /mount/point cifs dir_mode=0775,guid=1000 0 0

Protected Share:

//server/path/to/share /mount/point cifs credentials=/root/.smbpass,dir_mode=0775,guid=1000 0 0

For a protected share, create the file /root/.smbpass Add these lines to the file.
username={username of server}
password={password}

 

Option 2 - Temporary:


For me, my laptop moves around in many server environments so I use a more flexible method that does not auto-mount on boot.

If using Ubuntu you can use the "Connect to Server" under "Places" but I prefer using the following command.  I find it is simpler and quicker.  Either method you choose, once connected you can create a bookmark in nautilus allowing easier re-mount by selecting the bookmark.  You only need to decide whether to permanently store the share password or ask for it on each mount.

Open or Protected Shared:

gvfs-mount smb://server/path/to/share

If the share is protected you will be asked for:
User [localuser]: {username of server}
Domain [WORKGROUP]: {server domain of user account}
Password: {password}

This will add the share and allow you to unmount it without using root.


Additional Information:


Shares goto ~/.gvfs by default but you can always map them to another area if needed.

Friday, November 6, 2009

Stopping pop-up asking to "Unlock the default keyring"

A nice benefit when installing a GNU/Linux distro is to setup a separate partition to mount the Home directory.  This is nice because you can re-install an OS (or install a different distro) without effecting your documents, music, configuration and such.

Although you can sometimes run into a situation where your keyring has a password mismatch.   If you know the original keyring password you can change it.  If you do not there is no way to reset it but you can rebuild it.

What is a Keyring?  A keyring is database that contains all your passwords (wpa key included). For other application to use your keys/password in your keyring they will ask your keyring for them, if your keyring is locked you will be requested to unlock it.

How do you rebuild the keyring?
Pull up a terminal window, and type these command

rm -rf ~/.gnome2/keyrings
rm -rf /tmp/keyring-*
rm -rf /tmp/orbit-$USER

reboot your system (restarting X would do but this is easier)

When you are back in gnome you will be ask enter a password to lock your
keyring. enter a password and remember it.  This password can be the same as your login.

Sunday, March 1, 2009

OpenBox - Setup Laptop Volume Keys

First you need to verify that your keys are mapped properly.

Run xev and press each of the volume keys:

Example:
   $ xev
Volume Down Results
   KeyRelease event, serial 32, synthetic NO, window 0xc00001,
      root 0x7d, subw 0x0, time 100213680, (-194,56), root:(229,367),
      state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume),
Volume Up Results
   KeyRelease event, serial 35, synthetic NO, window 0xc00001,
      root 0x7d, subw 0x0, time 100214182, (-194,56), root:(229,367),
      state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume),
Volume Mute Results
   KeyRelease event, serial 35, synthetic NO, window 0xc00001,
      root 0x7d, subw 0x0, time 100214715, (-194,56), root:(229,367),
      state 0x0, keycode 121 (keysym 0x1008ff12, XF86AudioMute),
The keycodes are required if you are planning to use programs such as xbindkeys and raw keycodes. For OpenBox in CrunchBangLinux I did not need to install another package. I simply had to configure the OpenBox rc.xml file using the following key names:

XF86AudioLowerVolume, XF86AudioRaiseVolume and XF86AudioMute

Here's how:

Open file ~/.config/openbox/rc.xml with your favourite editor.
   $ nano ~/.config/openbox/rc.xml
Find </keyboard>

Example:
   ... 
    <keybind key="A-C-q">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>
  </keyboard>
Paste in the following lines between </keybind> and </keyboard>.
   <keybind key="XF86AudioRaiseVolume">
    <action name="Execute">
      <execute>amixer set Master 1+</execute>
    </action>
  </keybind>
  <keybind key="XF86AudioLowerVolume">
    <action name="Execute">
      <execute>amixer set Master 1-</execute>
    </action>
  </keybind>
  <keybind key="XF86AudioMute">
    <action name="Execute">
      <execute>amixer set Master toggle</execute>
    </action>
  </keybind>
Save and reload the configuration from Menu -> Preference -> Openbox Config -> Restart