Cygwin settings

xiaoxiao2021-03-06  40

Resource

1.1. URL link

Home:

http://www.cygwin.com/

Synchronize:

ftp://ftp.sunsite.utk.edu/pub/cygwin/release/

FTP: // anonymous: cygwin@ftp.gnupilgrims.org/pub/cygwin/release/

1.2. Wiki keyword

2. Version

The latest version of:

2004/01/31: [Cygwin DLL 1.5.7-1 Release] 2004/01/19: [Cygwin DLL 1.5.6-1 Release] 2003/09/20: [Cygwin DLL 1.5.5-1 Release] 2003 / 09/13: [Cygwin DLL 1.5.4-1 Release]

3. FAQ

3.1. Q Howto get version info?

Bash $ cygcheck -c Cygwin

3.2 Q installation considerations

gzip

Gzip version 1.3.3-4 is available. High versions such as: 1.3.5-1 make the tar -z command to run abnormal.

3.3. Q HOWTO SETUP DEFAULT TEXT FORMAT, CRLF (DOS) OR LF (UNIX)?

Modify the registry key: HKEY_LOCAL_MACHINE / SOFTWARE / CYGNUS SOLUTIONS / CYGWIN / MOUNTS V2 /.../ Cygdrive Flags. Cygdrive flags is a DWORD value, & 0x2 == 0x2 is Unix Style, otherwise DOS LIKE STYLE.

Set the environment variable CygWin so that the way of processing in PIPE and other modes: export cygwin = nobinmode

3.4 Why is the file created under CygWin? This is the so-called NTSEC works. Simulate the permissions of UNIX through NTFS permissions. You can modify it through the Cygwin environment variable. Such as:

Bash $ export cygwin = "nontsec nosmbntsec"

3.5 How to make LS to display Chinese file names? Because ls do not use readline to display, it cannot be used .inputrc control. That is, LESS and LS need special settings. Add the following Alias ​​in .bashrc:

Alias ​​less = '/ bin / less -r'

Alias ​​ls = '/ bin / ls -f --color = tty --Show-control-chars'

3.6. Q How to ignore the case when the file name is expanded by the Tab button, so that it is convenient to Windows? See:

