怎么在linux里面修改端口号

怎么在linux里面修改端口号,第1张

Linux下修改端口号只需要更改相应服务的配置文件即可,下面以修改linux 的SSH服务的默认端口号22为例(把22修改我2501):

1、修改/etc/ssh/sshd_config配置文件

[root@localhost ssh]# more sshd_config 

#       $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp $

# This is the sshd server system-wide configuration file.  See

# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with

# OpenSSH is to specify options with their default value where

# possible, but leave them commented.  Uncommented options change a

# default value.

#Port 22             //先把22注释掉

port 2501            //添加一个新的端口

#Protocol 2,1

2、重启ssh服务让修改的端口号生效

[root@localhost ~]# service sshd restart

Stopping sshd:[  OK  ]

Starting sshd:[  OK  ]

一般来说只要把sendmail的service起起来就可以发内网邮件了

方法1 安装sendmail即可使用, mail -s "test" user@sohu.com <content.txt

bin/mail会默认使用本地sendmail发送邮件,这样要求本地的机器必须安装和启动Sendmail服务,配置非常麻烦,而且会带来不必要的资源占用。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/8386963.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-15
下一篇2023-04-15

发表评论

登录后才能评论

评论列表(0条)

    保存