大网数据广告活动
服务器运维问答

How to enable ssh on startup in opensuse

· 52CE 我爱测

My experience with Linux is limited and as part of a project, I ordered a Linux dedicated server. This is an unmanaged server with OpenSuSE 13.2. When I try to ssh into the server, I get a connection refused message ssh: connect …

问题原文

原帖链接 · Mat J · CC BY-SA 3.0

My experience with Linux is limited and as part of a project, I ordered a Linux dedicated server. This is an unmanaged server with OpenSuSE 13.2. When I try to ssh into the server, I get a connection refused message

ssh: connect to host xxx.xxx... port 22: Connection refused

I think their default image does not comes with ssh enabled on startup but I may be wrong. They provide a rescue system which is a Linux system installed and loaded from ram for troubleshooting. When I load this, I can connect to the system via SSH. I can mount the hdd and make changes.

I'd like to know how to check and/or whatever configuration changes that need to be done to enable ssh on startup for OpenSuSE 13.2 from within a recovery system. I can provide any configuration file contents if required. I'm basically from a Windows background and hence if you can provide verbose steps, it will be helpful.

As part of my research, I checked init.d file, there was no sshd file in there, ssh is installed I guess as there exists files in /etc/ssh like `/etc/ssh/sshd_config.

社区高分解答

原帖链接 · hesonline · CC BY-SA 3.0

1. Verify installation

Run which sshd to get the path it is called from. If you don't get /usr/sbin/sshd in response, it is most likely not installed.

2. Installing sshd

Run zypper in openssh to install the application.

3. Check firewall

Run the command cat /etc/sysconfig/SuSEfirewall2 | grep sshd.

You need to see FW_CONFIGURATIONS_EXT="sshd" - This means the firewall allows incoming traffic on port 22.

If you do not find it, you may add it using a text editor like this:

vi /etc/sysconfig/SuSEfirewall2 and locate the line where it says FW_CONFIGURATIONS_EXT="" and change it to FW_CONFIGURATIONS_EXT="sshd"

4. Check the service is running

systemctl status sshd | grep Active - If you get Active: inactive (dead) you need to start it with systemctl start sshd.

Run the command again systemctl status sshd | grep Active and you should now see Active: active (running) since ...

5. Enable SSH on startup

systemctl enable sshd

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。