Wiki‎ > ‎

Sysadmin Stuff

posted Jan 29, 2011, 4:02 PM by Dong Xu   [ updated Aug 26, 2014, 1:40 PM ]
"octave: error while loading shared libraries: liboctave.so: cannot open shared object file: No such file or directory"
/sbin/ldconfig /usr/lib64/octave-3.2.2/

Mount an ISO file

su-
mkdir -p /media/iso
mount -o loop disk.iso /media/iso

Add a new user to NIS

cd /var/yp/boisestate.edu
rm -f *
cd ..
make

then restart NIS server using yast2

Diskusage: sort by size & show human-readable sizes


du -k --max-depth=1 | sort -nr | cut -f2 | xargs -d '\n' du -sh

Who is currently logged in?

finger

Who is doing what?

w
ps au|less
ps aux|less

Check user info

id -a

Change run level for Nvidia driver or other purposes

vi /etc/inittab
# The default runlevel is defined here
id:5:initdefault:

just change the 5 to a 3 :-)

Execute commands over ssh

cat hostnames | xargs -ti ssh {} ls -l /dev/nvi*

Check kernel boot info

dmesg | less

Lookup system/kernel version and CPU info

uname -a && cat /etc/*release
cat /proc/cpuinfo

User management, uid change, add sudoer

http://www.cyberciti.biz/faq/howto-change-rename-user-name-id/

http://www.novell.com/coolsolutions/feature/16145.html

Package installation/management

http://www.suseblog.com/how-many-ways-can-you-install-an-rpm-in-opensuse-linux/

System log

sudo vi /var/log/messages

Disk health

sudo /usr/sbin/smartctl -A /dev/sdb
or
sudo /usr/sbin/smartctl -a /dev/sdb

short offline test: smartctl -t short /dev/sdb
see test log: smartctl -l selftest /dev/sdb

Look for: no Reallocated Sector Counts (this attribute indicates if there are bad blocks on your drives and the drive itself remaps them) and no Offline Uncorrectable errors

Linux software RAID setup

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch26_:_Linux_Software_RAID

Network Security

Preventing Hacking Attempts
http://www.novell.com/support/php/search.do?cmd=displayKC&docType=kc&externalId=trench-16341html&sliceId=&docTypeID=DT_ARTICLES_TIPS_1_1&dialogID=103670789&stateId=0%200%20206475548

Checking the Log File for Invalid SSH Connection Attempts
http://www.novell.com/support/php/search.do?cmd=displayKC&docType=kc&externalId=tip-18080html&sliceId=&docTypeID=DT_ARTICLES_TIPS_1_1&dialogID=103670789&stateId=0%200%20206475548

Hosts.allow/deny

see: http://www.aboutlinux.info/2005/10/using-tcp-wrappers-to-secure-linux.html
MOSTLY CLOSED
In this case, access is denied by default. Only explicitly authorized
hosts are permitted access.

The default policy (no access) is implemented with a trivial deny file:

/etc/hosts.deny:
ALL: ALL

This denies all service to all hosts, unless they are permitted access
by entries in the allow file.

The explicitly authorized hosts are listed in the allow file. For
example:

/etc/hosts.allow:
ALL: LOCAL @some_netgroup
ALL: .foobar.edu EXCEPT terminalserver.foobar.edu

The first rule permits access from hosts in the local domain (no `.´ in
the host name) and from members of the some_netgroup netgroup. The
second rule permits access from all hosts in the foobar.edu domain
(notice the leading dot), with the exception of terminalserver.foo-
bar.edu.

Comments