Run a program off a Network Share - networking

I am trying to make a shortcut of some sort, hopefully a .desktop file, to run a jar file from a network share. I want to be able to do this without mounting the drive is possible. I've looked a few other posts on this site, and most talk about using Nautilus or some fileshare program to open a path to the file, but I want to be able to run the file from the network drive. Any help is appreciated.
I've been working on an alternative with a drive that mounts on login. The current setup I'm trying is to get a script to run at login using environmental variables. I've tried a number of the CIFS options, but nothing seems to work without prompting for the user's password.
My fstab file has the following:
//share.domain.com/folder /mnt/folder cifs noauto,users 0 0
I have a small shell script to mount it.
mount /mnt/folder
Is there any way to get the drive to mount without the user typing in their password? Note: this should work for multiple users on the system. So a credentials file isn't optimal.

Related

permission set in UNIX folder are not transmitted correctly to NFS share

we have a NFS share where folder in unix are mounted over a NFS windows server.
even after setting the permission to 775 on unix machine for some folder.
The same does not reflect when files are created in that folder by some java process.
so we have a folder like /nobackup/stream on unix machine mounted on nfs server
permission on unix machine
ls -ald /nobackup/stream
rwxrwxr-x owner group
we have an automation process writing result logs and sub directories to stream folder
for some weird reason the files are getting created with permission
rwxr-xr-x owner group
i.e write access to group is not present.
This is causing our automation to fail when at certain places a process running with group user privilege tries to update the files created with above permission
Initially the suspect was umask
so we set umask to 0002 in the perl process which starts automation
that did not help
Files.mkdir is being used to write the file
here the posix permission is correct ,umask is correct still the new files are not getting created with correct permission
also note that automation runs under cygwin shell if thats causing the trouble
How can I ensure that file permission is always set correctly
The problem is that the automation is running in cygwin. Those files are still written by the Windows NFS client, which has no clue how to interpret the permissions set in cygwin.
You need to set the default permissions in the Windows NFS client. You can do this from the command line with nfsadmin. Something like:
nfsadmin client [ComputerName] fileaccess=664
Source: https://technet.microsoft.com/en-us/library/cc754304(v=ws.11).aspx

Samba Share directory outside user directory

I set up a machine with Ubuntu 14.4.1 yesterday and I am trying to use it as remote storage for a project I am working on remotely with a few people. I know nothing about hosting servers, so I am attempting to avoid the issue entirely by just treating it like a local area network using Hamachi.
The Ubuntu machine has 2 hard drives - a boot drive on which Linux is installed and a larger data drive. I am attempting to share a directory on the data drive via samba so that it can be accessed via Hamachi by windows 7 machines.
I am able to see the directories that I have shared, but when I try to enter them, I get a permission denied error. When I share a directory within my /home/user/ directory, it works fine. Is there any way that I can share a directory on my data drive?
Perhaps I could make a symbolic link from my user directory to the data drive? Would that actually work? I am not familiar.
If it is NTFS, you can't change the permissions, which will be the issue.

Creat .BAT to copy a .mdb from network drive to local C:/

I hope I can get some help with this from someone here on this awesome website.
Im a complete noob when it comes to writing batch scripts and I would really like some help.
My situation..
I currently have a network drive on a PC running Windows Server 2008. The drive letter is I:/
within the I-drive, I have a folder named aaaaeast and within that folder is all of my .mdb's
I would like the .bat to copy a specific .mdb from I:/aaaaeast/ to a XP SP3 machine I have in the other room on startup.
Ive tried
copy \myserver\myshare\myfolder\myfile.txt c:\myfiles
But it fails to find the network path.
I know this is got to be a permission issue. My network doesnt have a domain and all the PC's I map to the I:/ map through the Guest account on the Win 2008 server using (username: Guest with no password)
Can someone please help or point me in the right direction.
Ok, this works for me where I work. There is a mapped drive to the location where the master .mdb is.
That is "i:\" drive.
copy i:\ets\lead\software\paint\leadmain.mdb c:\paint
it copies the .mdb to the "c:\paint" drive on the computer where the client clicked on the .bat file. It has been a while so I can't remember where the .bat file sits. Pretty sure it is on the client's computer.
Open Notepad, add the code above, and save making sure to pick the option "All files" down below. That way you can change the extension to .bat from .txt.
copy \\myserver\myshare\myfolder\myfile.txt c:\myfiles
Note: double-backslash
A UNC path (path to a network resource) requires that the target computer name be preceded by two backslashes. Otherwise, starting with \ means "start at the root of the current drive". (Perhaps this was just a typo in the post—that wouldn't cause an error 53.)
Regarding accounts, Windows doesn't really like no-password accounts. There are times when it won't let authentication succeed for a null password. You might try creating an account (with the same name as the username/password on the XP machine) on the 2008 machine and trying it just to see if the user has access to the share. A simple test of that would be something like "dir \myserver\myshare".
If you didn't want to sync accounts, you could create a third user on the 2008 machine and map the share (from the XP machine) as that user. You can also tell Windows to remember the credentials it used for that mapping if you wanted to (i.e. for convenience, definitely not security).

How to log in over network with CMD via UNC path?

I want to be able to connect to a remote machine through its UNC path in either windows CMD or powershell; I have tried C:\pushd \\MyServer\"User Folders"\localUser\TestFolder but when this executes, I get "Logon failure: unknown user name or bad password"
is "pushd" even the right command to use here? I have files that I want to exchange between the two machines on the same network, can there be permission bits I'm overlooking here?
No, pushd is not the right command. For connecting to a remote share you need the command net use:
net use X: \\SERVER\SHARE /user:DOMAIN\USER
If you're using the same account on both hosts (both a domain account as well as identical local accounts will work) you can omit the /user:DOMAIN\USER part.
Normally you'd connect only to the share, but you can also connect directly to some folder below the share:
net use X: \\SERVER\SHARE\some\subfolder
pushd should work for you, given that you have the required permissions to access the share as the current user.
Source:
If you specify a network path, the pushd command temporarily assigns
the first unused drive letter (starting with Z:) to the specified
network resource. The command then changes the current drive and
directory to the specified directory on the newly assigned drive. If
you use the popd command with command extensions enabled, the popd
command removes the drive-letter assignation created by pushd.
Note that the Powershell pushd alias (really Push-Location) does not map a drive letter, but otherwise works the same, i.e. lets you use the respective share as current directory.
So, yes it looks like you have a permission problem. Try accessing the share using explorer (or net use as #Ansgar Wiechers suggests in his answer, or even a simple dir \\share\...) to cross check.

Need encrypted virtual filesystem tool

I am currently working on a project where i need to store few files and folders in encrypted manner. This project will be platform independent and hence will be written in Java.
Instead of encrypting individual file and folder, we have been thinking of using some virtual file-system where a single container file will hold complete file-system.
Most of the open source virtual encrypted file-system tools we studied work on following principle.
mount the virtual file system (using secure password)
use this filesystem
finally dismount it
But the main problem here we face is that anyone who has access of the PC (e.g. network admin) will be able to see decrypted files when virtual drive is mounted. We want to restrict access to encrypted file system at process level. No one else in same OS session should be able to see the contents, hence no drive mounting, etc.
So we are looking for some open source tool which will provided some some APIs using which we will be able to access files in encrypted container without mounting it.
can anyone point us to any such library?
This thing I'd normally say was pretty cool.
http://www.pismotechnic.com/pfm/
But I've recently accidently copied a sub-repository in a mercurial repository to another folder and when that happened a lot of files got magically messed up. If you don't mind possible issues like that (eg. keeping backups) this could be a solution for you.
I've stumbled upon this question while hunting for an alternative because corrupted files are definitely not on my requirement list.

Resources