0

I have two questions here. I am able to mount a windows network path in my Ubuntu machine by doing following:

sudo mount -t cifs -o username=user \\\\my_windows\\test /net/loc

All the files and folders present in Windows machine is now available in Ubuntu machine with path '/net/loc'.

Here are my doubts:

  1. I can see all files of windows in linux path. Is it possible to create files/folders in Linux path(the mount path where windows path is mounted) and it will be reflected in Windows machine? I am not able to write in Linux machine where windows network location is mounted. It throws me error "Can't open file for writing".

  2. I am trying to write a shell script (a ksh file) which will mount the windows network path. I wrote the below mount command in my file but this command prompts for password. Is there any way, I can write the command in shell script that it will not ask me for password and I can pass it as either as a parameter or some other mechanism?

    mount -t cifs -o username=user \\my_windows\test /net/loc

Thank you

Raji
  • 857
  • 6
  • 18
  • 37
  • Got the reply here for both password and write access. http://unix.stackexchange.com/questions/68079/mount-cifs-network-drive-write-permissions-and-chown – Raji Apr 02 '17 at 16:59

1 Answers1

0

Password can be passed as below

sudo mount -t cifs -o username=${USER},password=${PASSWORD},uid=,gid= //server-address/folder /mount/path/on/ubuntu

And with root access I am able to write in Linux path.

More information is here https://unix.stackexchange.com/questions/68079/mount-cifs-network-drive-write-permissions-and-chown

Community
  • 1
  • 1
Raji
  • 857
  • 6
  • 18
  • 37