FreeBSD Newbie Progress Day 3

FreeBSD Newbie Progress Day 3

Post by Totally Jayynes » Tue, 13 Nov 2001 06:03:28



First off, a question.  Trying to be a good doobie and log in with my
user account an only using su to root when needed.  But when I am my
regular user account, when I try to use the arrow keys to repeat last
command, when I hit the up arrow, instead of getting the last command,
I get ^[[A and similar things for the other arrow keys... any help
here would be appreciated.

Trying to get the ProFTPd set up to to except connections... at
www.proftpd.org and reading through the Manual right now... whew,
manual is written for Unix users....  but am gonna try my best before
I start asking questions along the lines of Proftpd :)
Totally Jayynes

 
 
 

FreeBSD Newbie Progress Day 3

Post by Jason Dento » Tue, 13 Nov 2001 06:15:50


I'm betting that you are used to the bash shell under linux? FreeBSD
defaults (I beleive) giving users the csh, which doesn't do key history
(to my very limited knowldge). I deal with this by using chpasswd to
edit my user profile so that my default shell is bash (which you can
install from the CD or from ports).

FreeBSD comes with an FTP sever already installed, and running from
inetd by default. This server does not allow anonymous access by default
(but can be configured for it), but does allow non-root users to log in
and transfer files like you would expect. This works fine for me. I
don't use it for anything but my own use, so I don't know how it stacks
up against other ftp servers.

Jason

 
 
 

FreeBSD Newbie Progress Day 3

Post by Philip Paep » Tue, 13 Nov 2001 06:23:51



> First off, a question.  Trying to be a good doobie and log in with my
> user account an only using su to root when needed.  But when I am my
> regular user account, when I try to use the arrow keys to repeat last
> command, when I hit the up arrow, instead of getting the last command,
> I get ^[[A and similar things for the other arrow keys... any help
> here would be appreciated.

Try changing your shell to tcsh(1) instead of sh(1), the default.  This can be
done with vipw(8).

As root, do the following:

# vipw

Use the arrow-keys to find your account.  The last field in the file will say:

| /bin/sh

Change this to say:

 | /bin/tcsh

You do this by putting the cursor over the 's', and pressing 'x' until 'sh' is
gone.  Then you type 'i' and 'tcsh'.  Then you press 'ESC' followed by ':x' to
save the file.

Bit tough getting used to vi(1) at first, but quite rewarding in the end.

# -- snip snip -- #

 - Philip

--

  If a thing is done wrong ofter enough
  it becomes right.

 
 
 

FreeBSD Newbie Progress Day 3

Post by Jed Clea » Tue, 13 Nov 2001 06:35:07



> First off, a question.  Trying to be a good doobie and log in with my
> user account an only using su to root when needed.  But when I am my
> regular user account, when I try to use the arrow keys to repeat last
> command, when I hit the up arrow, instead of getting the last command,
> I get ^[[A and similar things for the other arrow keys... any help
> here would be appreciated.

What shell are you using?  (echo $SHELL)  The older default ones don't
support up arrow.  Of course to make a liar out of of me, it looks like
the FreeBSD csh does.  The Bourne shell, sh(1) does what you are
experiencing.  Look into chsh(1).  Recommending a different shell to you
would probably spark a religious war in c.u.b.f.m, so that is left as an
exercise to the reader.  Just make sure what you pick is in or gets
added to /etc/shells.  Be very careful modifying the root shell.  You
probably want that to be /bin/sh or /bin/csh.  Which are what toor and
root default to.

Quote:

> Trying to get the ProFTPd set up to to except connections... at
> www.proftpd.org and reading through the Manual right now... whew,
> manual is written for Unix users....  but am gonna try my best before
> I start asking questions along the lines of Proftpd :)

It's very satisfying to figure things out for yourself.
 
 
 

FreeBSD Newbie Progress Day 3

Post by Andrew Giert » Tue, 13 Nov 2001 06:55:39


 Jed> What shell are you using?  (echo $SHELL) The older default ones
 Jed> don't support up arrow.  Of course to make a liar out of of me,
 Jed> it looks like the FreeBSD csh does.  The Bourne shell, sh(1)
 Jed> does what you are experiencing.

... but set -E will fix that.

--
Andrew.

 
 
 

FreeBSD Newbie Progress Day 3

Post by Totally Jayynes » Tue, 13 Nov 2001 07:09:05


On Sun, 11 Nov 2001 14:15:50 -0700, Jason Denton


>I'm betting that you are used to the bash shell under linux? FreeBSD

Ha, nope... not used to any of the shells yet, just kinda still
getting used to the concept of using differrent shells and why I would
want to.... this is my third day on FreeBSD, so I am using whatever
the default shell is when I log in... I think it is csh for root...
the prompt is a #.  But when I log in as my user account, % is the
prompt, does that mean I am in a different shell?

Quote:>FreeBSD comes with an FTP sever already installed, and running from
>inetd by default. This server does not allow anonymous access by default
>(but can be configured for it), but does allow non-root users to log in
>and transfer files like you would expect. This works fine for me. I
>don't use it for anything but my own use, so I don't know how it stacks
>up against other ftp servers.

Well, I want to avoid anonymous log-ins.  This will be a box I will be
putting into *space so I can access my ftp from anywhere I can
access the internet.  So want to have as much control over who is
allowed to log into my ftp server as possible and also try to make it
as hard as possible for those I don't want having access but happened
to find it.



Quote:>Try changing your shell to tcsh(1) instead of sh(1), the default.  This can be
>done with vipw(8).

>As root, do the following:

># vipw

Ah, looks like this was it... before making the changes with vipw, I
decied to test this by just changing shells with my user account to
csh and POOF, I had the ability to recall past commands.  Looks like
Jason was right and I actually AM used to a shell already :)

Quote:>Bit tough getting used to vi(1) at first, but quite rewarding in the end.

Not a pro at vi but luckily I do know a tiny bit about it or I would
be completely lost in there... when possible, I try to use ee which is
a bit more user friendly.



Quote:>What shell are you using?  (echo $SHELL)  

Looks like I was using the csh shell.  I find it kinda odd that that
root defaults to one shell, but user accounts default to a differrent
shell.  Anyway, I can manually change the shell my user starts in by

ee /etc/passwd

and changing the line

jay:*:1001:1001.................:/bin/sh
to
jay:*:1001:1001.................:/bin/csh

I guess I will just have to remember in the future when creating users
with the adduser command to make sure I don't go with the default
shell, which is sh.

Quote:

>> Trying to get the ProFTPd set up to to except connections... at
>> www.proftpd.org and reading through the Manual right now

>It's very satisfying to figure things out for yourself.

Most of the time, I whole heartedly agree with you on this.  But this
also highly depends on the level of someones determination and ability
to ward off frustration.  After reading through most of the Manual on
www.proftd.org, I have a lot better idea for security concerns and
featurs of proftpd, but I don't feel any closer to being able to get
it going.

I also did some searches for Howto setup proftpd through google, and
although I had a lot of hits, none of them were quite what I was
looking for, which was basically a hand holding through a first time
set-up, and then I could explore and tweak from there.

The list of things I KNOW I have to accomplish are (in no particular
order):

1.  Establish a user account to use with ftp
2.  tell proftpd that I want to use /ftp as the default space for
uploads and d/ls (I will create more better tree later)
3.  Block the user accont from being able to move below the /ftp
directory
4.  Start the ftp daemon and have it listen on the ftp port for
incoming connections.

I think that is the minimums... just gotta figure out how to do it
now... anyone know of a step by step doc out there?  Even if it isn't
necessarily for ProFTPd, I could always start with a different FTP
Server this way because I am sure a lot of it will translate over to
another server.
Totally Jayynes

 
 
 

FreeBSD Newbie Progress Day 3

Post by Totally Jayynes » Tue, 13 Nov 2001 07:16:50


Quote:>shell.  Anyway, I can manually change the shell my user starts in by

>ee /etc/passwd

>and changing the line

>jay:*:1001:1001.................:/bin/sh
>to
>jay:*:1001:1001.................:/bin/csh

errr, guess not.  I did make this change, logged out and back in.  Was
still in the sh shell.  Checked to make sure that the change I had
made was still there.  Was.  Rebooted, logged in, still in the sh
shell.  Am I making the change in the wrong place?
Totally Jayynes
 
 
 

FreeBSD Newbie Progress Day 3

Post by Philip Paep » Tue, 13 Nov 2001 07:25:19



> On Sun, 11 Nov 2001 14:15:50 -0700, Jason Denton

>>I'm betting that you are used to the bash shell under linux? FreeBSD
> Ha, nope... not used to any of the shells yet, just kinda still
> getting used to the concept of using differrent shells and why I would
> want to.... this is my third day on FreeBSD, so I am using whatever
> the default shell is when I log in... I think it is csh for root...
> the prompt is a #.  But when I log in as my user account, % is the
> prompt, does that mean I am in a different shell?

Sounds like a csh(1).  Try typing:

|?% echo $SHELL

If it says that, try changing it to tcsh(1) by typing:

| % chsh -s /bin/tcsh

As someone mentioned before, the "Advantages and Disadvantages of Shells" is a  
religious question, but tcsh(1) is a very good place to start.  If you find that
you don't like it, the other 'biggie' is bash(1), but I don't believe that it is
installed on FreeBSD by default -- you may need to hunt through the ports
collection.

...having used tcsh(1) for a very long time however, I can warmly recommend it.

# -- snip [FTP & Shell] -- #

Quote:>>Bit tough getting used to vi(1) at first, but quite rewarding in the end.
> Not a pro at vi but luckily I do know a tiny bit about it or I would
> be completely lost in there... when possible, I try to use ee which is
> a bit more user friendly.

I find ee and pico and other 'easy' editors to be a bit 'clumsy'.  Once you get
the hang of vi(1) (or emacs ...that's another religious battle...), you never
want anything else again :-)

# -- snip snip -- #

Quote:> ee /etc/passwd

That's another way, of course :-)

# -- snip snip -- #

Quote:> I think that is the minimums... just gotta figure out how to do it
> now... anyone know of a step by step doc out there?  Even if it isn't
> necessarily for ProFTPd, I could always start with a different FTP
> Server this way because I am sure a lot of it will translate over to
> another server.

I'm *very* biased towards wu-ftpd because it's served me so well over the
years.  'Out of the Box' it works quite alright, and just about everything
can be changed in one simple config file.  

 - Philip

--

  Never tell them what you wouldn't do.

 
 
 

FreeBSD Newbie Progress Day 3

Post by Devon Rya » Tue, 13 Nov 2001 07:31:43



>>shell.  Anyway, I can manually change the shell my user starts in by

>>ee /etc/passwd

>>and changing the line

>>jay:*:1001:1001.................:/bin/sh
>>to
>>jay:*:1001:1001.................:/bin/csh

Use vipw instead.  You need to update some databases, so simply editing
the file by hand doesn't actually change things.  There is a way to do
this manually see:
man pwd_mkdb

But vipw is probably a bit easier (since you say you know a bit of vi).
  man vipw or just start it and then :wq and the database will probably
be updated.  Good luck

--

Biology/Neuroscience, Pre-med | http://home.uchicago.edu/~dpryan


 
 
 

FreeBSD Newbie Progress Day 3

Post by Totally Jayynes » Tue, 13 Nov 2001 07:40:22


Cool, will try vipw and see if that fixes the issue beyond my manually
editing the passwd file.

Will also look into wu-ftp and see if there is better newbie docs
there.  Maybe since the Proftpd site says it was created with wu-ftp
in mind but building in the enhancements wu was lacking.
Totally Jayynes

 
 
 

FreeBSD Newbie Progress Day 3

Post by Totally Jayynes » Tue, 13 Nov 2001 07:44:04


On Sun, 11 Nov 2001 16:31:43 -0600, Devon Ryan


>Use vipw instead.  You need to update some databases, so simply editing
>the file by hand doesn't actually change things.  There is a way to do
>this manually see:
>man pwd_mkdb

That worked.  And it seems that vipw does get it's information from
somewhere different then passwd as it did not have the change I had
made in the passwd.  Anyway, made the change with vipw and exited and
logged back in and POOF, I am in the csh shell.

thx

Totally Jayynes

 
 
 

FreeBSD Newbie Progress Day 3

Post by Jed Clea » Tue, 13 Nov 2001 08:10:36



> Well, I want to avoid anonymous log-ins.  This will be a box I will be
> putting into *space so I can access my ftp from anywhere I can
> access the internet.  So want to have as much control over who is
> allowed to log into my ftp server as possible and also try to make it
> as hard as possible for those I don't want having access but happened
> to find it.

Standard ftp has the same lack of security that telnet does.  It sends
your password in the clear over the network.  If you are doing remote,
non-anonymous, file transfers, only use sftp.  Or just use scp.  I don't
believe either needs an ftpd running, just sshd.

Anonymous logins have their good and bad points.  If you've got
writeable directories, you've just set up a Warez cache.  If everything
ftpd can see is read only, and not particularly sensitive (e.g. a
FreeBSD tarball mirror), then anonymous ftp gets around the problem of
sending a real password in the clear, or having to set up accounts for
world+dog.

'Nuff Said.  Half time should be over.  I'd say the game might already
be over for Minnesota, but Mr. Murphy watches football as well as
operating systems.  Go Beagles!

-Jed

 
 
 

FreeBSD Newbie Progress Day 3

Post by Per Hedela » Tue, 13 Nov 2001 08:15:17





>>>shell.  Anyway, I can manually change the shell my user starts in by

>>>ee /etc/passwd

>>>and changing the line

>>>jay:*:1001:1001.................:/bin/sh
>>>to
>>>jay:*:1001:1001.................:/bin/csh

>Use vipw instead.  You need to update some databases, so simply editing
>the file by hand doesn't actually change things.  There is a way to do
>this manually see:
>man pwd_mkdb

>But vipw is probably a bit easier (since you say you know a bit of vi).
>  man vipw or just start it and then :wq and the database will probably
>be updated.  Good luck

Vipw is definitely the way to go, but there is of course (thank g*d:-)
no need to use "vi" just because the command is called "vipw" - it obeys
environment $EDITOR just like any good editor-invoking program should.
So, "Totally", to get vipw to fire up ee for you instead of vi, just

 setenv EDITOR ee       (in csh or tcsh)

or

 export EDITOR=ee       (in sh or bash)

or, for a one-shot that works in any shell

 env EDITOR=ee vipw

For the future, you probably want to set EDITOR in your shell startup
file (e.g. ~/.cshrc).

--Per Hedeland

 
 
 

FreeBSD Newbie Progress Day 3

Post by Per Hedela » Tue, 13 Nov 2001 08:27:00




>That worked.  And it seems that vipw does get it's information from
>somewhere different then passwd as it did not have the change I had
>made in the passwd.

The file vipw lets you edit is /etc/master.passwd, which has some stuff
(e.g. the encrypted passwords) that /etc/passwd doesn't, and which is
used to build both the password databases and /etc/passwd (vipw takes
care of that). I.e. /etc/passwd is a generated file on FreeBSD - any
changes you make there are lost the next time you change anything
through vipw.

'man 5 passwd' will tell you all about this, and probably a lot more
than you really want to know right now...:-)

--Per Hedeland

 
 
 

FreeBSD Newbie Progress Day 3

Post by Torfinn Ingolfse » Tue, 13 Nov 2001 08:35:40



> errr, guess not.  I did make this change, logged out and back in.  Was
> still in the sh shell.  Checked to make sure that the change I had
> made was still there.  Was.  Rebooted, logged in, still in the sh
> shell.  Am I making the change in the wrong place?

If you're only interested in changing the shell, use the 'chsh' command
(use 'man chsh' to read more about it).
When you are root, 'chsh -s /bin/sh' will change root's shell. log out
and back in, and you are in business.
--
Torfinn Ingolfsen
Norway
 
 
 

1. FreeBSD Newbie Progress Day 5 (Making Progress)

Ok, I think I am getting somewhere (YEAH).  First of all, I am doing
all of this editing via ssh across a LAN, still pretty proud of myself
on that one :)

First of all, I edited  /usr/home/jay/.cshrc

so that my default editor is now ee and so my prompt tells my what
directory I am in.  Then I edited /.cshrc

So that when I su'd to root, my defualt editor would stay ee and also
that my command prompt stayed the same.  Now that I look at the
'locate cshrc', though, I think I should have edited /root/.cshrc just
for root.  By making changes to /.cshrc did I set some global options
for all future users?  Just verified that is what I did, su'd to root,
then changed /root/.cshrc so the prompt reads ROOT now, so I know when
I am root or not.

Then I was reading through the http://www.vmunix.com/fbsd-book/ (A
Comprehensive Guide to FreeBSD) and trying to follow along as I was
reading.  Opening up the config files and looking at the settings.
Well, when I  opened up /etc/inetd.conf I saw that ftp was commented
out.  Removed the #  and rebooted (have to learn how to start and stop
daemons, still).  After reboot, ran a netstat -Aan and saw that port
21 was listening, tried to ftp to my server... AND I COULD!!!!
WOOT!!!

Bad news is that when i did an ls, it showed me lots of files that I
probably don't want to have access to, or anyone else for that matter,
through ftp.  

A few people suggested using chroot, others said use Guest accounts.
Gotta figure out what to do next.  The sttructure I am looking for is
something like this.

/ftp (base directory when someone logs into my ftp
/ftp/music
/ftp/software
/ftp/upload

With other directories under those main directories... but the /ftp
being the root directory of the tree.
Totally Jayynes

2. Kernel Change Summary 2.0

3. FreeBSD Newbie Progress Days 10-14

4. Solaris CDE screenlock and nscd interaction?

5. FreeBSD Newbie Progress Day 2

6. PPP is up but no DNS

7. FreeBSD Newbie Progress Day 4

8. Solaris 32 or 64-bit

9. The REAL Test (FreeBSD Newbie Progress Day 8)

10. FreeBSD Newbie Progress so far

11. Apache Web Server (FreeBSD Newbie Day 7)

12. cvsup, cvsupit, cron jobs, and daily.local (FreeBSD Newbie Day 6)

13. FreeBSD progress for mac/ppc?