having trouble with freeBSD box

  • rjstephens
  • Professor
  • Professor
  • User avatar
  • Posts: 774
  • Loc: Brisbane, Australia

Post 3+ Months Ago

Last night I decided to try somethinhg new and install freeBSD on my LAN server (rather than linux), but its not working as I hoped. I'm having several problems.

1. I can't su to root, this happens:
$ su root
su: you are not in the correct group (wheel) to su root.
$

2. I can't log into root through ssh, it tells me access denied (as if I had entered the wrong password). I can log in as root fine when I'm physically at the box.

3. ports seems to be downloading old versions of software (pure-ftpd 1.0.18, apache 1.3.28), is this normal? How do I fix it? How do I upgrade to the latest versions?

4. The default shell was annoying, so I used ports to download and install bash. bash works, but I have to start it manuall by typing /usr/local/bin/bash . Changing the last column in the /etc/passwd file has no effect. How do I get bash to start when I log in?

5. Again with bash, how do I get it to show the username@hostname:path$ like on linux, rather than just bash?

By the way, I'm using freeBSD 4.10 installed through anonymous FTP (I didn't have any spare blank CDs)

Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • rjstephens
  • Professor
  • Professor
  • User avatar
  • Posts: 774
  • Loc: Brisbane, Australia

Post 3+ Months Ago

OK, I've just given up on freeBSD (Apache is refusing to start). I'll just use linux, it works well enough.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

rjstephens wrote:
Last night I decided to try somethinhg new and install freeBSD on my LAN server (rather than linux), but its not working as I hoped. I'm having several problems.

1. I can't su to root, this happens:
$ su root
su: you are not in the correct group (wheel) to su root.
$



Add yourself to the wheel group.
If you own the box, then you can log in as root; edit /etc/group. first is wheel. Add a comma after toot (or your root user) then your userid. Done.

rjstephens wrote:

2. I can't log into root through ssh, it tells me access denied (as if I had entered the wrong password). I can log in as root fine when I'm physically at the box.


Yes, this is a "good thing" -- by default root is disallowed remote access. This is why people su to root, or install sudo. You never, repeat NEVER EVER want your root login permitted remotely. Because of that reason, I won't even go into how to disable that.

rjstephens wrote:

3. ports seems to be downloading old versions of software (pure-ftpd 1.0.18, apache 1.3.28), is this normal? How do I fix it? How do I upgrade to the latest versions?


You "fix" it by learning a beautiful little command called cvsup.
Here's the short version.
Install any version of cvsup -- even if it's old in the ports collection. (/usr/ports/net/cvsup is where it should be.
cd to that dir, type make install clean.

Ok, you now have cvsup. Now, copy the default supfiles to say, your home dir or root dir -- provided you first enabled root su as mentioned previously. ;)

You know what, forget it. I am going to make it even easier.
Cut and paste this into a text document, and scp it over to your freebsd box.

Code: [ Select ]
*default host=cvsup.freebsd.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=RELENG_4
*default delete use-rel-suffix

src-all
ports-all tag=.
  1. *default host=cvsup.freebsd.org
  2. *default base=/usr
  3. *default prefix=/usr
  4. *default release=cvs tag=RELENG_4
  5. *default delete use-rel-suffix
  6. src-all
  7. ports-all tag=.

Name that file supfile.

Then, as root user, type cvsup supfile from the dir you placed the supfile.
This will take some time if you are on FBSD 4.1 -- it's going to update the source to your box to 4.9 STABLE, AND upgrade your ports collection.

The reason you maintain old ports, is because as programs change, they have new requirements; it's entirely possible that FBSD 4.1 cannot sufficiently run a product developed last week, ergo the snapshot. You update your source, you recompile, and you have the latest ports.

The next step will be to run make world.

This recompiles your whole operating system, thereby compiling it on *your* architecture. This is why FBSD is so stable -- it is installed -- read: compiled -- *locally*, instead of some binary package install. Ish.

so, cd /usr/src
make buildworld
This take some time.
Then when it's done,
make installworld

You may or may not need a new kernel, I can't recall what UPDATING changes from 4.1 to 4.9 there were. You can try at this point to just recompile the old kernel to see if all is well.

As a safety measure, I always copy the GENERIC kernel to a new name, and edit/compile that. Your call.

If you wish to, cd /usr/src/sys/i386/conf
cp GENERIC <NAME>
The name I pick is always the box name, FOO, SHINOBI, etc. Always in caps too -- it's a standard. :)

Once you do that -- and I won't get into editing it right now -- go back to
/usr/src
type;
make buildkernel KERNCONF=<NAME>
Whatever name you gave the file.
When it's done, you
make installkernel KERCONF=<NAME>

Ok, whew. Still with me?
Then you may go into any port you choose, and just do a
make install clean

It's all a lot easier than it sounds, and it really will provide you with a better (STABLE) system. The reason for all of this again, is the fact you are starting with such old source.


rjstephens wrote:

4. The default shell was annoying, so I used ports to download and install bash. bash works, but I have to start it manuall by typing /usr/local/bin/bash . Changing the last column in the /etc/passwd file has no effect. How do I get bash to start when I log in?


Well, my only thought on this is you have the wrong path.
If it reads /bin/bash, it's probably not right. You installed bash as a userland proc, therefore it will prob exist in /usr/local/bin/bash or some such. In fact, I would not be surprised if when you try to login, it shows something like; 'shell could not be found, reverting to sh' or some such.

Run
find / -name bash
Make note of the dir.
Edit /etc/passwd to show this dir. Bash away.


rjstephens wrote:

5. Again with bash, how do I get it to show the username@hostname:path$ like on linux, rather than just bash?

By the way, I'm using freeBSD 4.10 installed through anonymous FTP (I didn't have any spare blank CDs)

Thanks in advance.


When bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and
~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

So maybe copy your .profile to .bash_profile.

Edit it thusly;
Code: [ Select ]

# set prompt: ``username@hostname:/directory $ ''
PS1="[\u@\h:\w] " 
case `id -u` in
   0) PS1="${PS1}# ";;
   *) PS1="${PS1}$ ";;
esac
  1. # set prompt: ``username@hostname:/directory $ ''
  2. PS1="[\u@\h:\w] " 
  3. case `id -u` in
  4.    0) PS1="${PS1}# ";;
  5.    *) PS1="${PS1}$ ";;
  6. esac


Done.

Cheers.
[/code]
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

You gave up after only 3 hours? Sigh.

Ok.
  • Sunday
  • Beginner
  • Beginner
  • User avatar
  • Posts: 54
  • Loc: Chicago

Post 3+ Months Ago

Well it's going to help me anyways :anonymous:
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Sunday wrote:
Well it's going to help me anyways :anonymous:


Thanks Sunday. :)

Cheers.
  • rjstephens
  • Professor
  • Professor
  • User avatar
  • Posts: 774
  • Loc: Brisbane, Australia

Post 3+ Months Ago

Quote:
You gave up after only 3 hours? Sigh.

yeah, i do that ;)
I'm not very persistent. I like to learn new things, but I already know how to set up a linux box to do everything I need, and freebsd was starting to really get on my nerves.

I'll tell you what happened with apache.

I installed it from ports at first, and run /usr/local/sbin/apachectl start . It gave me a configuration error related to ServerName. I edited the config file, fixed it, and then it appeared to start.

Trouble is, it hadn't actually started. Going to http://localhost/ in links didn't work, and typing the machines IP in from my windows PC didn't help either. On closer inspection, there were no httpd processes in the proceass list.

So I tried again, but got the same problem. I removed apache and installed a different version. Same problem. I downloaded from the net and compiled from source manually. Same problem. Which led me to believe it was a freebsd issue, as I had never seen apache do that before (not actually start, but not provide any error message or reason)


About the remote root, I guess it is a good thing, but the box is only over my LAN. Maybe I could configure it to only let my IP range (192.168.2.*) to do this.

(I guess it doesn't matter now, cause I'm using linux. But thanks anyway.

P.S. Most linux distros allow remote users to log in as root, what's up with that?
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

rjstephens wrote:
Quote:
You gave up after only 3 hours? Sigh.

yeah, i do that ;)
I'm not very persistent. I like to learn new things, but I already know how to set up a linux box to do everything I need, and freebsd was starting to really get on my nerves.

I'll tell you what happened with apache.

I installed it from ports at first, and run /usr/local/sbin/apachectl start . It gave me a configuration error related to ServerName. I edited the config file, fixed it, and then it appeared to start.

Trouble is, it hadn't actually started. Going to http://localhost/ in links didn't work, and typing the machines IP in from my windows PC didn't help either. On closer inspection, there were no httpd processes in the proceass list.

So I tried again, but got the same problem. I removed apache and installed a different version. Same problem. I downloaded from the net and compiled from source manually. Same problem. Which led me to believe it was a freebsd issue, as I had never seen apache do that before (not actually start, but not provide any error message or reason)


About the remote root, I guess it is a good thing, but the box is only over my LAN. Maybe I could configure it to only let my IP range (192.168.2.*) to do this.

(I guess it doesn't matter now, cause I'm using linux. But thanks anyway.


Oi. Well, not sure... if it were me I would have checked the logs. :) Usually tells you right off the bat. Hey, that's me and to each his own. If you're happy with what you have, bingo! We have a winner! ;)

rjstephens wrote:
P.S. Most linux distros allow remote users to log in as root, what's up with that?


Which is precisely why I don't use them. It's also why the linux we use here at Big Blue is highly customized images. NO ROOT LOGIN! That's like compusec 101. ;)

Cheers.

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 18 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.