Tag Archive for 'debina'

Script pentru afisare utilizatori linux, bash login, home directory

#!/bin/bash

case $1 in
( list-users )
reset
echo “Listing users….. :)
cat /etc/passwd |cut -d ‘:’ -f1
;;

( list-valid-users )
reset
echo “Listing valid users for god >:)”
cat test|grep -w  “/bin/sh”$|cut -f1 -d’:’
cat test|grep -w  “/bin/bash”$|cut -f1 -d’:’
;;
( get-user-home )
reset
echo “Listing the users home…and username”
echo “home directori for:” $2
cat /etc/passwd|grep  $2|cut -f6 -d’:’
;;
( * )
reset
echo “Utilizati una din urmatoarele comenzi…”
echo “list-users | list-valid-users | get-user-home <nume utilizator>”

;;

esac

  • Share/Bookmark

how to run a script at boot time?

Your script should be in /etc/init.d/ directory.
Then you have to make a symlink from your run-level directory.
I.e you’re in run-level 5 (multiuser with X)

chmod +x
cp /etc/init.d
ln -s /etc/init.d/ /etc/rc.d/rc5.d/S50
ln -s /etc/init.d/ /etc/rc.d/rc5.d/K50
  • Share/Bookmark

How to install DHCP on Ubuntu/Debian

Assumed that “eth0″ is the interface for network card

IP Address 10.0.0.1

Range: 10.0.0.1 to 10.0.0.30

Subnet Mask: 255.255.255.224

DNS Servers: 193.226.98.1, 193.226.98.2

Domains:r2d2.dositei.ro

Gateway Address: 10.0.0.1

Continue reading ‘How to install DHCP on Ubuntu/Debian’

  • Share/Bookmark