Unix Administration
Understanding ioscan
What kind of attached devices?
# ioscan -kfnC disk
will show all disks attached.
# isocan -kfnC tape
will show tape drives attached.
# ioscan -kfnC lan
will show lan cards.
# ioscan -kfnC fc
will show fibre channel interfaces.
# ioscan -kfnC processor
will show the processors in your system
Some of other command
ioscan --- scan the system HW
lssf --- list dev specisl files
insf --- install the device special files
rmsf --- remove the device specisl files
ioinit --- io initialisation.
To know more abt NIS inUNIX, Check it below link.
http://www.ntlug.org/NIS/Presentation
Create user profile and tips
1. Create a user using below command
useradd ram
2.To Set the password fir the
user passwd ram
3.To delete the user
userdel ram
3.To lock the account
usermod -L ram (or) passwd -l ram
4.To release the lock
usermod -U ram
5.To set a expiration date for the user
usermod -e 06/17/2008 ram
Some Tips
To disable an account:
/usr/lbin/modprpw -m alock=YES username
To enable a user account:
/usr/lbin/modprpw -k username
To check status of the account:
/usr/lbin/getprpw -r -m lockout username
It will return a 7 digit number and if the 6th digit is set to 1 that the account is locked
Blocking all the user account
If u want to block all the user for perticular box, Just create one empty file BLOBKALLBUT ROOT
It will be block the all the user and only root can access.
Sendamail Tips
Mail spoolSendmail generally stores its queued mail in the var/spool/mqueue folder. Queued messages are messages that have not reached their final destination yet. There are two files associated with each e-mail message, one beginning with qf, the other beginning df. qf files contain the message header, df files contain the body of the mail message.
Below are the steps to follow to send a mail from unix machine.
Step 1.
Have to enable the mail option in /etc/mail/sendmail.mc file
enable the line called DEAMON_OPTION('port=smtp)
Dont change anything in config file .
Step 2.
Restart the sendmail dameon
service sendmail restart
Step 3.
Use the below command to send mail.
echo " your message "| mail -s " subject" e-mailid
You can use mailx command also to send mail.
echo "your message "| mailx -s "dada" e-mailid
Also stop the mail using this command.
/etc/init.d/sendmail stop | start
check with
command mailq whether its sent or not.
To force flush the mailq, run this:
sendmail -v -d8.20 -q
Use mailq to get the mail-id
Then go to /var/spool/mqueue and delete all files with the specified mail-id on the end:
rm *Labels: Sendamail Tips
How to install and configure Telnet services.To install the telnet service, login to the server as the root user account
1)
Fedora linux user following command:-
yum install telnet-server telnet2)
chkconfig telnet on
service xinetd reload
3)
Go to the /etc/securitty file.
If tty has 1-11 listed lin by line, Add the pts 1 to 11 in end of the line as the same format of tty.
save the file and now you can able to telnet from the windows or Linux machine.
4)
telnet ipaddress.
How to Configure Samba on Fedora LinuxSamba can be used to allow connectivity between Linux and Windows(95,98,NT,2000)
Samba deamon is smbd. All of samba is configured in one single file, the smb.conf file.
This file, located at /etc/samba/smb.conf, allows you to specify which resources on the linux machine you wish to share and who they can be accessed by.
Below steps are followed to configure samba in Fedora Linux.
Step 1:First create a directories and users
Create directories for Samba to use with Windows
#mkdir ram
Now we need to create users to access this directiory
#useradd ram
Now create a password for this user using the following command
#smbpasswd -a ram
Step 2:Samba configuration
By default samba configuration file located at /etc/samba/smb.conf
In this file main section is Global where you can define all parameters and the example as follows
[global]
workgroup = MYGROUP
server string = Samba Server
log file = /var/log/samba/%m.log
max log size = 50
dns proxy = No
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /usr/spool/samba
printable = Yes
browseable = No
[samba]
comment = ram
path = /freesapce/Ramkumar
valid users = ram
writable = yes
Add at in inside samba part.
* which path you need to share the folder in Linux.
* which user have a authorised to login.
Step 3:Samba Service
Now that everything has been configured, the final step is to start the samba service. Samba runs in the background
as a linux daemon. Therefore, it can be controlled by typing:
service smb start
service smb stop
service smb restart
(or)
#/etc/init.d/samba restart
Note that once the computer is restarted or shutdown, the samba service won't start up again.
Step 4:Connect to the samba server
Type the ip address in run prompt.
it will connect to linux box.
and try to access as your username and passwd.
then it connect and show the folder which you have created.
Now you can share the file with unix machine.
How to Install Fedora1.If you have already installed fedora mean , You need to uninstal that.
2.Using windows OS, u can remove the file which had occipied by fedora os.
3.for that,
select mycomputer ->left click ->select manage -> select disk management ->
Remove linux file system spaces.
4.Insert the fedora 6.0 cd.
For that u need to reboot and press f8 + select DVD ROM
It will take time for loading ata-piix driver
5.select options.
6.Select custom layout option.
Inside u have to partition for below path
/root -1000MB
/boot -1000MB
/home -1000MB
/swap -1000MB
/usr -5000MB
/opt -1000MB
7.select DHCP option
8.Give the root password
9.Select sofware which u want.
make sure that all tha packages are selected for perticular software.
10.select the webserver and samba also
11.then It will take one hour to install all the software and packages using command rpm --verify mysql
13.After get over.reboot the system.
The fedora login page should come if the insatallation has completed successfully.
Note: If not come check all the software installed or not.check the packages allso.Partitioning and Formatting Second Hard Drive - (ext3) Partioining have to do after the system reboot.
This is for collect the free space and configure.
First, you will need to run the fdisk command in order to partition the disk. For this example, I only want to create one ext3 partition. Here is an example session:
1)For HP system ---> lv
For sun OS ---> NEWFS
For fedora issue the command
fdisk /dev/hda
2)select p to print the partitioned space
it will be listed in cylinder wise
dev/hda1 1 255
dev/hda2 .. ...
dev/hda7 4718 5099
3)if i want to partition for free space into hda8
select the command n
give the first cylinder . to 51000
+MB to 34000MB (remaining space)
save and exit
4)Issue command partprobe(reboot the system after partition)
creating ext3 File systemmkfs ("make a filesystem") is the standard Unix command for formatting a disk partition with a specific filesystem. The basic syntax is:
mkfs.ext3 /dev/hdsa8
The ext3 or third extended filesystem is a journalled file system that is commonly used by the GNU/Linux operating system. It is the default file system for many popular Linux distributions.
Mounting the file systemNow that the new hard drive is partition and formated, the last step is to mount the new drive. For this example, I will be mounting the new hard drive on the directory /hda8.
if u want u can make one directory freespace
mkdir fressspace
mount /fev/hda /fressapace/
if u do unmount /fressspace/ then the space will add into none folder.
at the end of the section u have to add the fresspace to /etc/fstab/
add the fressapce at end and like
/dev/hda8/ /fressapce/ ext3 defaults 1 2
save and reboot the system reboot -f
How to change the HOST namestep 1.
vi /etc/host
Add at end of line
IP Address domainname.domain.com domainname
step 2.
vi /et/sysconfig/network
Add at end of line
HOSTNAME=domainname.domain.com
step 3.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Add at the end of line
HOSTNAME=domainname
SFTP configurationIts same procedure as we discussed in ssh.
1.Generate the key first
$ ssh-keygen -trsa
it will be create and stored in .ssh directory
2.copy the key to destination host.
$ ls -a
. .. authorized_keys id_rsa id_rsa.pub known_hosts
Here u need to copy the id_rsa.pub to destination host.
$ scp id_rsa.pub ram@172.1.00.00:~/.ssh/authorized_keys
ram@172.1.00.00's password:
id_rsa.pub 100% |*****************************| 233 00:00
3.do sftp to which host u need to do
$ sftp 172.1.00.00
Connecting to 172.1.00.00...
sftp>
You can do ftp with scure way now.
SSH configuration for one host to other host in UNIX.1.Generate the key from which host to need to do for ssh
$ ssh-keygen -trsa
it will be create and stoerd in .ssh directory
2.copy the key to distination host.
$ ls -a
. .. authorized_keys id_rsa id_rsa.pub known_hosts
Here u need to copy the id_rsa.pub to destination host.
$ scp id_rsa.pub ram@111.11.1.1:~/.ssh/authorized_keys
ram@111.11.1.1's password:
id_rsa.pub 100% |*****************************| 233 00:00
3.Once successfully copied, do the ssh it wont ask any password
[ram@bc .ssh]$ ssh 111.11.1.1
Wel Come To Dax Server
[ram@dax ~]$
Note: Before do this configuration make sure that the username for both host are same.
How to start ftp service. Linux is configured to run the Telnet and FTP server, but by default, these services are not enabled.
Configure FTP and starting the deamons. Edit the files /etc/vsftpd.ftpusers and /etc/vsftpd.user_list and remove the 'root' line from each file.
[root@rak tmp]# /etc/init.d/vsftpd start
[root@rak tmp]# /etc/init.d/vsftpd stop
(or)
[root@rak tmp]# /etc/init.d/vsftpd restart
[root@rak ~]# pgrep httpd (it will be tell the port number which is enabled for ftp)