linux下安装并开启SSH服务
来源:互联网 发布:新手学java看什么书 编辑:程序博客网 时间:2024/04/29 23:44
ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。判断是否安装ssh服务,可以通过如下命令进行:
xjj@xjj-desktop:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
如上所示,表示没有还没有安装,可以通过apt安装,命令如下:
-desktop:~$ sudo apt-get install openssh-server
xjj@xjj-desktop:~$ sudo apt-get install openssh-server
系统将自动进行安装,安装完成以后,先启动服务:
@xjj-desktop:~$ sudo /etc/init.d/ssh start
xjj@xjj-desktop:~$ sudo /etc/init.d/ssh start
启动后,可以通过如下命令查看服务是否正确启动
@xjj-desktop:~$ ps -e|grep ssh
6212 ? 00:00:00 sshd
xjj@xjj-desktop:~$ ps -e|grep ssh 6212 ? 00:00:00 sshd
如上表示启动ok。注意,ssh默认的端口是22,可以更改端口,更改后先stop,
然后start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
最后,应该是连接的时候了。请看如下命令:
xjj@xjj-desktop:~$ ssh exceljava@192.168.158.129
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config
总结:
希望本文介绍的ubuntu下安装使用SSH的方法能够对读者有所帮助,更多有关linux系统的知识还有待于读者去探索和学习。
- linux下安装并开启SSH服务
- Ubuntu14.04下安装并开启SSH服务
- Linux 下开启ssh服务
- Linux 下开启ssh服务
- Linux 下开启ssh服务
- linux安装ssh和开启 ssh服务
- linux开启ssh服务
- Linux开启ssh服务
- linux 开启SSH服务
- Linux开启ssh服务
- Linux开启ssh服务
- Linux开启ssh服务
- Linux开启ssh服务
- Linux开启ssh服务
- Linux开启ssh服务
- Linux开启ssh服务
- Linux开启ssh服务
- Linux开启ssh服务
- Construct Binary Tree from Inorder and Postorder Traversal
- hdu 2028 Lowest Common Multiple Plus(最大公约数最小公倍数)(备战LQB)
- 容器(vector)、数组、new创建的动态数组,你到底用哪一个(执行效率分析)
- c# winform combobox追加数据
- android 之 JNI 详解(五)
- linux下安装并开启SSH服务
- 题目1051:数字阶梯求和 2010年哈尔滨工业大学计算机研究生机试真题
- UITabBarController详解(二)UITabBarController的代理方法以及模态显示
- diray6(打印最小数组)
- HDU1598find the most comfortable road(并查集)
- C++标准库:bitset 用法整理
- python timeit
- 调试经验--交叉编译
- Linux进程间通信之命名管道(FIFO)