Xshell通过ssh远程连接ubuntu服务器
2020-07-30 08:54
1251 查看
如果ubuntu没有安装ssh服务,自己手动安装ssh-server。
SSH分为:客户端openssh-client、服务端openssh-server,客户端用于连接其他机器,服务端用于外机连接本机(被远程操作)
这里是安装SSH的服务端,用于被远程控制即:openssh-server。(用于远程连接本机)
1.安装ssh[已安装忽略]
sudo apt install openssh-server service ssh start ps -e|grep ssh
查看进程:可以看到sshd那说明ssh-server已经启动了
2.SSH 配置文件
ssh 常用配置文件有两个/etc/ssh/ssh_config 和/etc/sshd_config,ssh_config 为客户端配置文件,sshd_config 为服务器端配置文件。
(1)其中有一条PermitLoginRoot默认是关闭的,禁止使用root用户远程登陆,改为yes,保存推出,就可以允许使用root用户远程登录,更改之后重启sshd服务。
cd /etc/ssh vim sshd_config PermitLoginRoot yes :wq systemctl restart sshd
systemd是Linux系统最新的初始化系统(init),作用是提高系统的启动速度,尽可能启动较少的进程,尽可能更多进程并发启动。
(2)登录root用户之后可以使用以下命令,如果能够连接说明可以远程登录root用户
ssh 127.0.0.1
3.Xshell 连接远程操作服务器
(1)确保此时sshd服务已开启
service ssh status service sshd status ifconfig
(2)在主机输入框,输入服务器ip
(3)连接服务器之后可安装lrzsz程序。
apt install lrzsz
安装之后可以直接在远程(本机)拖放文件到xshell窗口,达到将文件传输至远程服务器的效果。
附:卸载ssh服务
sudo apt-get purge openssh-server sudo apt-get purge openssh-client
相关文章推荐
- [服务器学习]二:使用Xshell 5通过SSH远程连接EC2实例
- Ubuntu通过SSH远程登录服务器建立登陆用户与连接
- ubuntu 14.04桌面版下安装openssh-server以及通过xshell远程连接该服务器(ubuntu)
- ubuntu安装openssh-server 报依赖错误的解决过程 ubuntu自带的有openssh-client,所以可以通过 1 ssh username@host 来远程连接linux 可
- pgcli通过SSH本地端口转发连接远程服务器上的PostgreSQL DB
- 远程连接Ubuntu9 服务器 (putty)ssh 连接
- Ubuntu下使用ssh连接远程服务器
- ubuntu开启ssh服务让crt能远程通过22端口连接系统
- 客户机通过xShell远程访问Ubuntu15.04/16.04LTS连接失败的解决方法
- 用本地linux通过ssh连接远程服务器
- Java通过ssh连接到Linxu和Windos服务器远程启动Tomcat
- Xshell远程连接ubuntu服务器 拒绝连接
- 远程连接Ubuntu9 服务器 (putty)ssh 连接
- 【SSH】Ubuntu下通过SSH远程登录服务器的相关指令和文件传输方法
- window(mobo/xshell) 通过ssh连接Ubuntu16.04
- 通过SecureCRT SSH远程连接服务器并使用Zmodem传送文件
- mac 通过 终端 ssh 远程连接 centos 服务器
- ssh命令通过制定端口连接远程服务器
- Ubuntu下通过SSH远程登录服务器的方法
- Ubuntu下通过SSH远程登录服务器的方法