[Cygwin User's Guide]

Customizing Bashthree Initialization Files That Control The Behavior of Bash: .profile, .bashrc and .inputerc.

.profileit is Executed When Bash is Started As Login Shell, E.G. from the command bash --login.

Suggest

Add ":." After PATH, this can be applied to the program under DOS;

.bashrc.bashrc is similar to .profile but is executed each time an interactive bash shell is launched.

.inputrc.inputerc controls how programs Using the readline library. # ignore case while completion

SET Completion-ignore-case on

# Make Bash 8bit Clean

SET META-FLAG ON

Set Output-meta on # to show 8-bit characters

SET Convert-Meta Off # to show it as character, not the oscnal representation

But it does not guarantee that LS is displayed in Chinese. Because these tools do not use readline to display. Limings and Ls require special settings. Add the following Alias ​​in .bashrc:

Alias ​​less = '/ bin / less -r'

Alias ​​ls = '/ bin / ls -f --color = tty --Show-control-chars'

3.7 How do I run crontab in Cygwin? as follows:

Install the system service CRON on Windows, start up.

Bash $ cygrunsrv -i cron -p / usr / sbin / cron -a -d

Start service

Bash $ cygrunsrv -s cron

3.8. Q Configure SSH Client?

In order to be able to verify SSH to other servers through the public key verification, first establish the SSH public key private key pair locally:

Bash $ ssh-keygen -t r11

Bash $ ssh-keygen -t rsa

Bash $ ssh-keygen -t dsa

Establish no password login

The unit's * .pub copy (CAT >>) is required to the authorized_keys (ssh1) and authorized_keys2 (ssh2) files in the server.

3. Q How to run SSHD (SSH Server) in Cygwin?

Set up Windows environment variables, add "cygwin = ntsec tty"

Config sshd, Running:

Bash $ ssh-host-config -y

According to the prompt, enter cygwin = ntsec tty

Change Permissions and Ownership on Some Files:

Bash $ cd /; chmod -r og-w.

Bash $ chmod og W / TMP

Bash $ TOUCH /VAR/LOG/sshd.log

Bash $ Chown System: System /Var/log/sshd.log / VAR / EMPTY / ETC / SSH_H *

Bash $ Chmod 755 / VAR / EMPTY

Start the service:

Bash $ cygrunsrv -s sshd

3.10 How do I configure Email? As Follows in Cygwin:

SSMTP & MUTT

SSMTP

Bash $ / USR / BIN / SSMTP-Config

When Using Mutt As The Mail Client, Add The Following Line to your $ home / .muttrc file:

SET sentmail = "/ usr / sbin / ssmtp"

MUTT

Make Sure You Have The Cygwin SSMTP Package Installed

Check file /etc/ssmtp/ssmtp.confvi .bashrc and / or .bash_profile

EXPORT MAIL = ~ / Mail / Inbox

Export Editor = nano

IF you have nano installed (and i stongly recommend "you do)

Create The Following Directory Structure In your home directory:

~ / Mail

|

- Inbox (Empty file, not Directory)

|

- SENT (EMPTY FILE, NOT DIRECTORY)

|

- Received (EMPTY FILE, NOT DIRECTORY)

|

- PostPoned (Empty file, not Directory)

Create a ~ / .muttrc File That Looks Like this:

# The file / directory where your incoming mail will be spotable

# (Same as 'set spoolfile' below)

Mailboxes ~ / mail / inbox

# Mail Account setup. I know nothing about iMap, so you're

# Your w t.

SET sentmail = "/ usr / sbin / ssmtp"

#set pop_host = "Your.pop3.mail.server.com"

#set pop_last = yes

#set pop_user = "Your_Email_Username"

#set pop_pass = "Your_Email_password"

Set from = "Your_complete@email_address.com"

# Mail Folder Setup.

SET Folder = ~ / mail

SET MBOX_TYPE = MBOX

Set spoolfile = inbox

Set Mbox = Received

Set postponed = postponed

Set record = SENT

Mutt Command Line

Mutt [...] Address

parameter:

-a file: attach a file to message

-b Address: BCC

-c address: cc

-F muttrc

-H Draft: Draft Contain Both Header and Body

-S Subject: Subject of the Message

-x: Emulate the mailx compose mode

Environment variable:

Email: User's Email Address

Mail: User's Spool Mailbox

Example:

Bash $ Echo "Contents" | mutt -x -s "subject" mail @ address

Bash $ echo | mutt -x -s "subject" -i filename mail @ address

EXIM & MiniRES

EXIM

EXIM IS A FULLY FEATURED MAIL TRANSFER Agent, A Drop-in Replacement for Sendmail.

Bash $ / USR / BIN / EXIM-Configbash $ View /etc/exim.conf

Bash $ VI / ETC / Aliases

Postmaster: your_login_name

Bash $ VI /ETC/RESLOV.CONF

Nameserver 10.0.0.7

Search Your.domain

Bash $ cygrunsrv -i exim -p / usr / bin / evim -e cygwin = Nontsec

-A "-BDF -Q15M" -d "EXIM MAIL TRANSFER AGENT"

-1 /var/log/exim/cygrunsrv_out.log -2 /var/log/exim/cygrunsrv_err.log

Bash $ cygrunsrv -s exim

3.11. How to get the path name of the DOS / Windows? Format?

Bash $ cygpath -d -m "` pwd` "

3.12. Q setup xinetd

Start Init Service

Bash $ / usr / bin / init-config

ChkConfig tool to maintain scripts under /etc/rc.d

To start SSHD execution "/ sbin / chkconfig --Add SSHD"

xinetd config

Bash $ / usr / bin / xinetd-config

3.13. Q q?

TTCP, NetSnoP

3.14. Q xfree86 Under Cygwin?

Add / USR / X11R6 / bin to path; start xwindow using startxwin.bat (dos / windows), or startxwin.sh (cygwin); if Has A FireWall Installed, Open Port "6000" of local server; Run Xclient in local machine Just Set Environment: Export Display = 127.0.0.1: 0.0 if Run Xclient in Remote Machine, Give Authorize to Remote Host:

Bash $ / usr / x11r6 / bin / xhost remote_hostname_or_ip_address

Telnet / ssh to remote Host; set environment display, like: export display = : 0.0 xterm

3.15. Settings after installation?

BINMODE OR TEXTMODE? Execution

Mount command, if not TextMode, modify the registry HKEY_LOCAL_MACHINE / SOFTWARE / CYGNUS SOLUTIONS / CYGWIN / MOUNTS V2 /... Cygdrive Flags. Cygdrive flags is a DWORD value, & 0x2 == 0x2 is Unix Style, otherwise DOS LIKE STYLE.

Modify ~ / .inputrc file, add the following

# Ignore case while completing

SET Completion-ignore-case on

# Make Bash 8bit Clean

SET META-FLAG ON

Set Output-meta on # to show 8-bit characters

SET CONVERT-META OFF # to show it as character, NOTCER REPRESENTATION Modify / etc / profile, add the following:

Set -o vi

Alias ​​less = '/ bin / less -r'

Alias ​​ls = '/ bin / ls -f --color = tty --Show-control-chars'

# Glob Filenames in a Case-Insensitive Manner

Shopt -s nocaseglob

Export SGML_CATALOG_FILES = / Share / catalog.sgml

EXPORT XML_CATALOG_FILES = / Share / Catalog.xml

Export cygwin = "nobinmode nontsec NOSMBNTSEC"

Export Path = $ PATH :.

Modify the main group of login users:

Bash $ VI / ETC / Passwd

The default belongs to 513 groups (for domain controllers is domain users, non-domain controllers NONE), personal preferences are set to 544 (Administrator)

Establish Symbol Link:

Because some scripts default MD5 summary is MD5, not MD5SUM;

Bash $ ln -s / usr / bin / md5sum / usr / bin / md5

Set the DocBook DTD / DSSL path

Bash $ ln -sf / cygdrive / e / home / work / johnson_homepage / worldhello / share / share

Set the usemodwiki path map

MKDIR / RepOS

CD / RepOS /

LN -S / CygDrive / D / D

LN -S / D / Home / Work / Johnson_HomePage / WorldHello / UseMod JohnsonuseModwiki

LN -S / D / Home / Work / Johnson_HomePage / WorldHello / Wiki.

Set the establishment of work path

Bash $ ln -sf / cygdrive / e / home / work / ~ / Work

转载请注明原文地址:https://www.9cbs.com/read-76652.html

New Post(0)