SuSE有两个命令安装软件,zypper,yast2。

zypper,可以看http://www.ha97.com/2718.html。

不同linux版本,ssh的名字有所差异。所以要确认一下。

zypper search ssh

localhost:~ # zypper search ssh
Loading repository data...
Reading installed packages...

S | Name                           | Summary                           | Type   
--+--------------------------------+-----------------------------------+--------
  | ksshaskpass                    | A KDE 4 version of ssh-askpass -> | package
  | libnsssharedhelper0            | Helper functions for sharing NS-> | package
  | libssh-devel                   | SSH library development headers   | package
  | libssh-devel-doc               | SSH library api documentation     | package
i | libssh2-1                      | A library implementing the SSH2-> | package
  | libssh2-devel                  | A library implementing the SSH2-> | package
  | libssh4                        | SSH library                       | package
i | openssh                        | Secure Shell Client and Server -> | package
  | openssh-askpass                | A passphrase dialog for OpenSSH-> | package
  | openssh-askpass-gnome          | A GNOME-Based Passphrase Dialog-> | package
  | pam_ssh                        | PAM Module for SSH Authentication | package
  | sblim-cmpi-ssh_service_profile | Instrumentation for DMTF SSH Se-> | package
  | sshfs                          | Filesystem client based on SSH -> | package
  | yast2-sshd                     | YaST2 - SSH Server Configuration  | package

这个时候,可以用

zypper install openssh

yast2 -i openssh

两种方式都是一样。

装完后,编辑vi /etc/ssh/sshd_config

PermitRootLogin yes

PasswordAuthentication yes

还需要设置开机启动

chkconfig sshd on

ssh就设置完了。不过还需要打开防火墙

SuSEfirewall2 stop

就ok,先停止防火墙。

设置VI

SSH登陆后,发现vi没有语法高亮。

cp /etc/vimrc ./.vimrc

退出,再登陆就ok,非常方便。

设置防火墙

http://os.51cto.com/art/200911/165774.htm

vi /etc/sysconfig/SuSEfirewall2

搜索FW_SERVICES_EXT_TCP

加上22端口就ok。

启动防护墙

SuSEfirewall2 start