OpenSSH tip (Sleepy blog)

Source: Internet
Author: User

# $ OpenBSD: sshd_config, V 1.59 2002/09/25 11:17:16 Markus exp $
# $ FreeBSD: src/crypto/OpenSSH/sshd_config, V 1.4.2.13 2003/09/24 19:28:35 des exp $

# This is the sshd server system-wide configuration file. See
# Sshd_config (5) for more information.

# This sshd was compiled with Path =/usr/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped
# OpenSSH is to specify options with their default value where
# Possible, but leave them commented. uncommented options change
# Default value.

# Note that some of FreeBSD's defaults differ from OpenBSD's, and
# FreeBSD has a few additional options.

# Versionaddendum FreeBSD-20030924

Port 22
# Listening port

# Protocol 2, 1
Protocol 2
# Required SSH Version

# Listenaddress 192.168.1.254
Bound address

# Listenaddress ::

# Hostkey for Protocol Version 1
# Hostkey/etc/ssh/ssh_host_key
# Hostkeys for Protocol Version 2
Hostkey/etc/ssh/ssh_host_dsa_key

# Key used by the host
# Use/etc/ssh/ssh_host_key for SSH 1
# Use/etc/ssh/ssh_host_dsa_key for SSH 2

# Lifetime and size of ephemeral version 1 server key
# This setting is only applicable to SSH version 1.
Keyregenerationinterval 3600
# Server key survival time, in seconds
Serverkeybits 768
# Key length

# Logging
# Obsoletes quietmode and fascistlogging
Syslogfacility auth
Loglevel info

# Authentication:

Logingracetime 600
# The password input time after the connection, in seconds. This is the default time. It is longer. We recommend that you enter the password in 10 minutes?
Permitrootlogin No
# Whether the root user can log on remotely. We recommend that you do not enable SSH 1.
# If it is without-password, the root user cannot log on with the password, but can log on with the key
Strictmodes Yes
# Check the permissions and ownership of the user's home directory and rhosts files. If other users can write the files, they will not be used.

# Rsaauthentication Yes
# Only use RSA Authentication, only applicable to SSH version 1
Pubkeyauthentication Yes
# Use pubkey authentication, which must be enabled when using SSH 2, only for SSH 2
Authorizedkeysfile. Ssh/authorized_keys
# Key path and name

# Rhosts authentication shocould not be used
RhostsAuthentication No
# Rhosts-based security verification is not required.

# Don't read the user's ~ /. Rhosts and ~ /. Shosts files
IgnoreRhosts Yes
# Do not use ~ /. Rhosts ~ /. Shosts. The two files are authenticated.

# For this to work you will also need host keys in/etc/ssh/ssh_known_hosts
# RhostsRSAAuthentication No
# Use rHost file authentication, only for SSH 1

# Similar for Protocol Version 2
Hostbasedauthentication No
# Use rHost file authentication, only for SSH 2

# Change to yes if you don't trust ~ /. Ssh/known_hosts
# RhostsRSAAuthentication and hostbasedauthentication
# Do not use ~ /. Ssh/known_hosts file. We need to use it. Select No. The default value is no.
# Ignoreuserknownhosts No

# To disable tunneled clear text passwords, change to no here!
Passwordauthentication No
# Use password verification. Use SSH 2 to disable it

Permitemptypasswords No
# Use a blank password, which is disabled by default

# Change to no to disable PAM Authentication
Challengeresponseauthentication No
# For any password authentication, we use key authentication. The default value is yes. Key Authentication must be disabled.

# Kerberos options
# Define custom uthentication No
# Kerberosorlocalpasswd Yes
# Define osticketcleanup Yes

# AFSTokenPassing No

# Kerberos TGT passing only works with the AFS kaserver
# Define ostgtpassing No

# X11forwarding Yes
X11forwarding No
# Set whether to allow X11 forwarding. By default, X11 forwarding is allowed.
# X11displayoffset 10
# X11uselocalhost Yes
X11uselocalhost No
# Use a local host
# Printmotd Yes
# Display the content of the motd File
# Printlastlog Yes
# Display the last logon information. It is enabled by default.
# Keepalive Yes

