1

After reading many pages of documentation and articles on how to telnet or SSH into FreeBSD as root, none have given me a solution that actually works. I am looking for a how-to-remote-into this FreeBSD in less than 10 easy steps.

Current state

  • I am running Windows7 on host machine, subnet 192.168.1.0 255.255.255.0
  • can ping the FreeBSD 8.1 host (running on WMWare) at 192.168.1.145.
  • edited /etc/inetd.conf, /etc/rc.conf. sshd_enable="YES"
  • any attempt to telnet via PutTy to 192.168.1.145 return "connection refused"
  • /etc/rc.d/sshd status returns sshd is not runnin0. what needs to be done to run it?

At the moment I'll take whichever method is easier secure or not. No RTFM answers please.

2 Answers 2

4
  1. Undo whatever you did to inetd.conf.
  2. Edit /etc/ssh/sshd_config, add PermitRootLogin yes
  3. run /etc/rc.d/sshd start

Telnet doesn't work on ssh. You have to connect via ssh in PuTTY.

If you have a firewall up, you'll need to punch a hole.

Security Note: #2 is a really terrible idea. You should either:

  • add your user to the wheel group so they can su to root (pw groupmod -n wheel -m your-user)
  • install sudo (easiest is pkg_add -r sudo).
6
  • I checked and should have added that PermitRootLogin yes of /etc/ssh/sshd_config was already yes. Other maybe relevant and existing settings are #PermitUserEnvironment no, #UsePAM yes, #PermitTunnel no. # means commented out.
    – T. Webster
    Apr 12, 2013 at 3:22
  • Also to undo inetd.conf leaves both ssh and telnet lines commented with # --is that what we want? #login remains unchanged and disabled although it looks like it would be something to enable.
    – T. Webster
    Apr 12, 2013 at 3:24
  • Alright after going back to VMWare snapshot before changing inetd.conf, with everything commented out (satisfying 1), yes (2), and /etc/rc.conf sshd_enabale="YES", and then (3), I have sshd now running.
    – T. Webster
    Apr 12, 2013 at 3:28
  • Didn't explicitly set any firewall configurations besides enabling Windows firewall. At last I have connected via PuTTY. Have not yet implemented security note, but this will work for now in this lab environment.
    – T. Webster
    Apr 12, 2013 at 3:34
  • 1
    inetd is an old server server; it's useful for somethings like tftp and the ancient time protocols (not NTP), but definitely not ssh. Telnet is a terrible idea all around, it's best to just leave that rotting corpse in the ground if you have any option. Glad to head you've got sshd running. If you do implement a firewall, use pf or ipfw (preferably the former if you're unfamiliar with either).
    – Chris S
    Apr 12, 2013 at 3:38
0

Enable SSH

vi /etc/rc.conf
sshd_enable="YES"

Start the SSH service

/etc/rc.d/sshd start

Chech the status

/etc/rc.d/sshd onestatus

You must log in to answer this question.

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