Here are some solutions to problems Linux users often
encounter. If you have a better solution or have a question please send your solutions,
questions, or comments to us.
Are any of these solutions obsolete? Are they clear and easy to understand?
uncomment ttys01-3 ttyp01-3 (that is, ttys01, ttys02, etc...)
also note that /etc/login.defs contains login securetty info.
Remove file /etc/securetty
or just rename it.
There should be a better solution to this though. If you have a better
solution, please e-mail me.
/etc/rc.config sets lots of stuff including
allowing root login via telnet
edit it then /sbin/SuSEconfig*
I think I saw something in YaST once.
2.smbadduser unixuid=ntuserid <---- example: root=administrator
4./etc/rc.d/init.d/smb restart <---- this restarts samba
2.smbpasswd -a user<----change passwd add user
3./etc/rc.d/init.d/smb restart <---- this restarts samba
For the impatient here's a very simple but working /etc/smb.conf file.
This is for those who don't read anyway:
SSSSSSSSSSSSSSSSSSSSS START SSSSSSSSSSSSSSSSSSS
# workgroup = NT-Domain-Name or Workgroup-Name
# You MUST change this to reflect your workgroup or domain
workgroup = MyWorkGroup_OurFamily
server string = Samba Server
log file = /var/log/samba/log.%m
max log size = 50
security = user
smb passwd file = /etc/smbpasswd
username map = /etc/smbusers
socket options = TCP_NODELAY
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
available = yes
path = /
public = yes
guest only = yes
writable = yes
browseable = yes
only user = no
EEEEEEEEEEEEEEEEEEEE END EEEEEEEEEEEEEEEEEEEEE
Now for those of you who want to see the whole file, here it is:
Right click and choose save as
This will make the root directory "/" of your samba server look like
another windows machine to actual MS Windows users. You can change "/" to
whatever directory you like; it will appear as the root directory to
To add a new user, use this smbadduser
smbadduser unixuid=ntuserid <---- example: root=administrator
So, if you are root on linux and you are administrator on windows,
you would use the smbadduser command like this:
or if you are user joe on linux and you are user joe on windows,
you would use the smbadduser command like this:
If you don't see the smbadduser command, but you do see the smbpasswd
command, then you can skip the smbadduser procedure.
Now, change the user password. It would be better to make your smb
username and password match that of your windows username and
password. It would avoid many problems.
smbpasswd -a joe
It is also possible to use smbpasswd to add user and set the password.
The above command adds user joe and changes his password.
Now you need to restart samba. You don't need to reboot, just restart
wait one second...
You must type in the full path.
It is possible that your particular distribution and kernel version is
buggy and less stable, you may want to reboot.
Windows 95, Win98, and Windows Millennium will easily see samba.
Windows NT 4 and Windows 2000 will work fine without any modifications
when trying to see samba. They do use encrypted passwords so make sure
samba does that. In the smb.conf file, there's a line for that.
encrypt passwords = yes
Otherwise windows will cooperate with samba.
If your Win32 system does not see the samba server it's either not
set up properly or it could be that samba is just not broadcasting.
You can still map to a samba share. You would have to put in the
IP address to samba and the share name.
So, in windows, you have the server name plus the share name of
the shared drive like this:
In the example smb.conf file you would map that drive as:
where you would substitute the numbers with your samba server's
NOTICE: The following is for slightly older distributions
and some new distributions. For example use the following method
for RedHat 6.2, but not for RedHat 7+ because it uses /etc/xinetd.d
instead of /etc/inetd.conf. If your system uses /etc/xinetd.d, you
need to go into /etc/xinetd.d/ and edit the individual files. Each
file has a disable = yes/no field.
[For most distributions]
Chances are, you've already got it installed.
You just need to enable pop3:
uncomment (remove #) these lines:
pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
imap stream tcp nowait root /usr/sbin/tcpd imapd
RedHat (and their copy-cats)
Now restart sendmail and inet.
You must type in the full paths.
If you're not comfortable, just reboot your computer.
Can't send email, "relaying denied" problem.
This is a security feature of sendmail.
By default, sendmail will only let the localhost send email via.
In other words, no one else can use it. You need to add your IP.
All linux distributions:
to allow your IP to access sendmail, edit:
add these lines:
The first line says that 184.108.40.206 can access sendmail.
Where 220.127.116.11 can be an outside IP address.
The second line says that all of 10.*.*.* can access sendmail.
10 is the first number of every computer on your network.
If you have the following five computers:
you would use 10.
Now do this:
makemap hash /etc/mail/access < /etc/mail/access
now, create a file called /etc/mail/relay-domains
add all IP addresses including local and public IPs
now restart your sendmail
RedHat, Mandrake, SuSE, and possiblly others:
note: you must type in full paths. use [TAB] if you are lazy.
That will let you send mail.
To recieve mail see pop3 notes
Then restart networking services. If you are unsure of how
to do that, just reboot your computer.
If you get an httpd problem with an error telling you
that httpd cannot determine hostname, then:
Edit this file: (redhat)
you may get something like this:
Now restart apache web server.
Also (for redhat) run xinit
then start netcfg
make sure hostname is the same everywhere
then restart httpd by
this will not work
must provide full path
note that /etc/hosts directly affects httpd
set host name there also. must be correct. must match hostname
To change web docs root dirs:
edit files in here:
note that this (srm.conf) also contains inportant configs.
to allow .sht files to display a page instead of source code
add this for example:
AddType text/html .sht
AddHandler server-parsed .sht
to remove error and access logs:
Next time someone accesses your web site, new log files will be created.
1. Find this file: /etc/httpd/httpd.conf
Edit it with your favorite text editor.
Find the section "DocumentRoot"
or find: "<Directory" in "<Directory "/system/httpd/www">"
Now, edit the section so it looks like the following:
AllowOverride All <--- if you do not see 'All' put it in.
2. htpasswd -c /dirname/filename <username>
filename and directory is where you want to create the
htpasswd file. Put it in /etc/httpd/ and call it htpasswd.
username is a valid username already on your system.
for example: htpasswd -c /etc/httpd/htpasswd joe
3. Create file '.htaccess' in the directory you want to be protected.
so if you want to proctect everything in www.yoursite.com/private/
then you put the '.htaccess' file in private/
The content of '.htaccess' is:
<Limit GET PUT POST>
4. Restart apache.
For example: /etc/rc.d/init.d/httpd restart
You must type in the full path.
Notes: After you have created /etc/httpd/htpasswd with the option -c,
you can add more users by using htpasswd without the -c option.
You also do not have to restart Apache.
IP address alias
(1 NIC, many IP addresses)
If running redhat:
either run ifconfig or netcfg
netcfg is easier.
click on the interfaces tab
click on your network card (like eth0)
then click 'alias'
add whatever address you like.
If you choose ifconfig:
ifconfig eth0 10.0.0.2 up
This will setup your linux machine to use IP address 10.0.0.2.
To remove that IP:
ifconfig eth0 10.0.0.2 down
Edit the text file:
with a plain text editor.
Start by restricting ALL USERS including yourself.
Add this single line:
ALL: ALL #this restricts all users
Now, edit this file
You can add any one of these lines:
To allow an IP and port to use a service:
<service>: <ipaddress> <port>
ALL: 18.104.22.168 300
This allows a user behind a firewall to use all services.
The firewall has an IP address of 22.214.171.124 and a proxy server
opens port 300 to that user.
To allow a specific IP to telnet in:
This allows a user at IP 126.96.36.199 to telnet in, but nothing else.
He/She/It cannot ftp or use POP3 for example.
To allow a specific IP to ftp in:
This allows a user at IP 188.8.131.52 to ftp in, but nothing else.
He/She/It cannot telnet or use POP3 for example.
for SuSE 6.2:
It seems in SuSE Linux, you need to do more than just restart inet.
Even after you restart it, though you can now ping your machine from
another machine, you still can't browse the web or telnet in from another
machine. You will probably have to restart dns services somewhere.
I don't know. If anyone has a solution for SuSE or other distributions,
Please send it to email@example.com
You need to edit this file "/etc/hosts".
If you are on a local network only, without internet access and you are
not on other networks then Telnet, FTP, and HTTPd (web) services to
server will be fast to access (login).
In the setup:
local network + gateway + internet access
local network + other networks
Telnet, FTP, and web services to server will appear to hang when
accessed from client machines on a LAN because it does not have a
domain name entry. The server is looking for a domain name entry
and will wait for the DNS server to find one. It will wait and time
out and finally log you in.
For each machine on your LAN, you need to enter it's IP address and a
domain name (any name will do).
You edit /etc/hosts
If your local area network (LAN) is on a 10.0.0.* network, then for each
client machine, you enter:
First thing you need a fully qualified domain name set on your
machine. It should be set in:
enter a line like 184.108.40.206 mycompany.com
enter these lines
find this line:
comment it out with 'dnl' (not #)
so that it will look like this:
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
now run this:
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
To be able to send e-mail, see I'm on a remote computer and I'm
trying to send e-mail via sendmail, but sendmail tells me