ubuntu server 安装ssh服务

2019-03-04 23:44|来源: 领悟书生

1.      安装

sudo apt-getinstall openssh-server

Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用apt-get安装上即可。

2.      确认sshserver是否安装好

ps -e |grep ssh

1698 ?        00:00:00 ssh-agent

4473 ?        00:00:00 sshd

如果只有ssh-agent说明ssh-server还没有启动,需要/etc/init.d/ssh start;

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

     

注:在ubuntu-12.04-server-i386.iso安装中只显示sshd这一项:

3.      配置

ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。

然后重启SSH服务: sudo/etc/init.d/ssh restart


本文属于“领悟书生教程网”原创,转载请注明出处。

相关问答

更多
  • 键入aptitude启动包管理器。 在那里你可以看到安装了哪些应用程序。 使用/搜索软件包。 尝试搜索apache2和php5 (或任何您想要使用的版本)。 如果他们被安装,他们应该是大胆的,并在我们面前。 如果没有安装( p在线前面),并且要安装它们(并且具有root用户权限),请使用+选择它们,然后使用g (两次)进行安装。 警告词:在做这些之前,快速浏览网页上的一些aptitude教程可能是明智之举。 Type aptitude to start the package manager. There ...
  • 如果您不需要交互式后端,则需要在导入语句中执行此操作。 顺序非常重要。 先matplotlib,然后matplotlib.use,最后导入pyplot。 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt 这将后端更改为非交互式后端。 如果您确实需要交互式后端,那么忽略此操作并在登录到远程主机时使用ssh -X 。 它允许X11转发。 If you do not need interactive backend, ...
  • 最后弄清楚。 我最终在这里写了一篇关于它的博客文章使用Dropbear SSH解锁Ubuntu Server 16加密的LUKS 。 我写的帖子是基于我在这里找到的答案非常严重的SSH在无服务器启动时解密加密的LVM? 所有这些都是改变了版本16的具体部分。 欢呼亚历克西斯 Manage to figure it out in the end. I ended up writing a blog post about it here Unlocking Ubuntu Server 16 encrypted ...
  • Ubuntu repos有星号,我建议根据经验使用它们。 sudo apt-get install asterisk 你不会得到最新的版本,但它会工作,你会很快。 Ubuntu repos have asterisk, and they are what I recommend using based on experience. sudo apt-get install asterisk You will not get the latest version, but it'll work and y ...
  • 这个publick键可能是puttyGen生成的键。 要将此公钥转换为OpenSSH密钥,您需要在Windows机器中下载putty-key-generator(您可以通过此链接实现此目的 ),加载您的ppk密钥,然后通过菜单Conversion -> Export OpenSSH key ,transform它成为Linux兼容的密钥。 希望能帮助到你! This publick key is probably a puttyGen generated key. To transform this pub ...
  • 您需要通过/ etc / init或/etc/init.d启动vnc服务器作为单独的服务,而不是作为会话的一部分。 You need to start vnc server as a seperate service via /etc/init or /etc/init.d, and not as part of the session.
  • 您可以使用Bash中的&运算符将进程移动到后台。 例如,要在后台运行一些Python进程: $ python somefile.py & 因此,您可以通过在末尾添加&来运行您在后台使用的任何torrent客户端。 You can move a process into the background with the & operator in Bash. For example, to run some Python process in the background: $ python somefile ...
  • 为了使机器恢复到初始状态,有一些选项可以遵循,但这很痛苦,并且无法保证您所做的每个配置都将恢复到其默认设置。 如果您想了解更多信息,请访问AskUbuntu: 如何卸载除默认Ubuntu软件包之外的所有软件包? 我在哪里可以找到初始安装后安装的完整软件包列表? 我可以将所有内容重置为出厂默认设置吗? Imho最好的方法是联系任何有物理访问权限的人,并要求他们从头开始重新安装Ubuntu。 There are some options to follow in order to return the mach ...
  • 默认情况下,VirtualBox的NAT允许虚拟机访问Internet; 但不允许物理机访问虚拟机。 最简单的解决方案是为您的虚拟机使用除NAT之外的其他网络设置 - 例如,网桥应该可以正常工作(尽管您的VM在网络上可见) 。 另一种解决方案是使用端口转发; 关于这一点,本文可能有所帮助: 如何通过ssh访问Virtualbox Guest机器。 By default, VirtualBox's NAT allows the virtual machine to access the Internet ; ...
  • 您必须使用相同的密钥或注册主服务器下的所有密钥。 一旦你有了钥匙,你就可以连接。 How to tell if the keys are copied successfully? user@linux ~ $ ssh-copy-id user@remote /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bi ...