Windows 7 has a twisted sense of security

I’ve got some lecure materials to sort out for Monday so I’ve booted into Windows to use Office, and thought a bit of music might be in order. So I access the NAS and noticed that I could quickly tidy up the letter E section of my music by dragging one folder into another – and then this:

Windoes 7 - yo safe!
Windows 7 – Safe!

Thanks for protecting me from moving a folder of mp3s there champ. And especially for the informative warning message specifying the nature of the problem.

It turns out that the issue is that windows is treating your intranet like the Internet and not trusting it, and you can fix this up by either twiddling the “Internet Options” of Internet Explorer or simply removing Internet Explorer entirely. The entire process takes less than a minute, and there’s a good guide on how to add your NAS to the known intranet addresses here: http://robotbutler.org/article/30.

Finally, as tempting as it is to remove IE entirely, might I suggest that this might not be a 100% wonderful idea (95%, yes..) because some (specialist / rubbish /silverlight-lovin’/ virtual-app-on-demand-type) websites will only work with IE, and if you really need to use one and don’t have it installed you’ll be miz.

How To: Force Windows to Forget a Network Share Password

When you connect to a NAS in Windows, it will often helpfully remember the username and password of the NAS account it got access through. Forever. So, if you want to log into the NAS as a different user, well – tough. Windows already has a working set of credentials, and by jingo it’s gonna use them. The fix? From the command prompt, enter:

This will get rid of all connected share credentials, however you may want to just get rid of the credentials for a specific share. If so, you can use:

For example, the get rid of the credentials for the “Code” share on my NAS:

Now, to map the share to a drive and give it the credentials YOU want Windows to use, go with:

So, if I wanted to map the Code share of my NAS to the Z: drive, and access it with a user called bob who has a password MyClevahPass123, I’d use:

Done & dusted.

Please Note: The credentials you supply must be the username/password of the user the SHARE knows to grant access to, not just your own Windows username/password. Just clarifying =D

How To: Mount a NAS in Linux (via CIFS)

Apparently CIFS is the new Samba, so to mount your NAS via CIFS instead of Samba, read this, then change the fstab line to:

i.e. For me it’s:

You might notice reference to a .credentials file above. You need to create this!!

The format of the credentials file [you can call it anything & place it anywhere – just make sure you point to it in the fstab lines(s)] is:

So stick the above two lines in a file, substituting appropriately for the accounts and passwords on your NAS, then sudo chmod 600 it and remount the filesystem with sudo mount -a.

Job’s a good ‘un!

Update: Don’t forget – you’ll need to have samba, smbfs and cifs-utils installed for this to work! So go nuts with:

How To: Mount a NAS in Linux (via Samba)

Rehaul: CIFS is the new Samba – and while the below is still a good way, CIFS seems to be the way & the path – so glance at this lot to get the fundamentals, then read this article to change to mounting your NAS via CIFS.

First, get samba with the following command: sudo apt-get install samba smbfs

Now, create a folder to use as your mount point on your linux drive (I’m using /mnt/NAS – you can use whatever you’d like): sudo mkdir /mnt/NAS

Then edit your /etc/fstab file with: sudo gedit /etc/fstab

On my NAS I have two separate shares, one of which is called (unimaginatively enough) Share, so I’m going to add lines to /etc/fstab in the following format:

So  –  for my own personal setup, and because I’ve already created a username and password on the NAS [via the NAS’ web interface – available at http://IP-OF-YOUR-NAS] called r3dux, I’d put:

There are other ways where you don’t have to put your password in plaintext in the fstab file, but as long as you’ve got it set to read/write only by the root account, no one else can even look at the file to read the password. To set permissions that way, just use: sudo chmod 600 /etc/fstab

Which gives read and write permissions to root, but denies groups and any other users any access whatsoever (even just looking at!)

Job done.

Update: When mounting a NAS there are two user acounts you’re using: 1.) Your linux user account which goes in the uid and gid fields, and 2.) The NAS user account (which is set up from the NAS’ web interface) which goes into the username and password fields.

So if you want to have write access to the NAS, then you’ll need to set up a user account from the NAS’ web interface | Users sections, and mount the NAS as the user the NAS knows about with required privileges. In the fstab line above we’re mounting with user (uid) and group (gid) permissions set to 1000, that is user id 1000 (the id number of the first user on a linux system) [your user id can be looked up in /etc/passwd] and group id 1000 (i.e. the first user on a linux system [in my case my own r3dux group] – your group id can be looked up in /etc/group) – if you want to use other users/group to mount as, feel free.

Update 2: Forgot to mention that this will mount the NAS on reboot, to force a mount using the fstab details you’ve just entered, simply run the command sudo mount -a

Update 3: Fixed the above uid/gid mentions to NOT say anything about linux file permissions – it’s user and group identifiers to mount the NAS by, and NOT standard linux file permissions, mea culpa – fixed.