Post by admin

Linux : How to export public key for others/friends or your recipients

1) Login to your shell account 2) Use –export option to export your public key in text file $ gpg –export –a > my.key OR $ gpg –export -a | mail -s “My key” friend@domain.com Where -a –armor : Create ASCII armored output. –export : Export the key for sharing First command write output to [...]

Shell script to Finding ALL Superuser ( root ) Accounts under UNIX / Linux OSes

In Unix-style computer operating systems, root is the conventional name of the user who has all rights or permissions in all modes (single- or multi-user). The root user can do many things an ordinary user cannot, such as changing the ownership of files and binding to ports numbered below 1024. It is never good practice [...]

Solaris > Access the CDROM/DVD (mount CDROM/DVD media)

The Volume Management daemon, vold, creates and maintains a file system image rooted at root-dir that contains symbolic names for CD-ROM and floppy, ZIP/JAZ, and DVD-ROM devices and other removable devices. Use volcheck command to checks for media in a drive and by default checks all floppy media. 1) First put CDROM/DVD into drive 2) [...]

Solaris > How to boot system into emergency mode

IA32: To boot system for emergency mode (boot from CD) 1) Boot from Solaris 1st CD 2) At Solaris Device Configuration Assistant, Press F2 key 3) Then press ENTER key twice 4) At Identified Devices, Press F2 key 5) At Boot Solaris, select CD to boot system 6) At next screen system will ask about [...]

Shell script to find all programs and scripts with setgid bit set on

setuid and setgid (short for set user ID upon execution and set group ID upon execution, respectively) are Unix access rights flags that allow users to run an executable with the permissions of the executable’s owner or group. They are often used to allow users on a computer system to run programs with temporarily elevated [...]

Shell script to create list of backup files in ~/.mybackup file. Use with mybackup shell script

#!/bin/bash # mybackupadd – Add file to ~/.mybackup file, then backup and email all # file as tar.gz to your email a/c. # # Usage : ./mybackupadd ~/public_html/ # # Copyright (C) 2004 nixCraft project # Email : http://cyberciti.biz/fb/ # Date : Aug-2004 # ————————————————————————- # This program is free software; you can redistribute it [...]

Shell script to backup directories from Linux server to Windows 2000/NT Server

#!/bin/bash # Shell script to backup directories from Linux server to Windows 2000/NT Server. # Run it as follows # Scriptname /home backup abc123 //server2000/backup # Backup /home directory from Linux box to NT/2000 box called # ‘server2000′ in share called ‘/backup’ with username # ‘backup’ and password ‘abc123′ # ——————————————————————– # This is a [...]

FreeBSD > which directories (PATHs) used to load device drivers (modules)?

The kldconfig utility displays or modifies the search path used by the kernel when loading modules using the kldload utility or the kldload syscall. You can also use sysctl command (the sysctl utility retrieves kernel state). Try any one of the following command as a root user: 1) To get PATH (or directories name) type [...]

Renaming files with –– at the start

I’m making a post about this because I ran into this today and I couldn’t remember how to rename a file starting with — (two or double hyphens) in Linux (e.g. –index.html). The customer has obviously used a Windows FTP client to rename index.html to –index.html so it is out of their way, and now [...]

Ubuntu: Rename an Account [ User ID ]

How do I rename a user name from ‘tom’ to ‘jerry’ under Ubuntu Linux? You need to use the usermod command. It can modify the system account files (such as /etc/passwd) to reflect the changes that are specified on the command line. The syntax is as follows: usermod -l {new-login-name} {current-old-login-name} In this example, rename [...]