[Switch] install OpenSSH-3.6.1p1-Linux general technology-Linux technology and application information, the following is read details. OpenSSH-3.6.1p1
Introduction to OpenSSH
(HTTP): http://sunsite.ualberta.ca/pub/O... nssh-3.6.1p1.tar.gz
(FTP): ftp://ftp.openbsd.org/pub/OpenBS... nssh-3.6.1p1.tar.gz
Version: 3.6.1p1
Software Package Size: 855 KB
Estimated hard disk space required: 8.3 MB
The OpenSSH software package contains the ssh client and the sshd daemon. It is used to encrypt communications on all networks.
OpenSSH depends on:
Openssl-0.9.7a
OpenSSH will use:
X11-ssh-askpass and Linux_PAM-0.77
Install OpenSSH
When connecting to another computer, two processes are running in OpenSSH. A process is a privileged process that controls the publication of necessary privileges. Another process is responsible for communicating with the network. The following command executes some additional installation steps required to set the appropriate environment:
Mkdir/var/empty &&
Chown root: sys/var/empty &&
Groupadd sshd &&
Useradd-g sshd
Run the following command to install OpenSSH:
./Configure -- prefix =/usr -- sysconfdir =/etc/ssh \
-- Libexecdir =/usr/sbin -- with-md5-passwords &&
Make &&
Make install
Command explanation
-- Sysconfigdir =/etc/ssh: this parameter prevents the configuration file from being put into/usr/etc.
-- With-md5-passwords: if you follow the shadowpasswd_plus lfs prompts to change the ssh server when installing the Shadow cipher suite, or the user password of the ssh server you want to connect is encrypted with md5, this parameter is required.
-- Libexecdir =/usr/sbin: OpenSSH places the executable program to/usr/libexec. sftp-server is an sshd tool, and ssh-askpass is an ssh-add tool called as a X11-ssh-askpass. these two items should be put in/usr/sbin instead of/usr/libexec.
Configure OpenSSH
Configuration File
/Etc/ssh/ssh_config,/etc/ssh/sshd_config
We do not need to modify these files. Of course, you can also modify them to set proper security for your system. For configuration information, see sshd, ssh, and man page of ssh-agent.
Sshd init. d script
Note that the sshd server must be run only when you want to access your machine through ssh. The following script is not required for the ssh client. If you want to run the ssh daemon, run the following command to create the sshd init. d script:
Cat>/etc/rc. d/init. d/sshd <"EOF"
#! /Bin/sh
# Begin $ rc_base/init. d/sshd
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans-gerard@linuxfromscratch.org
Source/etc/sysconfig/rc
Source $ rc_functions
Case "$1" in
Start)
Echo "Starting SSH Server ..."
Loadproc/usr/sbin/sshd
;;
Stop)
Echo "Stopping SSH Server ..."
Killproc/usr/sbin/sshd
;;
Reload)
Echo "Reloading SSH Server ..."
Reloadproc/usr/sbin/sshd
;;
# End $ rc_base/init. d/sshd
EOF
Chmod 755/etc/rc. d/init. d/sshd
Use the following command to create a symbolic link in the corresponding rc. d directory:
Cd/etc/rc. d/init. d &&
Ln-sf ../init. d/sshd ../rc0.d/K30sshd &&
Ln-sf ../init. d/sshd ../rc1.d/K30sshd &&
Ln-sf ../init. d/sshd ../rc2.d/K30sshd &&
Ln-sf ../init. d/sshd ../rc3.d/S30sshd &&
Ln-sf ../init. d/sshd ../rc4.d/S30sshd &&
Ln-sf ../init. d/sshd ../rc5.d/S30sshd &&
Ln-sf ../init. d/sshd ../rc6.d/K30sshd
Content
The OpenSSH software package contains ssh, sshd, ssh-agent, ssh-add, sftp, scp, ssh-keygen, sftp-server, and ssh-keyscan.
Description
Ssh
It is similar to the rlogin/rsh client.
Sshd
The daemon process that allows you to log on.
Ssh-agent
An authorization proxy that saves the private key.
Ssh-add
Tool used to add a key to the ssh-agent.
Sftp
Use SSH1 and SSH2 protocol-like FTP programs.
Scp
Similar to rcp.
Ssh-keygen
Secret generation tool.
Sftp-server
SFTP Server Subsystem.
Ssh-keyscan
A tool used to collect public host keys from a batch of hosts.
After I started the instance, I found that the ssh service could not be connected. Later I checked that the ssh service was not started. Later I started it manually, but the result was that it could not be started, later I found out that because the ssh owner is also the issue of permission restriction, the permission in Linux is very important. Later I found that after I changed the owner of the ssh directory to root, it started smoothly, the specific steps to solve the problem are as follows:
Linux SSH cannot be started
Report/var/empty/sshd must be owned by root and not group or world-writable.
Solution:
First, go to linux Through the physical terminal, and manually check ssh to find that it is not running.
-Bash-2.05b #/etc/init. d/sshd status
Sshd is stopped
Manually start the service and report permission errors.
-Bash-2.05b #/etc/init. d/sshd start
Starting sshd:/var/empty/sshd must be owned by root and not group or world-writable.
[FAILED]
-Bash-2.05b #
Run the rpm-V command to check that the ssh software package is normal, but the owner of a directory is incorrect.
-Bash-2.05b # rpm-V openssh-server
S.5...... c/etc/ssh/sshd_config
... U.../var/empty/sshd
-Bash-2.05b #
It is found that the owner of this directory is not root, so an error is reported when the ssh service is started.
-Bash-2.05b # ls-ld/var/empty/sshd/
D -- x 2 vu00106 root 1024 Feb 2 2005/var/empty/sshd/
-Bash-2.05b #
Changed to root owner. started successfully.
-Bash-2.05b # chown root/var/empty/sshd/
-Bash-2.05b #/etc/init. d/sshd start
Starting sshd: [OK]
-Bash-2.05b #
Now the problem is fixed.
In addition, you can try:
This is a permission issue.
You can take the following two steps to solve the problem:
Chown-R root. root/var/empty/sshd
Chmod 744/var/empty/sshd
Service sshd restart
The above problems can be solved.
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.