Code: Select all
# mount.cifs //192.168.0.138/data /mnt/cifs -o
username=<my login name>,password=<my password>,domain=<workgroup name>
cd /mnt/cifs/video
wget <url to file on Internet>
Code: Select all
pi@raspbian-pi ~ $ mount.cifs //192.168.0.138/data/bosse /mnt/cifs -o username=user,password=*****,domain=*****
Couldn't chdir to /mnt/cifs: No such file or directory
pi@raspbian-pi ~ $ mkdir /mnt/cifs
mkdir: cannot create directory `/mnt/cifs': Permission denied
pi@raspbian-pi ~ $ sudo mkdir /mnt/cifs
pi@raspbian-pi ~ $ mount.cifs //192.168.0.138/data/user /mnt/cifs -o username=user,password=*****,domain=*****
mount.cifs: permission denied: no match for /mnt/cifs found in /etc/fstab
pi@raspbian-pi ~ $Code: Select all
$ sudo mount.cifs //192.168.0.138/data/bosse /mnt/cifs -o username=*****,password=*******,domain=******
$ ls -l /mnt/cifs
total 8935
-rwxrwxrwx 1 1026 users 286719 Mar 21 2012 Android Sms New_1.mp3
.... more files....
Code: Select all
$ cd /mnt/cifs
$ wget http://companydomain/somepath/2014(CI)/21.2.4.4/thefile
-bash: syntax error near unexpected token `('
Code: Select all
$ wget "http://companydomain/somepath/2014(CI)/21.2.4.4/thefile"
Code: Select all
$ wget http://companydomain/somepath/2014\(CI\)/21.2.4.4/thefileCode: Select all
wget http://companydomain/somepath/2014%28CI%29/21.2.4.4/thefileCode: Select all
emgi@raspberrypi:~$ sudo su
root@raspberrypi:/home/emgi# cd
root@raspberrypi:~# mkdir /nas46
root@raspberrypi:~# vi /etc/hosts
root@raspberrypi:~# mount //nas46/share /nas46
Password:
root@raspberrypi:~#Code: Select all
root@raspberrypi:~# mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=219832k,nr_inodes=54958,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=44800k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=89580k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
//nas46/share on /nas46 type cifs (rw,relatime,vers=1.0,cache=strict,username=root,domain=NAS46,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.202.224,file_mode=0755,dir_mode=0755,nounix,serverino,rsize=61440,wsize=65536,actimeo=1)
root@raspberrypi:~#
Code: Select all
mount.cifs //nas/data/user /mnt/cifs -o username=user,password=*****,domain=*****,rwWhy not use a credentials file? You store userid/password in that (and restrict it with ownership and permission bits) and pass that as an option in /etc/fstab or on an smbmount command. https://www.samba.org/samba/docs/man/ma ... ifs.8.htmlemgi wrote: I leave out the password and then I'm prompted for it.
Well, actually I don't want it to automount for security reasons.DougieLawson wrote:Why not use a credentials file? You store userid/password in that (and restrict it with ownership and permission bits) and pass that as an option in /etc/fstab or on an smbmount command. https://www.samba.org/samba/docs/man/ma ... ifs.8.htmlemgi wrote: I leave out the password and then I'm prompted for it.
Code: Select all
pi@raspbian-pi ~ $ UMASK
-bash: UMASK: command not found
Probably I need to add something to my mount command line in order to make the files created on the NAS being accessible to the owner (=me) as well as all others (-rwxrwxrwx).FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS
The core CIFS protocol does not provide unix ownership information or mode for files and directories. Because of
this, files and directories will generally appear to be owned by whatever values the uid= or gid= options are set,
and will have permissions set to the default file_mode and dir_mode for the mount. Attempting to change these
values via chmod/chown will return success but have no effect.
When the client and server negotiate unix extensions, files and directories will be assigned the uid, gid, and mode
provided by the server. Because CIFS mounts are generally single-user, and the same credentials are used no matter
what user accesses the mount, newly created files and directories will generally be given ownership corresponding
to whatever credentials were used to mount the share.
If the uid´s and gid´s being used do not match on the client and server, the forceuid and forcegid options may be
helpful. Note however, that there is no corresponding option to override the mode. Permissions assigned to a file
when forceuid or forcegid are in effect may not reflect the the real permissions.
When unix extensions are not negotiated, it´s also possible to emulate them locally on the server using the
"dynperm" mount option. When this mount option is in effect, newly created files and directories will receive what
appear to be proper permissions. These permissions are not stored on the server however and can disappear at any
time in the future (subject to the whims of the kernel flushing out the inode cache). In general, this mount option
is discouraged.
It´s also possible to override permission checking on the client altogether via the noperm option. Server-side
permission checks cannot be overriden. The permission checks done by the server will always correspond to the
credentials used to mount the share, and not necessarily to the user who is accessing the share.
Code: Select all
sudo mount.cifs //nas/data/bosse /mnt/cifs -o username=****,password=*****,domain=****,rw
Code: Select all
pi@raspbian-pi ~ $ sudo mount.cifs //nas/data/bosse /mnt/cifs -o username=****,password=*****,domain=*****,rw,file_mode=0755,dir_mode=0755
pi@raspbian-pi ~ $ cd /mnt/cifs
pi@raspbian-pi /mnt/cifs $ touch korvkiosk2
touch: cannot touch `korvkiosk2': Permission denied
pi@raspbian-pi /mnt/cifs $ ls -l k*
-rw-r--r-- 1 1026 users 0 Aug 2 00:26 kallekula
-rw-r--r-- 1 1026 users 0 Aug 3 15:08 korvkiosk2
Code: Select all
pi@raspbian-pi ~ $ ls -l /mnt
total 0
drwxrwxrwx 7 1026 users 0 Aug 3 15:08 cifs
Code: Select all
pi@raspbian-pi ~ $ sudo umount /mnt/cifs
pi@raspbian-pi ~ $ sudo mount.cifs //nas/data/bosse /mnt/cifs -o username=****,password=*****,rw,file_mode=0755,dir_mode=0755
pi@raspbian-pi ~ $ cd /mnt/cifs
pi@raspbian-pi /mnt/cifs $ ls -l
total 8935
-rwxrwxrwx 1 1026 users 286719 Mar 21 2012 Android Sms New_1.mp3
...
-rw-r--r-- 1 1026 users 0 Aug 2 00:26 kallekula
-rw-r--r-- 1 1026 users 0 Aug 3 15:08 korvkiosk2
...
pi@raspbian-pi /mnt/cifs $ touch korvkiosk3
touch: cannot touch `korvkiosk3': Permission denied
pi@raspbian-pi /mnt/cifs $ ls -l k*
-rw-r--r-- 1 1026 users 0 Aug 3 15:56 korvkiosk3
Code: Select all
...
-rw-r--r-- 1 1026 users 0 Aug 2 00:26 kallekula
Code: Select all
sudo mount.cifs //nas/data/bosse /mnt/cifs -o username=****,password=****,rw,file_mode=0777,dir_mode=0777,noperm