ubuntu修改ssh端口
Every time I connect to my Ubuntu development server through my ssh client, I receive the same message and I’m getting tired of seeing it, so I decided to change the message to something else.
每次我通过ssh客户端连接到Ubuntu开发服务器时,都会收到相同的消息,并且我讨厌看到它,因此决定将消息更改为其他内容。
Here’s the message that I get every time:
这是我每次收到的消息:
Linux superfast 2.6.20-16-generic #2 SMP Thu Jun 7 19:00:28 UTC 2007 x86_64
Linux超快2.6.20-16-通用#2 SMP Thu Jun 7 19:00:28 UTC 2007 x86_64
The programs included with the Ubuntu system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.
Ubuntu系统随附的程序是免费软件;每个程序的确切发行条款在/ usr / share / doc / * / copyright中的各个文件中描述。
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted byapplicable law.
在适用法律允许的范围内,Ubuntu绝对不提供担保。
Last login: Mon Aug 13 01:05:46 2007 from ipaddress removed
上次登录时间:从ipaddress删除的2007年8月13日星期一01:05:46
geek@superfast:~$
geek @ superfast:〜$
Changing this message requires editing two different files. The first three sections can be modified by editing the following file:
更改此消息需要编辑两个不同的文件。 可以通过编辑以下文件来修改前三个部分:
/etc/motd
/ etc / motd
This file contains the linux build number as well as the Ubuntu warranty message. I don’t find this particularly useful, so I removed all of it and replaced it with my own message.
该文件包含linux内部版本号以及Ubuntu保修消息。 我觉得这不是特别有用,因此我删除了所有内容,并用自己的信息替换了它。
To disable the last login message (which I don’t recommend doing), you will need to edit the following file in sudo mode:
要禁用上一次登录消息(我不建议这样做),您将需要在sudo模式下编辑以下文件:
/etc/ssh/sshd_config
/ etc / ssh / sshd_config
Find this line in the file and change the yes to no as shown:
在文件中找到此行,然后将yes更改为no,如下所示:
PrintLastLog no
PrintLastLog否
Now when you login, you’ll get a blank prompt, although I wouldn’t necessarily recommend it because it’s useful to see the last login to the system for security reasons. This is my prompt now:
现在,当您登录时,您会得到一个空白提示,尽管我不一定会推荐它,因为出于安全原因,最后一次登录系统很有用。 现在是我的提示:
This is a superfast system. Please max out the cpu accordingly.
这是一个超快的系统。 请相应地最大化CPU。
Last login: Mon Aug 13 01:24:14 2007 from ipaddress removedgeek@superfast:~$
上次登录时间:2007年8月13日星期一01:24:14从ipaddress删除geek @ superfast:〜$
Linux is really great.
Linux真的很棒。
翻译自: https://www.howtogeek.com/howto/ubuntu/change-ssh-welcome-banner-on-ubuntu/
ubuntu修改ssh端口