2006. 8. 1. 14:08

Root패스워드를분실했을때...싱글유저모드사용시

Root 패스워드를 분실했을 때...


당황해 하지말고, 그냥 컴퓨터를 재가동한 후,

"Boot:?프롬프트에?"boot -s"라고 친다.(3.2releases이전이면 단지 -s만 친다.)

그러면, 싱글유저 모드로 들어가게 된다.

사용할 쉘을 묻는 질문에 엔터를 누르면,

"#"프롬프트가 뜰 것이다. 이때 "mount -u /" 명령어로 루트 파일시스템을 읽고 쓰기
위해 리마운트한다.

그리고, "mount -a"명령으로 다른 모든 파일시스템을 리마운트한다.

"passwd"명령어로 root패스워드를 수정한후, "exit"명령으로 다시 부팅한다.

p.s. FAQ중 하나를 번역해보았습니다.(원문:www.freebsd.org)
single user에 관한 FAQ에도 root패스워드 변경하는 내용이 나옵니다.
2006. 8. 1. 14:08

DEFCON1.ORG-FreeBSD The Power To Serve.

2006. 8. 1. 14:08

ProFTPD

#cd /usr/ports/ftp/ proftpd
#make install clean
#cd /usr/local/etc/rc.d
#chmod u+x proftpd.sh.sample (실행가능하게 만들기)
#./ proftpd.sh.sample start

Tip
실행이 안될 대표적 경우 경우 :
rc 문제 인듯 합니다. vi /etc/rc.conf 에다가 proftpd_enable="YES" 를 넣으시고
mkdir /var/run/proftpd 하시고 conf 만지작 조물딱 조물딱 하신후! 실행하면 이상없이 실행될듯 합니다.
2006. 8. 1. 14:07

오픈웹메일2.51로업그레이드한후주소록문제발생


I think I find where the problem is.
The iconv of recipients from unicode to user-defined charset doesen't work!

Below is my modified codes in openwebmail-abook.pl.
It works OK on our server. But I don't know why
"$recipients =~ s/%u(?0-9a-fA-F{4})/ow::tool::ucs4_to_utf8(hex($1))/ge"
didn't got a TRUE return and is is OK for all recipients to do iconv
without regarding it should do ucs4_to_utf8() or not?

Anyone could explain it?

My OWM version is v2.51 200504010, Charset is Big5

Find below near line 770 in openwebmail-abook.pl
Code:

         if ($recipients =~ s/%u([0-9a-fA-F]{4})/ow::tool::ucs4_to_utf8(hex($1))/ge) {             ($recipients) = iconv('utf-8', $prefs{'charset'}, $recipients);          }  

to

Code:

         if ($recipients =~ s/%u([0-9a-fA-F]{4})/ow::tool::ucs4_to_utf8(hex($1))/ge || 1) {             ($recipients) = iconv('utf-8', $prefs{'charset'}, $recipients);          }  


즉, 자세한 문제점은 아래 참고
오픈웹메일 2.51 버전을 사용하는 곳을 검색해서 찾다가 인하대학교 전자상거래 시스템연구실에서 사용하는 것을 알고,
초면에, 실례를 범하며 메일을 보내게 되었습니다.
이렇게 메일로 문의드리는 내용은 다름이 아니옵고,,,
제가 오픈웹메일을 잘 사용하고 있는데, 최근에 웹메일 2.51로 업데이트 한후에 주소록 부분에서 생기는 버그인지,
아니면 제가 세팅을 잘 못한것인지 모르겠지만 이상한 현상이 생겨서 해결방안이 있난 싶어서 이렇게 적습니다.
버전 2.40버전 사용시에는 잘 사용하였는데, 2.50부터 이러한 문제가 생깁니다..
예를 들어, 주수록에 등록된 이름을 사용하여 메일을 보낼때, 받는사람에 체크하고 Done을 하게 되면 문제 없이
받는 사람에 메일이 들어가게 됩니다.

그리고 나서 받는 사람에 더 추가할려고 주소록 버튼을 누르면 기존의 받는사람이 체크가 안되어 있습니다.




이런 상태에서 그냥 Done 버튼을 누르게 되면 아래의 그림처럼 받는사람이 깨져서 나오게 되네요..

왜 이런 현상이 일어나는지 잘 모르겟네요...
다른 부분은 다 잘 작동하는데, 이부분이 해결되지 않아서 실제 사용하는 곳에는 아직까지 업그레이드를 못하고 있습니다.

오픈웹메일 잘 사용하고 있는데, 이러한 부분의 문제가 발생되어 어쩔수 없이 방법을 찾다가 물론, 오픈웹메일 포럼사이트에서도 좀 검색해봐도 뚜렷한 방법을 못찾아서 이렇게 초면에 실례를 범하며, 메일을 보내게 되네요..
혹시나, 이부분에 대해서 해결책이나 방법 알고 계시면 조언좀 해주시면 고맙겠습니다.
2006. 8. 1. 14:07

