Use Linux in Windows

Source: Internet
Author: User

Every year, Linux journalists and fans will discuss whether the next year will be the year of "Linux Desktop. Although it is easier to purchase a new machine that is running Linux or migrate an existing Windows system to Linux, however, simply installing and starting Linux is not enough to build it into a daily operating system. You may have started using Linux on the desktop, but the environment for using the new Linux system may be less modern. Most enterprises, small and medium enterprises, and small office/home office environments have Windows-related requirements that must be considered. You may also need to use hardware that can only be effectively supported on Windows for Linux. Fortunately, there are various solutions to these problems.

Access a shared Windows File System

Accessing a shared Windows File System may be the most common business requirement of Linux users. Many enterprises are still using Windows as the core of their infrastructure to support enterprise mail and calendar systems (such as Microsoft Exchange Server) and exported file systems (generally known as Windows sharing) to support simple file and data sharing.

Linux provides multiple methods to access Windows sharing. The specific mechanism depends on the frequency of data access to Windows sharing, and whether the Linxu system you configured is an individual, single-user system, or shared by multiple users.

Access Windows sharing from the command line

Samba Project is an open-source Project that supports interoperability between Linux, UNIX, and other UNIX-like operating systems and Windows. Most of the repositories of Linux releases contain Samba, which is installed and configured to support Linux systems to join an existing Windows Working Group or domain and interoperate with it, it is often used as a Common Internet File System (CIFS) File server for Windows systems. Samba 4.x installation also allows the Samba server to act as an Active Directory Domain Service controller and an integrated Domain Name System for Windows domains ).

Although the Samba server provides an excellent mechanism to provide Linux resources from a Windows system so that the Linux system can be printed to a Windows Printer, if you are only interested in occasionally retrieving files from WIndows sharing, installing and configuring the Samba server may be minor. The Samba client package contains multiple utilities designed for such occasional interactions, including the smbclient application, which provides an interactive CLI) to remotely access Windows sharing.

If you are not sure about the share name provided on the remote Windows server, you can use the smbclient application to query a server, enter the-L option after the server name or IP address to list the available resources on the server, as shown in Listing 1.

Listing 1. Using smbclient to list Windows Server resources

  1. $ Smbclient-L win2008server
  2. Enter wh_'s password:
  3. Domain = [WORDSMITHS]
  4. OS = [Windows (R) Small Business Server 2008 6001 Service Pack 1]
  5. Server = [Windows (R) Small Business Server 2008 6.0]
  6. Sharename Type Comment
  7. --------------------
  8. Address Disk "Access to address objects"
  9. ADMIN $ Disk Remote Admin
  10. Brother HL-2070N Printer Brother HL-2070N
  11. C $ Disk Default share
  12. ExchangeOAB Disk OAB Distribution share
  13. IPC $ IPC Remote IPC
  14. NETLOGON Disk Logon server share
  15. Print $ Disk Printer Drivers
  16. Public Disk
  17. RedirectedFolders Disk
  18. Resources $ Disk "Event logging files"
  19. SYSVOL Disk Logon server share
  20. [...]

As shown above, the smbclient application uses the current Linux user as the user to be verified on a remote Windows Server, and prompts the user to enter a password to access the remote server. If the login name on the Windows Server is different, you can use the-U option to specify the login name to use.

After determining the name of the share you want to connect to, you can use the smbclient application to connect to a specific share to check or retrieve files, as shown in Listing 2.

Listing 2. Using smbclient to retrieve files from Windows sharing

  1. $ Smbclient // win2008server/Public
  2. Enter wh_'s password:
  3. Domain = [WORDSMITHS]
  4. OS = [Windows (R) Small Business Server 2008 6001 Service Pack 1]
  5. Server = [Windows (R) Small Business Server 2008 6.0]
  6. Smb: \> cd Software \ Linux
  7. Smb: \ Software \ Linux \> ls
  8. . D 0 Sun Jan 27 23:40:42 2013
  9. .. D 0 Sun Jan 27 23:40:42 2013
  10. Acl82express-linux-x86.bz2 A 44960643 Sun Jan 27 23:40:24 2013
  11. Alien_8.87.tar.gz A 64336 Sun Jan 27 23:39:24 2013
  12. Crossover-12.1.0-1.i386.rpm A 47233108 Sun Jan 27 23:39:14 2013
  13. [...]
  14. 59997 blocks of size 1048576. 32474 blocks available
  15. Smb: \ Software \ Linux \> get softmaker-office-2012-674.x86_64.rpm
  16. Getting file \ Software \ Linux \ softmaker-office-2012-674.x86_64.rpm \
  17. Of size 147058656 as softmaker-office-2012-674.x86_64.rpm \
  18. (16345.5 KiloBytes/sec) (average 16345.5 KiloBytes/sec)
  19. Smb: \ Software \ Linux \> quit

The example in Listing 2 shows that smbclient provides a CLI to connect to the remote server. This interface supports familiar Linux commands, such as cd (used to move the content in the directory on the remote server) and ls (used to list the content of the given directory ). After finding the desired file, you can use the get command to retrieve the file and store it in the directory where you want to execute smbclient. To store the retrieved files in another directory, you can use the LCD (local directory change) command to change smbclient as the directory of the current directory.

If you only need to occasionally access one or more files in Windows sharing, and do not care about using the File Manager (such as Gigolo, GNOME Nautilus, KDE doldolphin, Konqueror or Thunar) to browse Windows sharing in a graphical way, you can safely use the smbclient application. The smbclient application enables Remote sharing to be used in the context of the application, rather than in your entire system. To browse Windows sharing and provide it to the application you selected, you must mount the sharing to your system in the same way as mounting the local file system.

  • 1
  • 2
  • 3
  • 4
  • Next Page

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.