配置ssh/IP/fw/xhost
配置ssh/IP/防火牆
/etc/rc.d/init.d/sshd start
/etc/sysconfig/network-scripts/ifcfg-eth0
service iptables stop --停止
[@more@]安裝linux的時候,ssh自帶的也給安裝上了,但並不能直接使用,還需要啟用:
啟用ssh:
/etc/rc.d/init.d/sshd start
service sshd start
netstat -tl
啟用以後,每次開機還都得重新啟用。
可以在啟動linux時自動啟動ssh:
在檔案/etc/rc2.d/S99local裡面加入 /usr/sbin/sshd &
(/usr/sbin/sshd 是ssh啟動的)
這樣每次開機以後就不用再次啟用,直接就可以遠端控制。
xhost 是用來控制X server訪問許可權的。 如使用VNC等工具連Linux時,通常當你從hostA登陸到hostB上執行hostB上的應用程式時, 需要在hostB上以root使用者執行xhost + 來使其它使用者能夠訪問hostB的Xserver.
xhost + 是使所有使用者都能訪問Xserver.
xhost + ip使ip上的使用者能夠訪問Xserver.
xhost + nis:user@domain使domain上的nis使用者user能夠訪問
xhost + inet:user@domain使domain上的inet使用者能夠訪問。
防火牆
linux 下修改防火牆配置需要修改 /etc/sysconfig/iptables 這個檔案,如果要開放哪個埠,在裡面新增一條
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT就可以了,其中 1521 是要開放的埠號,然後重新啟動linux的防火牆服務。
停止/啟動防火牆服務的命令:
用root登入後,執行
service iptables stop --停止
service iptables start --啟動
(service命令位於/sbin)
防火牆規則只有在 iptables 服務執行的時候才能被啟用。要手工啟動服務,使用以下命令:
/sbin/service iptables restart
要確保它在系統引導時啟動,使用以下命令:
/sbin/chkconfig --level 345 iptables on
ipchains 服務不能和 iptables 服務同時執行。要確定 ipchains 服務被禁用,執行以下命令:
/sbin/chkconfig --level 345 ipchains off
配置IP地址:
/etc/sysconfig/network-scripts/ifcfg-eth0
裡面的內容:
[root@localhost network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.0.2
USERCTL=no
PEERDNS=yes
GATEWAY=192.168.0.1
配置完以後:
/etc/init.d/network reload 或 service network
檢視網路卡資訊: route -n檢視物理網路卡:mii-tool重啟eth0: ifup eth0檢視eth0信
息:ethtool eth0新增IP地址:ifconfig eth0 IP netmask 子網掩碼 broadcast 廣播地址
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/668365/viewspace-1003303/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- git配置sshGit
- git ssh配置Git
- window下配置SSH連線GitHub、GitHub配置ssh keyGithub
- Fatal firmware error: Driver detected possible FW hang, halting FWError
- shell禁止非法IP ssh登入
- SSH框架整合配置所需JAR包(SSH整合)框架JAR
- linux xhost命令介紹Linux
- [zhuan]linux限制IP訪問sshLinux
- git ssh配置詳解Git
- SSH框架之VO配置框架
- GitLab配置ssh keyGitlab
- Ubuntu 12.04配置SSHUbuntu
- SSH linux下配置。Linux
- Oracle安裝,ssh配置Oracle
- RedHat配置IPRedhat
- ssh禁止root登入及遮蔽指定ip
- gitlab配置ssh金鑰Gitlab
- git配置多個ssh keyGit
- Git HTTP和SSH 代理配置GitHTTP
- SSH&ProxyChains配置教程AI
- Git 多賬號 SSH 配置Git
- Ubuntu 配置SSH伺服器Ubuntu伺服器
- git倉庫配置git sshGit
- SSH配置檔案詳解
- 手動配置ip
- linux解決xhost: unable to open displayLinux
- linux解決xhost unable to open display‘’Linux
- Linux錯誤:xhost unable to open displayLinux
- Python Fabric ssh 配置解讀Python
- 配置SSH免密碼登陸密碼
- Linux伺服器---ssh配置Linux伺服器
- 專案管理之——Git SSH配置專案管理Git
- 13、環境-配置git-sshGit
- Git 中 SSH Key 生成和配置Git
- Github配置ssh連結win、macGithubMac
- Linux配置SSH免登入Linux
- aix 下配置ssh的等效性AI
- jenkins配置svn、gradle、sshJenkinsGradle