I’ve Got Mail! February 11, 2008
Posted by gnukathryn in Configuration, Fedora, Fundamentals, Nifty!, Terminal, Utilities.2 comments
The capital letter in my user name was indeed throwing sendmail into fits. I could have created an entire new user. But hey, that’s a lot of work. I’d have to port my Firefox profile over and re-customize my desktop. Nah. Definitely not worth it just to be able to read local email.
I could have directly edited /etc/passwd using vipw at the command line. I’m not a big fan of vi. It scares the pants off me. I’ll stick to emacs, thanks. Heck, I find emacs extremely challenging on a good day. I’m all for the simple route of using kedit. So on the advice of mweltin who was hanging around #boinc, I ended up using usermod from the command line. The syntax was quite simple. usermod -l kathryn Kathryn. The only gotcha is that you can’t be logged into an account that you want to edit. So I logged out of Kathryn. Hmmm… well that dumped me to a text login screen. Oh well. I logged in as root, ran my usermod command and then rebooted from the command line. I have no idea how to get back into a graphical environment from a text prompt. But at least I learned how to reboot from the command line.
And…. BINGO!
[kathryn@Galaxy ~]$ mail
Mail version 8.1 6/6/93. Type ? for help.
“/var/spool/mail/kathryn”: 6 messages 6 new
>N 1 boinc@Galaxy.Fedora Mon Feb 11 19:42 17/582 “test”
N 2 MAILER-DAEMON@Galaxy Mon Feb 11 19:42 78/2716 “Warning: could not send message for past 4 hours”
N 3 MAILER-DAEMON@Galaxy Mon Feb 11 19:42 164/5257 “Warning: could not send message for past 4 hours”
N 4 root@Galaxy.Fedora Mon Feb 11 19:42 27/978 “Cron <root@Galaxy> run-parts /etc/cron.daily”
N 5 logwatch@Galaxy.Fedo Mon Feb 11 19:42 113/3519 “Logwatch for galaxy.fedora (Linux)”
Picky Picky February 9, 2008
Posted by gnukathryn in Fedora, Fundamentals, Utilities.add a comment
I found an answer to my mail problems. Someone hit on my blog using sendmail “user unknown” errors 8.14.1 as a search term. I figured that this person was having problems similar to my own. So I put that same search in Google and found this thread.
It looks like having a user name with capital letters in it throws sendmail into a tizzy. This fits perfectly with what I observed on my own machine. I can receive mail sent to root or boinc, but I can’t receive mail sent to Kathryn.
So I guess I need to create a new user for myself called “kathryn”. I’m just not sure what to do with all the stuff that’s in “Kathryn”.
Oh well. At least the mystery has been solved.
You’ve got mail? February 6, 2008
Posted by gnukathryn in Fundamentals, Nifty!, Terminal.add a comment
I recently found out that the system sends various emails to the root account. And darn it, I want to read them. In theory, all I need to do is have those emails automatically forward to my own user account (and I guess it’s also possible to have them forwarded to a regular email account). Supposedly it’s as easy as creating a file called /root/.forward with the user name of the account you want to have the mails forwarded to.
I always get sort of suspicious when someone says “It should be as easy as…”. Because, it doesn’t seem to matter how easy it is, I still have problems with it. And yes, mail didn’t disappoint.
I have two user accounts on my machine, mine (Kathryn) and BOINC’s (boinc). I can send mail to boinc and root, boinc can send mail to root and root can send mail to boinc. But neither boinc nor root can send mail to Kathryn. Apparently, I don’t exist.
[Galaxy:~]$ mail -v Kathryn
Subject: test
testing
Cc:
Kathryn... Connecting to [127.0.0.1] via relay...
220 Galaxy.Fedora ESMTP Sendmail 8.14.1/8.14.1; Wed, 6 Feb 2008 09:09:50 +0900
>>> EHLO Galaxy.Fedora
250-Galaxy.Fedora Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<boinc@Galaxy.Fedora> SIZE=35 AUTH=boinc@Galaxy.Fedora
250 2.1.0 <boinc@Galaxy.Fedora>... Sender ok
>>> RCPT To:<Kathryn@Galaxy.Fedora>
>>> DATA
550 5.1.1 <Kathryn@Galaxy.Fedora>... User unknown
503 5.0.0 Need RCPT (recipient)
>>> RSET
250 2.0.0 Reset state
/var/lib/boinc/dead.letter... Saved message in /var/lib/boinc/dead.letter
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 Galaxy.Fedora closing connection
I’ve jumped through a bunch of hoops trying to get this to work. I’ve tried sending to Kathryn@localhost. Nope. No dice. I’ve checked the contents of /etc/hosts. Everything is fine there. I’ve added the host name to /etc/mail/local-host-names. Nope. No dice. On advice from my tutor I’ve done `make` in /etc/mail and `newaliases` (for luck of course). No dice. I’ve even restarted the sendmail service. I must be a figment of my own imagination.
All this to read messages that look like
From root@Galaxy.Fedora Tue Feb 5 04:17:03 2008
Date: Tue, 5 Feb 2008 04:15:39 +0900
From: root@Galaxy.Fedora (Cron Daemon)
To: root@Galaxy.Fedora
Subject: Cron <root@Galaxy> run-parts /etc/cron.daily
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
/etc/cron.daily/logrotate:
[ OK ] BOINC client daemon: [ OK ]
Starting BOINC client as a daemon: [ OK ]
[ OK ] BOINC client daemon: [ OK ]
Starting BOINC client as a daemon: [ OK ]
or
From root@Galaxy.Fedora Tue Feb 5 04:15:28 2008
Date: Tue, 5 Feb 2008 04:15:28 +0900
To: root@Galaxy.Fedora
From: logwatch@Galaxy.Fedora
Subject: Logwatch for galaxy.fedora (Linux)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=”iso-8859-1″
######### Logwatch 7.3.4 (02/17/07) ##########
Processing Initiated: Tue Feb 5 04:15:27 2008
Date Range Processed: yesterday
( 2008-Feb-04 )
Period is day.
Detail Level of Output: 0
Type of Output: unformatted
Logfiles for Host: galaxy.fedora
#########################################
———– pam_unix Begin ————–
su:
Authentication Failures:
Kathryn(500) -> root: 1 Time(s)
Sessions Opened:
(uid=0) -> boinc: 5 Time(s)
Kathryn(uid=500) -> root: 5 Time(s)
———— pam_unix End —————
———– XNTPD Begin ————–
Total synchronizations 2 (hosts: 2)
———— XNTPD End —————-
———– Disk Space Begin ————–
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 9.9G 3.8G 6.1G 39% /
/dev/sda8 4.0G 73M 3.7G 2% /tmp
/dev/sda7 4.0G 855M 3.0G 23% /home
/dev/sda2 60G 18G 43G 30% /Data
/dev/sda1 41G 24G 17G 59% /Vista
———— Disk Space End —————
############ Logwatch End ###############
I’m sorry Dave, I’m afraid I can’t do that January 23, 2008
Posted by gnukathryn in Fundamentals, Terminal.1 comment so far
OK, OK… sorry for the bad humor in the post title.
I’ve been diving into the intricacies of Unix permissions. Up to this point, I’ve been comfortable enough with both symbolic notation (rwx) and octal notation (1,2,4). I’ve been looking at a sandboxing scheme for BOINC. That has brought up a whole bunch of questions that I’ve been working on answering.
The first thing I noticed was the use of 4 digit octal notation. The second, third and forth digits are the file permissions I’ve been dealing with since the beginning. The first digit refers to the presence or absence of setuid, setgid and the sticky bit.
setuid and setgid change the ID a program runs under. In turn that allows controls access permissions. If you have a program you want to run as a regular user (a good thing) but it needs elevated privileges to do certain things, you can use setuid and setgid to give that program the permissions it needs. Remember though, it’s a good idea to only use that to the extent it’s needed. Elevate the privileges, do what you need to do and then drop them.
The sticky bit has two usages depending if it’s on an executable file (the original usage) or a directory (today’s common usage). If it’s on a executable, it allows the binary to be shared across users (or at least that’s how I’m understanding it). If it’s on directory it allows files to be locked down to the owner and the super user. So even if you have write permission on the directory, you won’t be able to move, modify rename or delete a file if you don’t own it.
There’s also some stuff on umasks I’m trying to understand, but that’s still all a bit hazy in my mind.
I never realized Unix permissions could get so complicated.





