ciphermethod.com

Linux

20100421: changeilom.sh

by on Apr.21, 2010, under Linux, Scripts

#!/bin/sh
# 20100421 – Jamey Hopkins

echo
echo “Change root password on Sun ILOM cards”
echo

if [ “$1” = “” ]
then
echo need server list
echo example: changeilom.sh servers.txt
exit
fi

if [ ! -f $1 ]
then
echo “Server list $1 not found.”
echo
exit
fi

echo “Enter new password”
echo -n “Password: ”
stty -echo
read PASS1
stty echo
echo
echo “Enter password again”
echo -n “Password: ”
stty -echo
read PASS2
stty echo

echo

if [ “$PASS1” != “$PASS2” ]
then
echo passwords did not match
exit
fi

LIST=$1

echo “user set password 2 $PASS1” >cmnds.ilom
echo “quit” >>cmnds.ilom

for x in `cat $LIST`
do

echo $x
#ssh ${x}.fls ls
scp ./cmnds.ilom ${x}.fls: >/dev/null
echo “Running IPMITOOL”
ssh ${x}.fls “cat cmnds.ilom | sudo ipmitool shell” >/dev/null
ssh ${x}.fls rm cmnds.ilom
done

rm cmnds.ilom

Leave a Comment more...

Fedora 11 and xorg.conf

by on Sep.12, 2009, under Fedora, Linux

If you install Fedora 11 and find that your X11 display is less than ideal (as in it won’t do better than 800×600) run:

Xorg -configure :1

as root to create a new default xorg.conf.new in /root.

Run ‘X -config /root/xorg.conf.new’ to test the new config. If the display sizes properly, copy it to /etc/X11 and overwrite the existing xorg.conf. This was the only fix I needed in do in order to get a clean install of Fedora 11 going.

Leave a Comment more...

BASH: createsftpaccount.sh

by on Mar.04, 2009, under Linux, Scripts


#!/bin/sh
#
# Create SFTP user account
#
# 20090304 jah - new
#

if [ "$1" == "" ]
then
  echo
  echo user login to create is blank
  echo use: $0 user
  echo
  exit
fi
 
/usr/sbin/useradd -g sftponly -d /sftpusers/$1 $1
mkdir -p /sftpusers/$1/data
chown root:root /sftpusers/$1
chmod 755 /sftpusers/$1
chown $1:sftponly /sftpusers/$1/data
chmod 700 /sftpusers/$1/data
passwd $1

Leave a Comment more...

How-To: Replace SSH & Enable Chrooted SFTP

by on Feb.03, 2009, under Linux

1. Download latest OPENSSH
2. Unpack tar file
3. CD to openssh source directory
3. vi version.h and remove VERSION_SSH information (if desired)
example: #define SSH_VERSION “OpenSSH”
4. run ./configure –with-tcp-wrappers
5. resolve any missing dependencies
6. login via a telnet session
7. disable ssh and remove existing SSH packages
8. run “make install” from openssh source directory
9. cp opensshd.init to /etc/init.d/sshd
10. add the following chkconfig information to top of ../init.d/sshd file:
# chkconfig: 2345 55 25
# description: OpenSSH server daemon
11. run chkconfig –add sshd

12 create sftponly group
groupadd sftponly

14. edit /usr/local/etc/sshd_config
update sftp subsystem to internal-sftp
# override default of no subsystems
#Subsystem sftp /usr/local/libexec/sftp-server
Subsystem sftp internal-sftp

add section to bottom of file:
Match group sftponly
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

15. create sftp “jail” directory
mkdir /sftpusers
chown root:root /sftpusers
chmod 755 /sftpusers

16. create sftponly user accounts
useradd -g sftponly -d /sftpusers/user user
mkdir -p /sftpusers/user/data
chown root:root /sftpusers/user
chmod 755 /sftpusers/user
chown user:sftponly /sftpusers/user/data
chmod 700 /sftpusers/user/data
passwd user

user will now have complete control of the data directory, read access to /sftpusers/user, and be unable to cd past the root of /sftpusers/user.

Leave a Comment more...

openSUSE 11 x86_64 Flash FireFox

by on Aug.14, 2008, under Linux

If Adobe Flash is not working in FireFox, verify that the nspluginwrapper was installed.

nspluginwrapper
nspluginwrapper is an Open Source compatibility plugin for Netscape 4 (NPAPI) plugins. It enables you to use plugins on platforms they were not built for. For example, you can use the plugins compiled for i386 in Mozilla on Linux/x86_64 or other architectures.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

But Wait, There's More!

A few highly recommended friends...