一台Linux电脑连接另一台Linux(SSH实现linux之间的免密码登陆)

首先查看是否安装ssh服务:systemctl status sshd.service

    启动服务:systemctl start sshd.service
    重启服务:systemctl restart sshd.service
    开机自启:systemctl enable sshd.service

若已安装就行,否则 输入:yum install openssh-server安装

安装完成后在终端输入:ssh username@IP(该IP是要连接的计算机ip)

拷贝远程服务器的文件到本地:

    scp -r -P  端口号   用户名@IP地址:/usr/local/tomcat_airc/webapps/  /tmp/kyj/

拷贝本地文件到远程服务器:

    scp -r   /tmp/kyj/sys.war  用户名@IP地址:/usr/local/tomcat_airc/webapps/

猜你喜欢

转载自blog.csdn.net/qq_25948717/article/details/80310641
今日推荐