How To Setup Virtual Users On Open Web Mail Using Postfix&Vm-pop3d


How to setup virtual users on Open ?WebMail using Postfix & vm-pop3d

Written by Kevin L. Ellis





This tutorial will show you how to setup Open ?WebMail (OWM) so that you can have both real users and pure virtual users access mail by either pop3 (i.e. Netscape, etc) or by using a web interface (Open ?WebMail). A "pure" virtual user to me is one that does not have an account on the machine, there is no entry in /etc/passwd for them. They only exist to the e-mail system. You will be able to setup virtual users for both the main domain of the box and virtual domains that the box hosts. You will also be able to use the same user name for different domains, there are no limitations with user names.

Get down Open ?WebMail, Postfix, and vm-pop3d and install them all. Read through how vm-pop3d works so you have a general understanding of how it's able to service virtual users. Get all these working together before you proceed any further.

We are going to configure OWM to use the standard unix authentication for real users, so we need to setup auth_unix.pl to point to our passwd file. For me this is /etc/passwd and /etc/shadow, your system may vary.


Now we need to setup the authentication module for virtual users. For this we are going to use auth_vdomain.pl. You could also use auth_pop3.pl for this, which I'll talk about briefly later. The only thing you need to setup in auth_vdomain.pl is $local_uid and that needs to match how you configured Postfix and vm-pop3d. All three need to match to use the same user id.


For Postfix you want to see what you have default_privs set to in main.cf. For vm-pop3d you need to determine what user id it's running as for a virtual user. You could either configure vm-pop3d by editing vm-pop3d.h and changing the #define VIRTUAL_UID or by passing it the '--user' or '-u' commandline option to change the user id it will run as. In the auth_vdomain.pl module you need to set the my $local_uid line to match Postfix and what you have for vm-pop3d. Postfix and vm-pop3d normally have these set to the nobody user, which is what auth_vdomain.pl defaults too, so you don't have to do anything. I'm running my system to have Postfix and vm-pop3d set to user id of mail, so on my system I have vm-pop3d.h set as:


#define VIRTUAL_UID 8


And in auth_vdomain.pl I have it set to:

my $local_uid=getpwnam('mail');



If you wanted the whole thing to use a different user id, like vwebmail, you could create a new user and use that id. Just make sure all three programs are using the same user id.



Now we need to make changes to openwebmail.conf. Setup mailspooldir to point to your normal mail spool directory. For me this is /var/spool/mail. This is the spool that real users get their mail delivered to. We also want to setup OWM to default to using unix style authentication, so set auth_module to auth_unix.pl.

mailspooldir /var/spool/mail
auth_module auth_unix.pl

This will configure OWM so that real users will be able to access either regular e-mail using Open ?WebMail without having to do anything special. When a real user of the system logs in using just their user name (e.g. john), then OWM will authenticate that user using the systems passwd file.


I also have this in my config file:


enable_setfromemail no

I don't want my users to be able to change their e-mail address to anything they want, so I turn off this feature in the main config.




Virtual users must be setup and created before they will work.


Step 1

If this virtual user is at a virtual domain your machine is hosting, then add a mapping for the user in /etc/postfix/virtual.cf. The lines you will add will look something like this:

virtualdomain anything
username@virtualdomain username.virtualdomain

The first line only needs to be done once per virtual domain name.

Example:

virtualcompany.com anything
john@virtualcompany.com john.virtualcompany.com

This will map any incoming mail to john@virtualcompany.com to a user named john.virtualcompany.com. Once you've added this run the command 'postmap /etc/postfix/virtual.cf' to update the virtual table.

Note: if this is a virtual user to the main domain of the machine, you don't have to add an entry to virtual.cf.


Step 2

Add a local alias to /etc/aliases for this user. If this is a virtual user to the domain of the host machine, then you'll add a line like this:

username: /var/spool/virtual/domain/name

For example, if you are adding a virtual user (joe) for the domain of the machine (widgets.com), you'd add:

joe: /var/spool/virtual/widgets.com/joe



On the other hand, if it's to a virtual domain, then the username should be the username.domain and 'domain' will be that virtual domain. Continuing the example in step 1, we'd add:

john.virtualcompany.com: /var/spool/virtual/virtualcompany.com/john

After that we need to update Postfix's alias database, so run the command 'postalias /etc/aliases'.


Step 1 tell postfix that mail directed to john@virtualcompany.com should first be mapped to a user named john.virtualcompany.com and step 2 tells postfix to then place that users mail in the mail spool file /var/spool/virtual/virtualcompany.com/john


Step 3

Now we need to make a mail spool directory for it. Make a directory in /var/spool/virtual with the name of the domain.

For our virtual user joe at the main domain of the host machine, we'd do:

mkdir /var/spool/virtual/widgets.com


For our virtual user john at the virtual domain , we'd do:

mkdir /var/spool/virtual/virtualcompany.com


Once that's done we need to execute these two commands:

chown root.mail /var/spool/virtual/domain
chmod og+wt /var/spool/virtual/domain


For our example we started in step 1, we'd execute:

mkdir /var/spool/virtual/virtualcompany.com
chown root.mail /var/spool/virtual/virtualcompany.com
chmod og+wt /var/spool/virtual/virtualcompany.com

If this mail spool directory already exists we can skip this step. Thus, once you perform this step for one virtual user at this domain, any other virtual users at this domain you create you don't have to do this. Adding new users can also be done through a web interface using openwebmail-vdomain.pl module. We'll also set that up with an administrator so you can add, change, or delete users using a browser.


Step 4

Now we need to configure OWM for virtual users at these domains using Open ?WebMail's per site configuration feature. Go to /usr/local/apache/cgi-bin/openwebmail/etc/sites.conf (or to your Open ?WebMail location) and make a new file named 'domain', then add these lines:

mailspooldir /var/spool/virtual/DOMAIN
auth_withdomain yes
auth_module auth_vdomain.pl
domainnames DOMAIN
use_homedirspools no
use_syshomedir no
enable_autoreply no
enable_setforward no



If you want to setup admin account(s) for this virtual domain then you should also turn on vdomain support and specify an admin user name. Here's an example of how to turn it on with an admin named admin_tom:



enable_vdomain yes
vdomain_admlist admin_tom
vdomain_vmpop3_pwdpath /etc/virtual
vdomain_vmpop3_pwdname passwd
vdomain_vmpop3_mailpath /var/spool/virtual
vdomain_postfix_aliases /etc/aliases
vdomain_postfix_virtual /etc/postfix/virtual.cf
vdomain_postfix_postalias /usr/sbin/postalias
vdomain_postfix_postmap /usr/sbin/postmap





For our virtual user joe at widgets.com we'd create a text file called widgets.com containing:

mailspooldir /var/spool/virtual/widgets.com
auth_withdomain yes
auth_module auth_vdomain.pl
domainnames widgets.com
use_homedirspools no
use_syshomedir no
enable_autoreply no
enable_setforward no



And for john at virtualcompany.com, create a text file called virtualcompany.com containing:

mailspooldir /var/spool/virtual/virtualcompany.com
auth_withdomain yes
auth_module auth_vdomain.pl
domainnames virtualcompany.com
use_homedirspools no
use_syshomedir no
enable_autoreply no
enable_setforward no




This will configure OWM so that when a virtual user logs in using their full e-mail address (e.g. john@virtualcompany.com or joe@widgets.com), OWM will use the configuration file for that domain (i.e. virtualcompany.com or widgets.com). The config file for these sites will tell OWM to authenticate the user using the virtual password files of vm-pop3d. Optionally, you would also include all the vdomain config lines in each sites.conf file above if you wanted to use your browser to maintain the virtual users.


Step 5

We need to make a directory in /etc/virtual to hold the password file for this domain. This is the directory that vm-pop3d looks in when it authenticates a user. So we'd do this:

mkdir /etc/virtual/domain


For our user joe, we'd execute:

mkdir /etc/virtual/widgets.com

For our user john, we'd execute:

mkdir /etc/virtual/virtualcompany.com



Step 6

Now we need to create a password for this user. Using the addpasswd script laid out on the vm-pop3d homepage, we'd execute this command:

addpasswd username password >> /etc/virtual/domain/passwd

For our example, if user john wanted the password 'turtle', we'd execute:

addpasswd john turtle >> /etc/virtual/virtualcompany.com/passwd




Possible Step 7

If you are using Sendmail or are keeping your virtual user table in the normal Sendmail location you might need to set the virtusertable configuration option. What happens is OWM will pull in the virtual user table and transform the address before it tries authenticating the user using the vm-pop3d password files. To resolve this add this option to openwebmail.conf:


virtusertable /etc/notable





Conclusion

And that's it! A real user with an e-mail account at the domain of the machine can log into Open ?WebMail by just putting in their user name in the login screen. A virtual user needs to put in their full e-mail address (i.e. username@domain).

For pop3 mail retrieval, a real user would send just their user name to the pop3 server, a virtual user would send their full e-mail address (in either the form 'username:domain" or 'username@domain').





Using auth_pop3.pl


There might be situations where you want or need to use the auth_pop3.pl module to authenticate your virtual users. One situation would be where the mail for this virtual domain is stored on a different computer from where OWM is running. For this you'd need to use this module. It's fairly straight forward to setup, just make the appropriate changes to $pop3_authserver, $pop3_authport, and $local_uid for your system. Once these are setup just change auth_module in your sites.conf file to use this module.



Last modified: March 13th, 2003


Postscript

Pls what does it means? Can't create your user directory! //mail (Permission denied)

Pls help me.....

Answer:
is it ok that user_dir is nobody:nobody with 770?