linux遠程拷貝及防火牆設置

系統文件:linux

scp遠程copy命令:從linux服務器A的/root/目錄下拷貝文件MySQL-server-5.6.15-1.linux_glibc2.5.x86_64.rpm到linux服務器B的 /usr/local/目錄:ubuntu

登陸服務器B,執行下面命令:centos

scp AloginName@Alogin_ip:/remote/path  /local/path

例如:服務器

[root@iZ287wlb695Z local]# scp root@138.139.122.132:/root/MySQL-server-5.6.15-1.linux_glibc2.5.x86_64.rpm  /usr/local/spa

切換到root用戶: su rootcode

 

vi編輯高亮標記查找server

  如查找文件中  的user_id  和   user_id = 2內容ip

(1) vi  文件名rem

(2) 使用 /          (文件從上往下找)cmd

/ user_id       (高亮標記user_id)

/ user_id = 2  (高亮標記user_id = 2)

單獨 按  N 鍵 ,進行下一個查找

(3 )  使用 ?        (文件從下往上找)

 ?user_id       (高亮標記user_id)

 ?user_id = 2  (高亮標記user_id = 2)

單獨 按  N 鍵 ,進行上一個查找

 

防火牆:

redhat: 

LINUX關閉防火牆命令(遠程訪問系統時用到):

永久性生效,重啓後不會復原:開啓防火牆:chkconfig iptables on 關閉防火牆:chkconfig iptables off

即時生效,重啓後復原:開啓防火牆:service iptables start 關閉防火牆:service iptables stop

ubuntu:  

關閉防火牆 :ufw disable  開啓防火牆: ufw enable

centos:

CentOS 7.0默認使用的是firewall做爲防火牆,這裏改成iptables防火牆步驟。

一、關閉firewall: systemctl stop firewalld.service #中止firewall systemctl disable firewalld.service #禁止firewall開機啓動 firewall-cmd --state #查看默認防火牆狀態(關閉後顯示notrunning,開啓後顯示running)

相關文章
相關標籤/搜索