Linux's resource interaction with Windows when using Linux in Windows

Source: Internet
Author: User
Tags command line file system pack

Every year, Linux journalists and enthusiasts will openly discuss whether the next year will be the "Linux desktop" year. Although it is easier than ever to buy a new machine that is already running Linux or migrate existing Windows systems to Linux, simply installing and booting Linux is not enough to make it a daily operating system. You may already be starting to use Linux on your desktop, but your environment may be less modern with your new Linux system. Most businesses, small and midsize enterprises, and small office/Home Office environments have Windows-related requirements that must be considered. You may also want to use hardware that can be effectively supported on the Windows platform only for Linux systems. Fortunately, there are various solutions to these problems.

Accessing the shared Windows file system

Accessing a shared Windows file system may be the most common business requirement for users of Linux systems. Many enterprises are still using Windows as the core of infrastructure to support enterprise mail and calendar systems, such as Microsoft Exchange Server, and exported file systems (commonly called Windows sharing To support simple file and data sharing.

Linux offers a variety of ways to access Windows sharing. Which mechanism you choose depends on how often you need to access the data on the Windows share, and whether the LINXU system you configure is personal, Single-user, or shared by multiple users.

Accessing Windows shares from the command line

Samba Project is an open source project that supports Linux, UNIX, and other Unix-like operating systems and Windows interoperability. Samba is included in most Linux distributions repositories, and is typically supported by installation and configuration to enable Linux systems to join and interoperate with an existing Windows workgroup or domain, often as a common Internet file system for use by Windows systems (Common Internet file System, CIFS server. The Samba 4.x installation also allows the Samba server to act as an Active Directory domain service (Active Directory Domains services) controller and an integrated domain Name system in a Windows domain.

Although the Samba server provides an excellent mechanism to provide Linux resources from Windows systems to enable Linux to print to Windows printers, if you are interested in retrieving files from Windows sharing occasionally, installing and configuring a Samba server can be large Materials for small use. The Samba client package (samba-client) contains several utilities designed specifically for this kind of occasional interaction, including the Smbclient application, which provides an interactive command-line interface (CLI) for remote access to Windows sharing.

If you are unsure about the share name that is provided on a remote Windows server, you can use the Smbclient application to query a server, and then type the-l option after the name or IP address of the server to list the resources available on that server, as shown in Listing 1.

Listing 1. Use Smbclient to list Windows server resources

$ smbclient-l win2008server
Enter wvh ' s password:
domain=[wordsmiths]
os=[windows (R) Small Business Server 2008 6001 Service Pack 1]
server=[windows (R) Small Business Server 2008 6.0]
    
sharename        Type      comme NT
---------        ----      -------
address           Disk      "Access to address Objects"
admin$            Disk      Remote Admin
Brother hl-2070n  Printer   Brother hl-2070n
C $                disk      Default Share
exchangeoab       Disk      OAB distribution share
ipc$              IPC       Remote IPC
NETLOGON          Disk      Logon server share
print$            disk      Printer Drivers
public            disk
redirectedfolders disk
resources$        Disk      "Event logging Files"
SYSVOL            disk      Logon server share
[...]

As shown above, the Smbclient application uses the current Linux user as the user to authenticate on the remote Windows server and prompts the user for a password to access the remote server. If the logon name is different on the Windows server, you can use the-u option to specify the login to use.

After you determine the name of the share you want to connect to, you can use the Smbclient application to connect to a specific share to examine or retrieve the file, as shown in Listing 2.

Listing 2. Retrieving files from Windows shares using Smbclient

$ smbclient //win2008server/Public
Enter wvh's password:
Domain=[WORDSMITHS]
OS=[Windows (R) Small Business Server 2008 6001 Service Pack 1]
Server=[Windows (R) Small Business Server 2008 6.0]
smb: \> cd Software\Linux
smb: \Software\Linux\> ls
. D 0 Sun Jan 27 23:40:42 2013
.. D 0 Sun Jan 27 23:40:42 2013
acl82express-linux-x86.bz2 A 44960643 Sun Jan 27 23:40:24 2013
alien_8.87.tar.gz A 64336 Sun Jan 27 23:39:24 2013
crossover-12.1.0-1.i386.rpm A 47233108 Sun Jan 27 23:39:14 2013
[...]
59997 blocks of size 1048576. 32474 blocks available
smb: \Software\Linux\> get softmaker-office-2012-674.x86_64.rpm
getting file \Software\Linux\softmaker-office-2012-674.x86_64.rpm \
of size 147058656 as softmaker-office-2012-674.x86_64.rpm \
(16345.5 KiloBytes/sec) (average 16345.5 KiloBytes/sec)
smb: \Software\Linux\> quit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.