Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, August 2, 2010

Allow IP to sending mail (Relay on)

cat /etc/tcp.smtp



login as: root
root@10.100.0.77's password:
Last login: Wed Jul 14 16:28:50 2010 from 172.16.203.28
[root@mail ~]# cd /etc/tcp.smtp
-bash: cd: /etc/tcp.smtp: Not a directory
[root@mail ~]# cat /etc/tc
tcp.smtp tcp.smtp.cdb tcsd.conf
[root@mail ~]# cat /etc/tcp.smtp
127.:allow,RELAYCLIENT=""
10.100.0.91:allow,RELAYCLIENT=""
#Rachit#
172.16.203.15:allow,RELAYCLIENT=""
#Endosor Server - DailyReports#
10.100.0.26:allow,RELAYCLIENT=""
[root@mail ~]#
------------------------

Friday, March 26, 2010

Linux lock unlock user account

----------------------------script.sh---------------

#! /bin/sh
### BEGIN Script INFO
#
# Befor Usering it please check the user name
# file /root/users.txt
#

case "$1" in
lock)
data=`cat /root/users.txt`
for n in $data; do
usermod -L $n && echo "$n is locked"
done
;;
unlock)
data=`cat /root/users.txt`
for n in $data; do
usermod -U $n && echo "$n is unlocked"
done
;;
*)
echo "Usage: $0 {lock|unlock}" >&2
exit 1
;;
esac
exit 0

------------------
users.txt contains users id which have to be locked or unlocked

----------------------------run that script------------

/.script.sh lock

/.script.sh unlock

Saturday, August 8, 2009

Linux YUM: download all rpm and dependancies from Internet Automatically

COPY file rpmforge.repo to /etc/yum.repos/

#rpmforge.repo


# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

Followers