[Nexus 7 General] jmtw000:
I upgraded to 4.3 from 4.2 and found I'd been SCROOGLED again. If any Google android developers happen upon this thread, I would really love an explanation as to exactly why we aren't allowed to use CIFS (and other external filesystems for that matter) out of the box. It doesn't really make much sense...unless you're trying to force us into using your stupid cloud services and to purchase media we already own from the Play store. You really wouldn't be trying to do that now would you? Anyhow, I had CIFS mounting working great under 4.2 by using a local connection to ADB and scripts to replace /system/bin/mount and umount. But, after going to 4.3 I found that not only did those googley bastards remove loadable module support from the kernel, but they also "jailed" ADB in their stupid namespaces. What that means is that it is now absolutely impossible to get CIFS working using the stock kernel and ADB. Thanks a lot Google! A thousand curses upon you and your progeny!

So, to get around this mess I've compiled the latest grouper AOSP kernel using the default config and added loadable module support. I've also compiled the CIFS, md4, nls_utf8, and configs (they removed the /proc/config.gz in 4.3. Why?) modules. Then, I built sshd, ssh, and ssh-keygen from the Android source. The paths were all messed up for the ssh client with the default configuration, so I changed them. It's set so sshd stores it's configuration and keys in /data/ssh, and the client uses /data/.ssh. I ran into some weird issues with the libcutils.so library which sshd is linked to. It doesn't come with Android by default and it seems if I install it to /system/lib it breaks everything and the tablet won't even boot. So, I just statically linked it to sshd. I also altered the /init.rc script to start the ssh daemon and created mount and umount scripts which simply ssh to localhost and run the mount/umount commands through busybox with whatever arguments they're given. The scripts replace the /system/bin links and the mount script creates /cifsmnt/0-9. You can change this if you need more mount points by editing the mount script. Since sshd is started by init outside of dalvik and ADB we don't have to worry about the stupid private namespaces. I'm now able to mount my CIFS shares again and actually use them from all applications. Instructions are below.

DISCLAIMER: This worked for me, but I'm making no guarantees. If you have weird issues, lose data, brick your tablet, whatever; I take no responsibility for it.

1. Download one of the two update .zip attachments below. One contains the kernel and modules I've built. The other just has the altered /init.rc, ssh binaries, libssh.so, and mount scripts. If you would like to use a different kernel than the one I've compiled, use that one. I haven't tested it, but it should work as long as the kernel has CIFS/md4/nls_utf8 modules/built-in. Just save the .zip to your tablet and install it from recovery.

2. When your device boots back up, start a shell and run:

su
ssh localhost

It will ask if you want to continue connecting. Enter yes. It will fail to connect, but that's OK.

3. From the same shell run:

ssh-keygen

This will create the public/private RSA keys.

4. From the same shell run:

cat /data/.ssh/id_rsa.pub >> /data/ssh/authorized_keys

This will allow the user root to open a local ssh session without a password (they aren't even supported under Android anyhow)

If you use Cifsmanager and are using my kernel (other kernels may not need to load modules or the modules may be kept in a different path):

5. In CifsManager's settings, check "Load cifs module" and "Load via insmod". Then set "Path to cifs.ko[:<modpath>]*" to:

/sdcard/modules/cifs.ko:/sdcard/modules/md4.ko:/sdcard/modules/nls_utf8.ko

6. Create your share in CifsManager and under options put:

rw,file_mode=0777,dir_mode=0777,uid=1015,gid=1015

(and any others you may need) . For the mount point, use one of the the mount points created under /cifsmnt (0-9).