如何在solaris查询端口命令中关闭端口

Solaris查看端口号被哪个进程占用的方法_百度知道
Solaris查看端口号被哪个进程占用的方法
答题抽奖
首次认真答题后
即可获得3次抽奖机会,100%中奖。
主要经营计算机网络服务,设计、制作、代理、发布国内各类广告,健康信息咨询。
Solaris下简单的查看端口号被哪个进程占用的方法
1. Solaris 10及一些系统补丁的安装日志一般可以在/var/sadm/install_data目录和/var/sadm/install目录中找到。
2. 用户登录日志可以使用last命令列出
3. a) netstat -na
grep -i listen通常可以看到目前系统侦听的端口号
b) netstat -f inet 和 netstat -f inet6可以看到目前所建立的连接
c) 要想知道某个端口被那个进程所使用,可以使用下面的方面得知:
-bash-3.00# cd /proc
-bash-3.00# for i in *
& do
& echo ------ process $i ---------
& pfiles $i
grep -i &port: 32805&
& done
------ process 0 ---------
------ process 1 ---------
------ process 1025 ---------
------ process 1035 ---------
------ process 1037 ---------
------ process 1038 ---------
------ process 1039 ---------
------ process 1040 ---------
------ process 1041 ---------
------ process 1166 ---------
------ process 123 ---------
------ process 12535 ---------
------ process 12536 ---------
------ process 134 ---------
------ process 141 ---------
------ process 142 ---------
------ process 148 ---------
------ process 164 ---------
------ process 1679 ---------
------ process 1807 ---------
------ process 1817 ---------
------ process 18459 ---------
------ process 18462 ---------
------ process 18464 ---------
------ process 18612 ---------
------ process 18613 ---------
------ process 18615 ---------
------ process 18639 ---------
------ process 18653 ---------
------ process 18680 ---------
------ process 2 ---------
------ process 226 ---------
------ process 290 ---------
------ process 3 ---------
------ process 302 ---------
------ process 303 ---------
------ process 311 ---------
------ process 334 ---------
------ process 372 ---------
------ process 376 ---------
------ process 397 ---------
------ process 398 ---------
------ process 400 ---------
------ process 416 ---------
------ process 418 ---------
------ process 432 ---------
------ process 434 ---------
------ process 435 ---------
------ process 436 ---------
------ process 442 ---------
------ process 443 ---------
------ process 458 ---------
------ process 463 ---------
------ process 464 ---------
------ process 465 ---------
------ process 564 ---------
------ process 565 ---------
------ process 566 ---------
------ process 598 ---------
------ process 599 ---------
------ process 613 ---------
------ process 619 ---------
------ process 631 ---------
------ process 633 ---------
------ process 634 ---------
------ process 637 ---------
------ process 651 ---------
------ process 653 ---------
------ process 666 ---------
------ process 686 ---------
------ process 689 ---------
------ process 6929 ---------
------ process 6932 ---------
------ process 6934 ---------
------ process 6958 ---------
------ process 6959 ---------
------ process 6960 ---------
------ process 7 ---------
------ process 763 ---------
------ process 834 ---------
------ process 836 ---------
------ process 837 ---------
------ process 838 ---------
------ process 839 ---------
------ process 840 ---------
------ process 9 ---------
------ process 990 ---------
------ process 991 ---------
------ process 992 ---------
peername: AF_INET 127.0.0.1
port: 32805
------ process 993 ---------
------ process 994 ---------
sockname: AF_INET 127.0.0.1
port: 32805
从以上的结果可以得知,端口32805被进程992和994所使用。可以进一步使用pfiles &pid&来确认。
为你推荐:
其他类似问题
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。solaris 5.10 如何查看端口,添加端口,关闭端口?【unix吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:10,541贴子:
solaris 5.10 如何查看端口,添加端口,关闭端口?收藏
登录百度帐号solaris10 上如何关某一监听的端口?_百度知道
solaris10 上如何关某一监听的端口?
答题抽奖
首次认真答题后
即可获得3次抽奖机会,100%中奖。
采纳数:107
获赞数:341
一般来说,关闭端口最好直接把相关的服务停掉,Solaris10里使用smf进行管理。简单流程:netstat -an 查端口svcs 看服务svcadm 进行管理-------------------------------------------------------------------------------------------------参考:Solaris 10 启用、重启和关闭服务Solaris 服务管理器(Service Management Facility, SMF)是Solaris 10以及后续版本的Solaris操作系统当中采用的软件服务管理工具。SMF按照服务的相关性来启动、停止和管理服务,并兼容现有的管理习惯(如启动脚本等)。对于使用过Windows的读者来说,SMF的功能类似于“控制面板”中的“服务”;对于使用过Linux和Unix的读者来说,这个功能部分替代了/etc/rc*.d中的启动脚本和超级服务器inetd/xinetd的功能。SMF特性简介当出现了管理错误、软件缺陷或者是硬件缺陷导致服务程序异常中止的时候,SMF可以自动按照一定的次序重新启动服务。使用svcs命令可以查看所有的服务,而是用svcadm和svccfg命令可以管理所有的服务。使用svcs -p命令可以查看与本服务相关联的其他服务。通过服务快照设置可以很容易地实现服务的备份和恢复。通过svcs -x命令可以很容易地对服务进行调试,并且可以使每个服务都有自己的固定日志。所有的服务都可以通过svcadm进行启动和关闭。具有相应角色的非root用户也可以启动、修改和关闭服务。SMF服务标示SFM服务标识(Fault Management Resource Identifier, FMRI)指的是服务实例的命名。举个例子,rlogin服务的FMRI是svc:/network/login:rlogin。同理,类似的FMRI还有svc:/system/system-log:default。SMF服务状态服务的状态包括如下几种类型:状态标示 状态描述degraded 服务已经启动,但是在受限制的状态下运行。disabled 服务处于关闭状态。legacy_run 这个服务目前无法被SMF所管理,但是可以被SMF所监测到。maintenance 维护状态。这个服务有大量的错误并且应该有系统维护人员进行修复。offline 这个服务已经启动,但是处于离线运行状态。online 这个服务已经启动,并且处于在线运行状态。uninitialized 这个服务尚未初始化。SMF相关命令下面我们通过几个具体的实例来介绍SMF的使用方法。这些操作需要您首先拥有root权限。(0) 获得root权限# su(此处需要输入您的root密码。)(1) 察看所有服务的状态# svcs -a(2) 察看sendmail这个服务的状态# svcs sendmail# svcs -l sendmail(3) 察看sendmail这个服务所依赖的其他服务的状态# svcs -d sendmail(4) 关闭sendmail这个服务# svcadm disable sendmail(5) 再次察看sendmail这个服务的状态# svcs sendmail# svcs -l sendmail(6) 启动sendmail这个服务# svcadm enable sendmail(8) 再次察看sendmail这个服务的状态# svcs sendmail# svcs -l sendmail(9) 重新启动sendmail这个服务# svcadm restart sendmail练习SSH 是一种加密远程传输的协议,可以用于登录远程的服务器。和我们经常使用的telnet所不同的是,通过SSH进行传输的信息是经过加密的,所以不容易被第三方所截获和破解。在大部分的Unix/Linux发行版上都提供了SSH服务器和客户端,OpenSolaris Developer Preview版本也是这样。在缺省的状态下,在OpenSolaris Developer Preview版本上SSH服务是打开的。我们可以使用svcs命令检查一下这个服务的状态:# scvs ssh如果SSH服务确实是打开的,我们可以在命令行下通过SSH连接到本机。# ssh localhost如果没有什么意外的话,我们应该可以看到要求您输入密码的提示。这是因为SSH客户短缺省地使用了您当前的用户名作为登陆用户名,因此您只需要提供您的登陆密码就可以了。现在我们关闭SSH服务,然后检查该服务的状态:# svcadm disable ssh# svcs ssh可以看到,这时候SSH服务已经被关闭。如果我们再次尝试通过SSH连接到本机的话,会由于超时而连接失败。# ssh localhost现在我们启用SSH服务,然后检查该服务的状态:# svcadm enable ssh# svcs ssh可以看到,这时候SSH服务已经被起用。如果我们再次尝试通过SSH连接到本机的话,会再次看到要求输入密码的提示。# ssh localhost
采纳数:17
获赞数:12
check /etc/services,and comment the line which has the port you want close .
生命的夏天ing
生命的夏天ing
关闭占用那个端口的软件,端口就自动关闭了.
为你推荐:
其他类似问题
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。如何向 NCA 服务中添加新端口 -
Oracle& Solaris 11.2 网络服务介绍
Oracle& Solaris 11.2 网络服务介绍
Search Term
整个文档库
&&&#&&...&&&#&&&&&#&&&&&#&&&&&#&&&&&#&&
Oracle& Solaris 11.2 网络服务介绍
如何向 NCA 服务中添加新端口
成为管理员。有关更多信息,请参见。
添加一个新端口。向 /etc/nca/ncaport.conf 中添加一个新端口项。此示例在 IP 地址 192.168.84.71 中添加端口 8888。有关更多信息,请参见 。# cat /etc/nca/ncaport.conf
# NCA Kernel Module Port Configuration File
ncaport=*/80
ncaport=192.168.84.71/8888
启动一个新的 Web 实例。地址需要位于包含 NCA 端口配置的文件中,Web 服务器才能将该地址用于 NCA。如果 Web 服务器正在运行,则定义新地址后必须将其重新启动。配置Solaris允许SSH远程登录_百度经验
&&&&&&&&&电脑软件配置Solaris允许SSH远程登录听语音
百度经验:jingyan.baidu.comOracle Solaris 10操作系统安装完成后,默认配置下,不允许root通过SSH登录系统。本文主要描述如何配置Solaris,使得root可以远程登录。百度经验:jingyan.baidu.comSolaris 10百度经验:jingyan.baidu.com11)& 配置/etc/ssh/sshd_config的PermitRootLogin参数## gedit /etc/ssh/sshd_config# cat /etc/ssh/sshd_config# Copyright (c) , Oracle and/or its affiliates. All & rights reserved.## ident &@(#)sshd_config&&& 1.10&&& 10/10/19 & SMI&## Configuration file for sshd(1m)&# Protocol versions supported## The sshd shipped in this release of Solaris has support for & major versions# 1 and 2.& It is & recommended due to security weaknesses in the v1 protocol# that sites run only v2 if possible. Support for v1 is provided & to help sites# with existing ssh v1 clients/servers to transition.# Support for v1 may not be available in a future release of & Solaris.## To enable support for v1 an RSA1 key must be created with & ssh-keygen(1).# RSA and DSA keys for protocol v2 are created by /etc/init.d/sshd & if they# do not already exist, RSA1 keys for protocol v1 are not & automatically created.&# Uncomment ONLY ONE of the following Protocol statements.&# Only v2 (recommended)Protocol 2&# Both v1 and v2 (not recommended)#Protocol 2,1&# Only v1 (not recommended)#Protocol 1&# Listen port (the IANA registered port number for ssh is 22)Port 22&# The default listen address is all interfaces, this may need to & be changed# if you wish to restrict the interfaces sshd listens on for a & multi homed host.# Multiple ListenAddress entries are allowed.&# IPv4 only#ListenAddress 0.0.0.0# IPv4 & IPv6ListenAddress ::&# Port forwardingAllowTcpForwarding no&# If port forwarding is enabled, specify if the server can bind & to INADDR_ANY.# This allows the local port forwarding to work when connections & are received# from any remote host.GatewayPorts no&# X11 tunneling optionsX11Forwarding yesX11DisplayOffset 10X11UseLocalhost yes&# The maximum number of concurrent unauthenticated connections & to sshd.# start:rate:full see sshd(1) for more information.# The default is 10 unauthenticated clients.#MaxStartups 10:30:60&# Banner to be printed before authentication starts.#Banner /etc/issue&# Should sshd print the /etc/motd file and check for mail.# On Solaris it is assumed that the login shell will do these & (eg /etc/profile).PrintMotd no&# KeepAlive specifies whether keep alive messages are sent to & the client.# See sshd(1) for detailed description of what this means.# Note that the client may also be sending keep alive messages & to the server.KeepAlive yes&# Syslog facility and levelSyslogFacility authLogLevel info&## Authentication configuration#&# Host private key files# Must be on a local disk and readable only by the root user & (root:sys 600).HostKey /etc/ssh/ssh_host_rsa_keyHostKey /etc/ssh/ssh_host_dsa_key&# Length of the server key# Default 768, Minimum 512ServerKeyBits 768&# sshd regenerates the key every KeyRegenerationInterval & seconds.# The key is never stored anywhere except the memory of sshd.# The default is 1 hour (3600 seconds).KeyRegenerationInterval 3600&# Ensure secure permissions on users .ssh directory.StrictModes yes&# Length of time in seconds before a client that hasn't & completed# authentication is disconnected.# Default is 600 seconds. 0 means no time limit.LoginGraceTime 600&# Maximum number of retries for authentication# Default is 6. Default (if unset) for MaxAuthTriesLog is & MaxAuthTries / 2MaxAuthTries&&& 6MaxAuthTriesLog 3&# Are logins to accounts with empty passwords allowed.# If PermitEmptyPasswords is no, pass PAM_DISALLOW_NULL_AUTHTOK# to pam_authenticate(3PAM).PermitEmptyPasswords no&# To disable tunneled clear text passwords, change & PasswordAuthentication to no.PasswordAuthentication yes&# Use PAM via keyboard interactive method for authentication.# Depending on the setup of pam.conf(4) this may allow tunneled & clear text# passwords even when PasswordAuthentication is set to no. This & is dependent# on what the individual modules request and is out of the & control of sshd# or the protocol.PAMAuthenticationViaKBDInt yes&# Are root logins permitted using sshd.# Note that sshd uses pam_authenticate(3PAM) so the root (or any & other) user# maybe denied access by a PAM module regardless of this & setting.# Valid options are yes, without-password, no.# PermitRootLogin noPermitRootLogin yes&# sftp subsystemSubsystem&& sftp&&& internal-sftp&&# SSH protocol v1 specific options## The following options only apply to the v1 protocol and & provide# some form of backwards compatibility with the very weak & security# of /usr/bin/rsh.& Their & use is not recommended and the functionality# will be removed when support for v1 protocol is removed.&# Should sshd use .rhosts and .shosts for password less & authentication.IgnoreRhosts yesRhostsAuthentication no&# Rhosts RSA Authentication# For this to work you will also need host keys in & /etc/ssh/ssh_known_hosts.# If the user on the client side is not root then this won't & work on# Solaris since /usr/bin/ssh is not installed setuid.RhostsRSAAuthentication no&# Uncomment if you don't trust ~/.ssh/known_hosts for & RhostsRSAAuthentication.#IgnoreUserKnownHosts yes&# Is pure RSA authentication allowed.# Default is yesRSAAuthentication yes22)& 重启SSH服务,使配置生效# svcadm restart ssh33)& 重启系统可能需要重启Solaris后,root才可以远程登录。# reboot44)& 远程登录Last login: Wed Jan& 7 & 17:14:15 2015 from 192.168.137.105Oracle Corporation&&&&& & SunOS 5.10&&&&& Generic & Patch&& January 2005END百度经验:jingyan.baidu.com非专业人士,请勿直接在生产环境中调试!经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。作者声明:本篇经验系本人依照真实经历原创,未经许可,谢绝转载。投票(1)已投票(1)有得(0)我有疑问(0)◆◆说说为什么给这篇经验投票吧!我为什么投票...你还可以输入500字◆◆只有签约作者及以上等级才可发有得&你还可以输入1000字◆◆如对这篇经验有疑问,可反馈给作者,经验作者会尽力为您解决!你还可以输入500字相关经验00000热门杂志第1期你不知道的iPad技巧3821次分享第1期win7电脑那些事6674次分享第2期新人玩转百度经验1425次分享第1期Win8.1实用小技巧2670次分享第1期小白装大神1963次分享◆请扫描分享到朋友圈}

我要回帖

更多关于 关闭135端口 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信