1

I have just installed FreeBSD 8.1 as a VMWare host and can establish ipv4 connectivity to the instance and telnet through the virtual console. I have also uncommented the /etc/inetd.conf lines

telnet  stream  tcp nowait  root    /usr/libexec/telnetd    telnetd
telnet  stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd

When I login without telnet via new virtual console terminals with login: root and password the default of empty, the login is accepted.

However, when I login remotely via telnet, I am prompted exactly the same as before, except for an additional first line that reads (freebsd.westell.com) (pts/0). I use the same login of root as before but get login incorrect message. What is missing here to successfully login to a telnet session?

For example, root is the only user currently, am I missing adduser?


Alternatively, if someone can show how to configure SSH and login remotely on FreeBSD 8.1, in < 5 easy steps which spell out exactly which configuration files and lines need to be edited, I'll take that. I haven't found this in their documentation.

3
  • Don't do this. Just because the first answer didn't satisfy you is no reason to vandalize your own question. Don't be so impatient! Apr 11, 2013 at 23:40
  • @Gilles maybe you're right, but I am no network or UNIX engineer and with all the UNIX gurus here I find it surprising that I have only received 1 answer to a seemingly basic question. Is this not in some tutorial or documentation page I missed?
    – T. Webster
    Apr 11, 2013 at 23:59
  • it appears to have something to do with nonexistence of /dev/vtyp0, but the file can't be created anyway.
    – T. Webster
    Apr 12, 2013 at 0:26

3 Answers 3

8

Check the file /etc/ttys which contains list of terminals. Only those marked "secure" will allow root to login. By default this is the console and all virtual terminals. Pseudo terminals do not allow root login.

Also, in this day and age, where security is a big concern, may I ask why you are still using an unsecure protocol like telnet and not ssh ?

(edit) thanks to James, I realized I glossed over the FreeBSD and suggested the solution I always used and took for granted on Linux. Unless you have the PAM security add-on's enabled, you will not have this file. Instead, use the file mentioned by James on the answer above.

10
  • I am building a practice lab environment to study for the CCNA, and the most versatile and lightweight OS I know of is FreeBSD. If there's an equivalent OS that's more user-friendly, please let me know since working with the FreeBSD terminal without the scrolling and copy-paste is really a hassle.
    – T. Webster
    Apr 11, 2013 at 20:19
  • Any reason not to SSH to that FreeBSD server and then invoke su - toor ?
    – Hennes
    Apr 11, 2013 at 21:19
  • @Hennes I was unaware of toor command. I am running telnet from Windwos.
    – T. Webster
    Apr 11, 2013 at 23:30
  • I have 5 in /etc/securetity, audit_class, audit_control, audit_event, audit_user, audit_warn. There is no /etc/securetty on my FreeBSD installation.
    – T. Webster
    Apr 11, 2013 at 23:37
  • 1
    Please see the modified answer above. Also, ssh vs. telnet discusssion: please don't dismiss the ssh sughgestions. Even when you are learning, it is best to do the learning, with tools used in the professional world instead of learning in vacuum. And setup of ssh is not a big matter after all.
    – MelBurslan
    Apr 12, 2013 at 6:50
2

First of all, don't use telnetd, FreeBSD has sshd out-of-the-box and it's easy to enable it (paragraph 15.10.2 gives you 2 simple steps). Root login by default disabled in sshd for security reasons, but if you just building testing environment, not facing outer world, you can enable it with PermitRootLogin yes in /etc/ssh/sshd_config.

-1

It is possible, but shouldn't ever be done on anything but a private network where you're the only possible user, because it will open root to be hacked through automated attempts and also show its password in plaintext on your network.

Add lines like this to /etc/ttys

pts/? none network off secure

where ? is a decimal number from 0 upwards. As long as the pty you get is within that range, now you can present the root login and password and login successfully.

Please be warned again that this is unwise. The ssh suggested above is a wiser answer.

5
  • 1
    FreeBSD does not use pts lines in /etc/ttys. Per the man page: "The file ttys contains information that is used by various routines to initialize and control the use of terminal special files. Pseudo-terminals (see pts(4)) are not listed."
    – Jim L.
    Mar 4, 2022 at 20:26
  • Thank you for the intended clarification, which I hope is what it was intended as, and not as a gotcha. Please permit me to add that I have verified the behavior on the latest RELEASE version of FreeBSD, as the instructions for this website say I should. Did you? I found the original question while Googling around to see if there was a way to be this permissive. Is there an ethical problem with doing this on someone else's machine? Possibly. I did it on my own machine. It is true that system configuration does not add these lines. But if added by the administrator, they work. Mar 6, 2022 at 1:47
  • In the case of a private machine on a private network, the passwords and other security are probably only there to keep you from stumbling over your own feet unintentionally, and are about as robustly needed as sudo on most Linuxes. However, *BSD is supposed to be a little more secure than Linux. And it is. A little. I would push back that BSD should actively disallow this behavior to live up to this reputation when exposed to untrusted users. Mar 6, 2022 at 2:02
  • Please edit and add any additional information to your answer, and not in the comments. The comments are generally ephemeral in nature and tend to get deleted after time. They are generally used to request clarification for you to edit into your answer. See this answer to How do comments work?, for additional clarification, if required. Mar 6, 2022 at 5:50
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Mar 8, 2022 at 2:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .