High tech a lo camba! Dicen que en Cambalandia a los chambones se les dice cambones. Impresionado por la capacidad técnica de mis coterráneos, entrego aquí algunos aportes técnicos (en parte copiados, simplificados y adaptados) y otros cuentos propios o traducidos. Ay del que se ría!
Source
All files accessible in a Linux (and UNIX) system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree.
Use the mount command to mount remote windows partition or windows share under Linux as follows: Procedure to mount remote windows partition (NAS share)
1) Make sure you have following information:
== Windows username and password to access share name
== Sharename (such as //server/share) or IP address
== root level access on Linux
2) Login to Linux as a root user (or use su command)
3) Create the required mount point: # mkdir -p /mnt/ntserver
4) Use the mount command as follows: # mount -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver
Use following command if you are using Old version such as RHEL <=4 or Debian <= 3: # mount -t smbfs -o username=vivek,password=D1W4x9sw //ntserver/download /mnt/ntserver
5) Access Windows 2003/2000/NT share using cd and ls command: # cd /mnt/ntserver; ls -l
Where,
-t smbfs : File system type to be mount (outdated, use cifs)
-t cifs : File system type to be mount
-o : are options passed to mount command, in this example I had passed two options. First argument is password (vivek) and second argument is password to connect remote windows box
//ntserver/download : Windows 2000/NT share name
/mnt/ntserver Linux mount point (to access share after mounting)
mount.cifs mounts a Linux CIFS filesystem. It is usually invoked indirectly by the mount(8) command when using the "-t cifs" option. This command only works in Linux, and the kernel must support the cifs filesystem. The CIFS protocol is the successor to the SMB protocol and is supported by most Windows servers and many other commercial servers and Network Attached Storage appliances as well as by the popular Open Source server Samba.
The mount.cifs utility attaches the UNC name (exported network resource) specified as service (using //server/share syntax, where "server" is the server name or IP address and "share" is the name of the share) to the local directory mount-point.
Options to mount.cifs are specified as a comma-separated list of key=value pairs. It is possible to send options other than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them. Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the kernel log.
mount.cifs causes the cifs vfs to launch a thread named cifsd. After mounting it keeps running until the mounted resource is unmounted (usually via the umount utility).
mount.cifs -V command displays the version of cifs mount helper.
modinfo cifscommand displays the version of cifs module.
the share could not be mounted This program is not installed setuid root - "user" CIFS mounts not supported
Network addresses can only have two parts //IPaddress (or PCname)
and
/Sharedfoldername (no more slash and parts)
//IPaddress/sharename
samba bug at redhat: Race condition by mount (mount.cifs) operations Bug#572691 at debian: samba shares can no longer be mounted by user Source redhat
The mount.cifs binary, as shipped within samba-client package on Red Hat Enterprise Linux 4 and 5, is NOT shipped with setuid root bit enabled by default (local, unprivileged users on these systems are NOT able to mount custom CIFS filesystem shares), which mitigates the impact of the vulnerability.
MITRE has rejected the use of CVE-2009-3297 because it was used for samba, ncpfs, and fuse when it should only have been used for Samba.
Instead, new CVEs have been assigned as follows:
CVE-2010-0787: samba
CVE-2010-0788: ncpfs
CVE-2010-0789: fuse
This issue does not affect Red Hat Enterprise Linux 4 and 5 by default as mount.cifs is not provided with the setuid bit enabled. If a user has turned on the setuid bit (via 'chmod +s /sbin/mount.cifs'), they would be affected by this issue and can workaround the problem by removing the setuid bit.
Read the instruction in NEWS, added a line to /etc/fstab.
# ls -la /sbin/mount.cifs
-rwxr-xr-x 1 root root 27716 Mar 24 08:06 /sbin/mount.cifs
# cat /etc/fstab # (remark: only last line given)
//smbserver/share /mnt/smb_share smbfs user,noexec,noauto 0 0
But as normal user:
a) not-having mount.cifs setuid:
$ mount /mnt/smb_share /sbin/mount.cifs: not installed setuid - "user" CIFS mounts not
supported.
b) when having setuid:
$ mount /mnt/smb_share This mount.cifs program has been built with the ability to run as a setuid root program disabled.
mount.cifs has not been well audited for security holes. Therefore the Samba team does not recommend installing it as a setuid root program.
So two observations:
1 - The hints in NEWS (at least the fstab hint) won't work. (Or you should be
more elaborate)
2 - The programm actually tells me "first do that" and after doing that it
tells me "you cannot do that". That should be probably filed as another bug.
(Well, as it is kind-of already filed: #576314 New upstream 4.2 version
available, the whole problem should be gone soon...)
---------------
SuSE bug report: https://bugzilla.novell.com/show_bug.cgi?id=618877
They say it's fixed and an update has been released. Try a full online update and see if it really is fixed
======================
Source
# mount //138.XXX.XXX.X/folder/Documents /home/folder/Documents/ -t cifs -o username=username,password=password,uid=1000,gid=1000
If the mount works with command line then I think the network is coming on line after the mounts are run according to fstab. If the network is a few seconds slower than the execution of fstab, the mount will fail.
So create a file called after.local
and put this code in it:
#! /bin/sh
mount -a
and place it at location /etc/init.d/after.local
and make it executable with this command:
The online update could not find any updates, thus open software management and search all samba packets and select update them for each single package separately)..
======================
Permanent cifs mounts can be "autostarted" by putting an entry in the filesystem table (fstab), details here:
Source
Windows 7 uses a feature called homegroup, which enhances the workgroup feature in order to make home networking easier for all Windows 7 computers. However, this feature doesn't work on Linux or older version of Windows. In order to connect your Linux computers to Windows 7 computers and share files and folders, you need to make a series of settings. First, it is to change the workgroup, so that all computers belong to one workgroup. In this tutorial I will demonstrate how to configure and change the workgroup on an Ubuntu PC. Step 1: Install Samba
Samba is a package for Unix systems that provides support for cross-platform files and printers sharing, and is needed for Ubuntu to access shared resources on a Windows network. In this case, you'll need to add your Ubuntu PC to a workgroup in order to connect to a Windows network. To install Samba, access your Terminal application from your main panel in 'Applications - Accessories - Terminal'.
In your terminal, you'll need to install the "samba" and "smbfs" packages, by typing the following command:
sudo apt-get install samba smbfs
You may be asked for your administrator password, which will be the same password that you use to log into your PC. After typing it in, hit Y to confirm the installation.
When the installation finishes, you will be returned to the command line prompt.
Step 2: Configure the Samba Workgroup
Still in your terminal, open the Samba configuration file by using this command:
sudo gedit /etc/samba/smb.conf
In this file, find the workgroup setting and change the value to match the workgroup of your Windows 7 PC.
You need to save the file, by clicking the Save (disk) icon near the top of the window.
Now, restart Samba using the following command:
sudo service samba restart
or
sudo service smbd restart
This will add your Ubuntu PC to the same workgroup as your Windows 7 computers. This will allow you to share files, folders, and printers between computers. Once your PC is part of the workgroup, it will show up in your list of workgroup computers, and allow you to see other computers already added to it.
Conclusion
You can configure an Ubuntu (or any Linux PC) to join a Windows workgroup in order to be visible on the same network and share files, folders, and printers. If you want to know more about setting up other PC's on a local network, or how to further utilize the networking features between Linux and Windows 7, check out the articles listed below.
Samba is a suite of Unix applications that speak the SMB (Server Message Block) protocol. Many operating systems, including Windows and OS/2, use SMB to perform client-server networking. By supporting this protocol, Samba allows Unix servers to get in on the action, communicating with the same networking protocol as Microsoft Windows products. Samba Debian Package This package contains all the components necessary to turn your Debian GNU/Linux box into a powerful file and printer server. Currently, the Samba Debian packages consist of the following: samba - LanManager-like file and printer server for Unix. samba-common - Samba common files used by both the server and the client. smbclient - LanManager-like simple client for Unix. swat - Samba Web Administration Tool samba-doc - Samba documentation. smbfs - Mount and umount commands for the smbfs (kernels 2.2.x and above). libpam-smbpass - pluggable authentication module for SMB password database libsmbclient - Shared library that allows applications to talk to SMB servers libsmbclient-dev - libsmbclient shared libraries winbind: Service to resolve user and group information from Windows NT servers python2.3-samba: Python bindings that allow access to various aspects of Samba It is possible to install a subset of these packages depending on your particular needs. For example, to access other SMB servers you should only need the smbclient and samba-common packages. Install Samba in Debian #apt-get install samba samba-client Now it will ask you some basic question about the samba configuration like workgroup or domain name you want,other questions enter the correct information which one suits for your need. Preparing directories and users Create directories for Samba to use with Windows #mkdir samba Now we need to create users to access this directiory #useradd ruchi Now create a password for this user #smbpasswd -a ruchi configure samba configuration file Samba configuration file located at /etc/samba/smb.conf In this file main section is Global where you can define all parameters and the example as follows [global] workgroup = debian netbios name = debianserver server string = %h server (Samba %v) log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 Now you need to configure the share directory(ex:-samba) for users below is the example. [SAMBA] path=/samba browseable=yes writeable=yes valid users = ruchi admin users = debain If you want to check your configuration file is correct you need to run the following command #testparm Now you need to restart the samba to take the new changes effect #/etc/init.d/samba restart If you want more configuration option check man page of smb.conf
Testing your samba configuration You want to test your samba configuration for users ruchi run the following command #smbclient -L //debianserver -U ruchi
Configuring the Windows workstation authenticate each workstation logon to the Windows workstation as any user with administrative priviliges [Windows 2000] Start -> Settings -> Control Panel -> System -> Network Identification -> Properties -> Member of -> Domain -> type the domain name as specified in the 'workgroup' section of smb.conf -> ok
enter the root username and password for the Samba file server if you simply wish to transfer existing users from a workstation, then if a user exists on the Samba file server and on the workstation, at this point you could log them into the Samba file server and their profile from the workstation would be copied to the Samba file server when they log out
This article will show you how to install Samba 3.X on Debian Linux 3.1 (Sarge) and make it authenticate against a Windows server running Active Directory. It is not intended on replacing the actual official Samba 3 manual - which is a quite good read anyway.
Debian Samba Server setup If you want to configure your server as samba server: