smbmount, mount a shared drive. additional example. adding to Message #347
Example command mounting from a win2000 share to a redhat linux 7.3.. win2000 is computer square. acute is redhat 7.3 all done using plaintextpasswords on unix and msft systems. additional smbmount commands to access shared win2000 USB drives on linux box.
created mount point /share as root. command.
mount a subdirectory or folder. //computer name/folder or device /mounting_directory_on_linux_box.
mount -t smbfs -o username=Administrator,password=yabadabadoo //half/F707 /share
mount a device C:\ G:\ etc. ie. G$ This works with mount -t smbfs -o username=Administrator,password=yabadabadoo //half/G$ /share this syntax does not work with USB 2.0 drives.
When mounting a shared USB 2.0 drive, I found that J: K: would only mount if the $ were not used as shown above.
mount -t smbfs -o username=Administrator,password=yabadabadoo //half/G /share
Both mounts have the problem that only root can write to the USB 2.0. If one looks at the smbmount options one can see how to fix this. One way is to mount it as root, but mount it with the uid and or gid that would allow another user write. This in conjunction with the dmask option will give write permission to a user, a group or everyone on the unix box.
the uid number can be found by greping a user name in /etc/passwd
mount -t smbfs -o Username=admin_or_user,password=fuddyduddy,uid=511,gid=511,dmask=777,fmask=666 //half/J /J
dmask=777 give all rw permission on mount. dmask=775 would give only user and group write permission.
output of smbmoung /usr/bin/smbmount [root@acute PHOTO]# smbmount Usage: mount.smbfs service mountpoint [-o options,...] Version 2.2.7-security-rollup-fix
Options: username=<arg> SMB username password=<arg> SMB password credentials=<filename> file with username/password netbiosname=<arg> source NetBIOS name uid=<arg> mount uid or username gid=<arg> mount gid or groupname port=<arg> remote SMB port number fmask=<arg> file umask dmask=<arg> directory umask debug=<arg> debug level ip=<arg> destination host or IP address workgroup=<arg> workgroup on destination sockopt=<arg> TCP socket options scope=<arg> NetBIOS scope iocharset=<arg> Linux charset (iso8859-1, utf8) codepage=<arg> server codepage (cp850) ttl=<arg> dircache time to live guest don't prompt for a password ro mount read-only rw mount read-write
This command is designed to be run from within /bin/mount by giving the option '-t smbfs'. For example: mount -t smbfs -o username=tridge,password=foobar //fjall/test /data/test
|