# UseLogin No

# Useprivilegeseparation Yes

# Permituserenvironment No
# Use the account environment

# Compression Yes
# Data compression, default Compression

# Maxstartups 10
# The maximum number of Unlogged connections.
# No Default banner path
# Banner/Some/path
# Verifyreversemapping No

# Override default of no subsystems
Subsystem SFTP/usr/libexec/SFTP-Server

Allowgroups Wheel
# Groups allowed
Allowusers
# Users Allowed

Tip ~

For more information about sshd settings, see the preceding configuration file.
Connect to SSH 2
1. Generate the key used by SSH2
Ssh-keygen-T DSA

2. CP id_dsa.pub to remote host ~ /. Ssh/
Cat id_dsa.pub >> ~ /. Ssh/authorized_keys
Rm id_dsa.pub
Chmod 700 ~ /. Ssh/authorized_keys

Do not use mv or CP to generate the authorized_keys File
This will cause loss of your other pubkey.
Authorized_keys can contain multiple pubkeys.
3. Ssh-I id_dsa user @ hostname
Host connection
Enter the password of the key to connect.

Use securecrt
Connect to the SSH 2 Server
The key generated by securecrt is not compatible with sshd, and the format is incorrect.
Need to convert
Identity. Pub is the pubkey generated by securecrt
Conversion
Ssh-keygen-X-F identity. Pub> identity. pub2
Add the authorized_keys File
Cat identity. pub2 >> ~ /. Ssh/authorized_keys
Rm identity. Pub *
Use securecrt to connect.
The format of the key pair generated by securecrt is different from that generated by OpenSSH. Both of them can only recognize their own key format, therefore, when using securecrt to connect to OpenSSH, they must use their own key format, you can use any method to generate and then use SSH-keygen-I to convert the key generated by securecrt into the OpenSSH key format, alternatively, use SSH-keygen-e to convert the OpenSSH key format to the IETF secsh format that can be recognized by securecrt.

Cygwin-> win
List of required files
Cygcrypto-0.9.7.dll
Cygminires. dll
Cygwin1.dll
Cygz. dll
Scp.exe
Sftp.exe
Ssh-add.exe
Ssh-agent.exe
Ssh-keygen.exe
Ssh-keyscan.exe
Ssh.exe
Ssh_config

Securecrt
Cygwin_ssh http://tmdnet.3322.org/kid.
SFTP command
CD path change remote directory to 'path'
Switch remote path
LCD path change local directory to 'path'
Switch local path
Chgrp GRP path change group of file 'path' to 'grp'
Change Group
Chmod mode path Change permissions of file 'path' to 'Mode'
Change permissions
Chown own path change owner of file 'path' to 'own'
Change owner
Help display this help text
Help
Get remote-path [local-path] download file
Download files
Lls [LS-options [path] display local Directory Listing
List local directories
Ln oldpath newpath symlink Remote File
Establish a connection
Lmkdir path create local directory
Create a local directory
Lpwd print local working directory
Display local working directory
Ls [path] display remote Directory Listing
List remote Directories
Lumask umask set local umask to 'umask'
Set local umask
Mkdir path create remote directory
Create remote directory
Progress toggle display of Progress Meter
Close display progress bar
Put local-path [Remote-path] Upload File
Upload files
PWD display remote working directory
Display remote working directory
Exit quit SFTP
Exit the SFTP Environment
Quit quit SFTP
Exit the SFTP Environment
Rename oldpath newpath rename Remote File
Rename a Remote File
Rmdir path remove remote directory
Delete remote directory
Rm path Delete Remote File
Delete remote files
Symlink oldpath newpath symlink Remote File
Establish a connection
Version show SFTP version
View version
! Command execute 'COMMAND 'in local shell
Execute local shell commands
! Escape to local shell
Enter the local shell Environment
? Synonym for help
Get help
Organize
Root_119atmsn.com
2004/09/20

Http://www.xfocus.net/tools/200408/799.html

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.