检查是否安装ssh
rpm -qa|grep openssh
启动
service sshd start
ssh配置文件为: /etc/ssh/sshd_config
参数参考:http://lamp.linux.gov.cn/OpenSSH/sshd_config.html
# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes
# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
# no default banner path
#Banner /some/path
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
附件是个基础版
分享到:
相关推荐
### CentOS 7 设置 SSH 服务自动启动 #### 实验环境 - **操作系统**: CentOS 7 Minimal 安装 - **目的**: 设置 SSH 服务在系统启动时自动运行,并且能够修改 SSH 的监听端口。 #### SSH 简介 SSH(Secure Shell)...
完成后,启动SSH服务: ```bash /etc/init.d/sshd start ``` 为了确保安全性,建议禁用密码登录,启用公钥认证。这需要在用户主目录下创建`.ssh`目录,然后将公钥添加到`authorized_keys`文件中。 压缩包中的"SSH...
我们将从检查 SSH 是否安装开始,到设置 SSH 服务为开机启动,最后使用 Xshell 客户端连接到服务器。 知识点 1:检查 SSH 是否安装 在 CentOS 6.5 系统中,SSH 包已经默认安装了,但是我们仍然需要检查是否安装了 ...
如果只有 ssh-agent 进程号,那么说明 SSH 服务还没有启动,可以使用以下命令来启动: sudo /etc/init.d/sshd start 安装 SSH 服务 安装 SSH 服务之前,需要更新源,以便安装最新的 SSH 服务。可以使用以下命令来...
在本例中,使用/etc/init.d目录下的脚本来启动SSH服务。一旦SSH服务运行起来,就可以通过SFTP连接到服务器,使用加密传输来确保文件的安全传输。 对于客户端的安装,需要将openssh软件移植到开发板上,以便使用SFTP...
本文详细介绍了如何在 Linux 下开启 SSH 服务,包括检查 SSH 服务是否安装、启动 SSH 服务、配置 SSH 服务、重启 SSH 服务、设置 SSH 服务随机启动等步骤。通过遵循这些步骤,可以轻松地在 Linux 下开启 SSH 服务,...
如果 SSH 服务已经启动,你将看到类似 `sshd` 或 `ssh-agent` 的进程名。如果没有看到任何与 SSH 相关的进程,可以手动启动 SSH 服务: ```bash sudo /etc/init.d/ssh start ``` #### 四、修改 SSH 配置 SSH 服务...
配置好 SSH 服务后,需要启动 SSH 服务,可以使用以下命令: service sshd start 或者: /ect/init.d/sshd start 四、设置 SSH 服务开机自动运行 要让 SSH 服务在系统启动时自动运行,可以使用以下命令: ...
SSH服务在运维领域非常常见,尤其对于Linux系统来说是不可或缺的工具。但在Windows环境中,由于默认并不提供SSH服务,因此需要借助如FreeSSHd这样的第三方软件。FreeSSHd提供了SSH1和SSH2协议的支持,可以实现包括...
5. **启动SSH服务**: - 使用`/path/to/install/sbin/sshd`启动SSH守护进程。如果系统支持init或systemd,可以设置为开机启动。 6. **测试SSH连接**: - 在开发主机上,使用SSH客户端尝试连接到嵌入式设备:`ssh ...
启动SSH服务可以使用`service sshd start`命令。一旦服务运行,你可以使用`ssh`命令连接到远程主机,例如`ssh 192.168.0.1`,假设目标主机的IP地址是192.168.0.1。 SSH还支持密钥对认证,以进一步增强安全性。你...
总结,离线安装SSH在Ubuntu 16.04中涉及的主要步骤包括:在网络连接的环境中下载SSH安装包,将安装包传输到离线机器,使用`dpkg`和`apt-get`命令安装和解决依赖,最后配置并启动SSH服务。通过这个过程,你可以在没有...
安装完成后,需要启动SSH服务,通过运行`sudo /etc/init.d/ssh start`命令。 在启动SSH服务时,可能会遇到无法加载主机密钥的问题,这会导致SSH连接失败。原因是缺少必要的RSA或DSA密钥对。为了解决这个问题,可以...
`su`命令用于切换用户身份,这里我们使用它来切换到root权限,因为启动SSH服务通常需要管理员权限。`su -c 'service ssh start' root`命令将执行以root用户启动SSH服务的操作。 4. **密码传递**: 在`su`命令执行...
如果结果中没有显示 SSH 服务器程序的进程号,那么可能是 SSH 服务器程序未安装或未启动。在 Ubuntu 11.04 中,默认情况下 SSH 服务器程序并没有安装,可以使用以下命令安装: ``` sudo apt-get install openssh-...
启动 SSH 服务** 安装好 OpenSSH 服务器后,可以通过以下命令启动服务: ```bash # service sshd start # service sshd restart ``` **3. 停止 SSH 服务** 当不再需要 SSH 服务时,可以通过以下命令停止服务: `...
安装完成后,启动SSH服务: ```bash sudo /etc/init.d/ssh start ``` 在初次启动时,你可能会遇到“Could not load host key”错误,这是因为缺少RSA和DSA密钥对。SSH连接需要这些密钥进行身份验证。要生成密钥对...
这将安装`openssh-server`,在本地机器上启动SSH服务,允许远程访问。 3. 安装SSH SFTP服务器: ``` sudo dpkg -i openssh-sftp-server_8.2p1-4ubuntu0.4_amd64.deb ``` 这将安装`openssh-sftp-server`,提供...