Find

Showing posts with label AIX. Show all posts
Showing posts with label AIX. Show all posts

How to restart service sendmail. (Sun, Linux, AIX)

How to restart service sendmail. (Sun, Linux, AIX)

use single line command for stop and start (restart):

Sun Solaris
/etc/init.d/sendmail stop;sleep 10;/etc/init.d/sendmail start;

Linux
/etc/rc.d/sendmail stop;sleep 10;/etc/init.d/sendmail start;
--or postfix
service postfix restart;
 
AIX
stopsrc -s sendmail;sleep 10;startsrc -s sendmail -a "-bd -q30m";

AIX BASIC Hardening


AIX BASIC Hardening


Tasks

Remarks

Install and Configure SSH

Install

Disable Telnet

Use SSH , chsubserver -d -v telnet -p tcp

Disable FTP

Wait for user change, chsubserver -d -v ftp -p tcp

Disable Remote Shell

Use SSH, commend shell,login /etc/inetd.conf

Disable TFTP

chsubserver -d -v tftp -p udp

How to migrate rootvg without mksysb tape drive

1. At the new machine install AIX.

2. At the old machine backup the following directory 
· /etc/passwd 
· /etc/group 
· /etc/qconfig 
· /var/spool/lpd 
· /home 
· /etc/hosts 
· /var/spool/qconfig 
· /etc/security 
By using this command 
tar -cvf /xxx.tar /etc.passwd /etc/group /etc/qconfig /var/spool/lpd /home /etc/hosts /var/spool/qconfig /etc/security 
3. Transfer the xxx.tar to the new machine 
4. install xxx.tar using this command 
tar -xvf xxx.tar 
5. Reboot.

Unix Determine the System Architecture,RAM,Swap

Determine system architecture 
AIX # /usr/bin/getconf HARDWARE_BITMODE 
Linux (x86 and Itanium) # grep "model name" /proc/cpuinfo 
Sun Solaris # /bin/isainfo -kv 
For SPARC systems64-bit sparcv9 kernel modules 
For x86 systems: 32-bit i386 kernel modules 

Determine the physical RAM size 
AIX # /usr/sbin/lsattr -E -l sys0 -a realmem 
Linux # grep MemTotal /proc/meminfo 
Sun Solaris # /usr/sbin/prtconf | grep "Memory size" 

Determine size of the configured swap space 
AIX # /usr/sbin/lsps -a 
Linux # grep SwapTotal /proc/meminfo 
Sun Solaris # /usr/sbin/swap -s 

How to export NFS AIX

@Source Server is 192.168.1.25
edit file export
/u01/appluat -root=abcstandby,access=abcstandby
# exportfs -a
** Add host before command,**

@Destination Server
mount 192.168.1.25:/u01/appluat /A4
** /A4 is Folder on this server **

How to set Samba on AIX

How to set Samba on AIX
1.Create Directory for samba such as /u01/oracle/ORAOM
2. edit /usr/local/samba/lib/smb.conf  by add follow:
            [ORAOM]
             comment = ORA Upload
             path = /u01/oracle/ORAOM
            valid users = abcd
             public = yes
            writable = yes
            printable = no
            write list = abcd
3.Create User OS for samba.
            # smitty > Security & User  > Users > Add User > Insert User infomation.
4.Create User samba same OS user.
            Smbpasswd –a <username>
5.Create Password for User Samba
            Smbpasswd <Username>

print smbclient

format -- /usr/local/samba/bin/smbclient $PROFILES$.PRINTER -U Administrator%Password -c 'print  $PROFILES$.FILENAME '

$PROFILES$.PRINTER = \\\\PCCLIENT\\EpsonLQ

Example -- /usr/bin/smbclient \\\\PCCLIENT\\EpsonLQ -N -c 'print hosts'

How to find file from specific time

find . -name "*.tmp" -mtime +60 -exec rm -f {} \;  

find file in Path /usr/mysql  have ".tmp" by time over 60 days then delete.

How to find file from size.

find / -type f -size +100000k -exec ls -l {} \; | awk '{ print $9 ": " $5 }'

Manage Service AIX

lssrc -a   **list all service
stopsrc -s  **stop service by specific name.
stopsrc -g  **stop service by specific group
startsrc -s  **start service by specific name
startsrc -g  **start service by specific group