Ubuntu12.04之SSH

Ubuntu 12.04 关于SSH的知识

(1)安装完ubuntu系统12.04。


(2)查看网络配置,输入命令ip addr后,显示有IP地址。


 (3)使用SSH终端工具Xshell连接系统,发现连接不上。


 (4)使用命令查看SSH信息 :ps -e | grep sshd,没有信息。


 (5)安装ssh-server:sudo apt-get install openssh-server。


 (6)使用命令查看SSH信息:

test@localhost:~$ ps -e | grep sshd
3903 ? 00:00:00 sshd
3940 ? 00:00:00 sshd
4088 ? 00:00:00 sshd

说明:

  如果看到sshd那说明ssh-server已经启动了。 

  如果只有ssh-agent说明ssh-server还没有启动,需要执行命令启动ssh服务:

  /etc/init.d/ssh start;
  注:在ubuntu-12.04-server-i386.iso安装中只显示sshd这一项。


 (7)再次使用Xshell连接系统,成功连接。


 (8)更多知识:

  SSH默认服务端口为22,用户可以自已定义成其他端口,如222,需要修改的配置文件为:
  /etc/ssh/sshd_config
  把里面的Port参数修改成222即可
  然后重启SSH服务:sudo/etc/init.d/ssh restart


 

猜你喜欢

转载自www.cnblogs.com/gyfluck/p/9334423.html
今日推荐