Ubuntu 18.04基本配置

允许WinSCP使用root连接

默认是不允许的,具体方法出自这里(传送门),修改ssh配置,在/etc/ssh下,修改sshd_config文件

PermitRootLogin yes

即可。默认不允许root通过密码连接。

修改root密码

不知道为什么,我装的时候没让我设置root密码,如果要设置可以在终端输入sudo passwd 命令,接着会让输两次密码,依次输入就设置好了。

允许以密码连接

有时通过终端软件连接时,会发现密码框是灰色的,是因为服务器没开启密码连接方式,还是修改ssh配置,在/etc/ssh下,修改sshd_config文件

PasswordAuthentication yes

即可

邮件服务

Ubuntu上邮件服务工具名字是mailutils,但是并不是装了这个就能直接用,而是要配合ssmtp这个软件

sudo apt-get install mailutils ssmtp -y

网上在Ubuntu上发邮件的文章一搜一大把,但是说到这个ssmtp的,没几个,都特么抄来抄去的,连个出处链接都不贴,当真无耻,找了半天在这里(传送门)找到了,配置ssmtp前面的链接里说的很清晰了,为了防止功利的CSDN破产导致链接打不开,这里再贴一遍

ssmtp装完后配置文件路径是/etc/ssmtp/ssmtp.conf,配置如下:

#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=***@126.com

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.126.com

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=Video

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES

AuthUser=*********@126.com
AuthPass=***********

另一个配置文件是/etc/ssmtp/revaliases,配置如下:

# sSMTP aliases
#
# Format:       local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
#
#
root:***@126.com:smtp.126.com:25
loki:***@126.com:smtp.126.com:25

下面两行是配置允许哪些用户使用mail服务的,不在这个列表中的发送时会报错提示。

posted @ 2019-02-18 14:34  愉快编程  阅读(1533)  评论(0编辑  收藏  举报