我是靠谱客的博主 轻松画笔,这篇文章主要介绍ssh重装ubuntu_ubuntu光盘安装ssh Ubuntu中ssh的安装与用法 - Linux - 服务器之家,现在分享给大家,希望可以做个参考。

ubuntu光盘安装ssh Ubuntu中ssh的安装与用法

发布时间:2017-04-05

来源:服务器之家

SSH分客户端openssh-client和openssh-server

如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-get install openssh-client),如果要使本机开放SSH服务就需要安装openssh-server

sudo apt-get install openssh-server

然后确认sshserver是否启动了:

ps -e |grep ssh

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

如果没有则可以这样启动:sudo /etc/init.d/ssh start

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

然后重启SSH服务:

sudo /etc/init.d/ssh stop

sudo /etc/init.d/ssh start

然后使用以下方式登陆SSH:

ssh username@192.168.1.112 username为192.168.1.112 机器上的用户,需要输入密码。

将 文件/文件夹 从远程 Ubuntu 机拷至本地(scp)

scp -r username@192.168.0.1:/home/username/remotefile.txt .

将 文件/文件夹 从本地拷至远程 Ubuntu 机(scp)

scp -r localfile.txt username@192.168.0.1:/home/username/

将 文件/文件夹 从远程 Ubuntu 机拷至本地(rsync)

rsync -v -u -a --delete --rsh=ssh --stats username@192.168.0.1:/home/username/remotefile.txt .

将 文件/文件夹 从本地拷至远程 Ubuntu 机(rsync)

rsync -v -u -a --delete --rsh=ssh --stats localfile.txt username@192.168.0.1:/home/username/

喜欢

0

最后

以上就是轻松画笔最近收集整理的关于ssh重装ubuntu_ubuntu光盘安装ssh Ubuntu中ssh的安装与用法 - Linux - 服务器之家的全部内容,更多相关ssh重装ubuntu_ubuntu光盘安装ssh内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(129)

评论列表共有 0 条评论

立即
投稿
返回
顶部