*******************************************
Rozdzial 2
*******************************************
2.1.
http://www.virtualbox.org
2.2.
http://www.ubuntu.com/download/server
2.3.
windows:
cmd
ping
ping -t
Linuks:
ifconfig
ping
ping -c 5
*******************************************
Rozdzial 3
*******************************************
3.1.
apt-get update
sudo apt-get update
sudo su
exit
3.2.
exit
clear
sudo su
shutdown -h now
sudo shutdown -h now
sudo shutdown -h 1
sudo shutdown -h 21:56
sudo poweroff
sudo reboot
3.3.
ls
ls -a
man ls
clear
ls -a -l
ls -al
ls -alh
ls -alhF
ls - halF
3.4.
ls - halF
cd /
cd home
cd ~
ls -ar
ls > spis.txt
sudo ls > spis.txt
nano
sudo nano spis.txt
3.5.
ls - halF
3.6.
mkdir test01
ls - halF
mkdir -m 440 test02
mkdir -m 7 test03
mkdir -m 22 test04
3.7.
chmod o+r test04
chmod o+x test04
chmod a+x test04
chmod u+r test04
chmod u+w test04
chmod g+r test04
chmod g-r test04
chmod g-x test04
chmod u=rwx test03
chmod g=rwx test03
3.8.
mkdir -v 440 -v test05
cd test05
mkdir -v podkatalog01
mkdir -pv test06/{01,02,03,04,05,06}
pwd
mkdir -m 440 -pv test07/{01,02,03,04,05,06}
chmod u=rwx test07
chmod u=rwx test07 -R
3.9.
cat > plik.txt
cp plik.txt plik_kopia.txt
cp plik.txt 05/
cp plik.txt /home/tomek/test07/02/
cp -r 01/ 06/01/
3.10.
ls
ls - halF
cd /test07
mv plik_kopia.txt 05/
mv plik_kopia.txt kopia.txt
cd ..
mv -i plik_kopia.txt 05/
mv -v *.txt 01/
3.11.
rmdir 02/
rm -v plik.txt
rm -v plik.*
rm -rv 05/
3.12.
nano tajny.txt
shred -v tajny.txt
shred -n 10 -v tajny.txt
shred -n 10 -vu tajny.txt
3.13.
find /home/ -name plik.txt
find /home/ -iname plik.txt
find /home/ -iname plik.txt -ls
find /home/ -type f -ls
find /home/ -type f
find /home/ -type d
find /home/ -type l
find /home/ -type d -user tomek -ls
find /home/ -type d -user root -ls
sudo find /home/ -perm 777
sudo find /home/ -perm 777 -ls
3.14.
sudo find / -iname plik.txt
locate plik.txt
sudo updatedb
locate -i plik.txt
whereis nano
whereis -m nano
whereis -b nano
3.15.
grep -r tomek
grep -ri tomek
grep -riw tomek
grep -iw tomek /home/tomek/test06/test.txt
grep -i tomek /home/tomek/test06/test.txt
grep tomek /etc/passwd
3.16.
more test.txt
ln -s /home/tomek/test03/test.txt test_link
more test_link
3.17.
ln /home/tomek/test03/imiona.txt imiona_link
3.18.
cat > plik1.txt
cat > plik2.txt
cat plik1.txt plik2.txt > plik3.txt
cat plik3.txt
cat -n plik3.txt
cat -E plik3.txt
cat -nE plik3.txt
cat -bE plik3.txt
cat -n plik3.txt plik2.txt
*******************************************
Rozdzial 4
*******************************************
4.1.
man apt-get
apt-get moo
sudo apt-get update
apt-cache search mc
apt-cache show mc
sudo apt-get install mc
mc
4.2.
apt-get remove mc
sudo apt-get remove mc
sudo apt-get -q install mc > instalacja_mc.txt
dpkg --get-selections
dpkg --get-selections > zainstalowane.txt
4.3.
mc
*******************************************
Rozdzial 5
*******************************************
5.1.
who
5.2.
nano /etc/passwd
5.3.
more /etc/passwd
sudo nano /etc/passwd
5.4.
ll
sudo nano /etc/group
5.5.
sudo nano /etc/adduser.conf
5.6.
adduser adrian
sudo more /etc/passwd
sudo more /etc/shadow
5.7.
sudo addgroup marketing
sudo adduser adrian marketing
sudo addgroup projekty
sudo adduser tomek projekty
sudo adduser adrian projekty
sudo del group projekty
5.8.
passwd -h
sudo passwd adrian
sudo passwd -e adrian
sudo passwd -l adrian
sudo passwd -u adrian
sudo -v
sudo -k
5.9.
sudo adduser dorota
sudo adduser dorota marketing
usermod -h
usermod -l iwona -c "Iwona Nowak" dorota
5.10.
cat > plik_iwona.txt
sudo usermod -d /home/iwona/ -m iwona
groupmod -h
sudo groupmod -n iwona dorota
5.11.
sudo -u iwona nano plik_iwona.txt
sudo -k
5.12.
deluser --help
sudo deluser --remove-home --backup-to /home/tomek/zapas iwona
sudo deluser adrian
5.13.
useradd -D
sudo useradd -m jacek -c "Jacek Nowak, 12,243,654,elektryk" -G marketing
-s /bin/bash -p 123456
sudo passwd jacek
*******************************************
Rozdzial 6
*******************************************
6.1.
{windows}
ipconfig
ping xxx.xxx.xxx.xxx
ping -t xxx.xxx.xxx.xxx
{linuks}
ifconfig
ping -c 5 xxx.xxx.xxx.xxx
ifconfig -a
sudo ifdown eth0
sudo ifup eth0
6.2.
sudo ifconfig eth0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
sudo ip addr flush eth0
sudo /etc/init.d/networking start
sudo /etc/init.d/networking stop
sudo /etc/init.d/networking restart
6.3.
sudo nano /etc/network/interfaces
wpisać:{
# iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.211
netmask 255.255.255.0
gateway 192/168.1.1
dns-search dns.tpsa.pl
dns-nameservers 194.204.159.1 194.204.152.34
}
6.4.
sudo nano /etc/hosts
wpisać:{
xxx.xxx.xxx.xxx nazwa.domeny
}
6.5.
sudo apt-get install isc-dhcp-server
sudo nano /etc/default/isc-dhcp-server
wpisać:{
INTERFACES="eth0"
}
sudo nano /etc/dhcp/dhcpd.conf
wpisać(np):{
subnet 192.168.1.0 netmask 255.255.255.0{
range 192.168.1.100 192.168.1.109;
option routers 192.168.1.1;
}
}
sudo service isc-dhcp-server start
sudo service isc-dhcp-server stop
sudo service isc-dhcp-server restart
*******************************************
Rozdzial 7
*******************************************
7.1.
sudo apt-get install openssh-server
sudo nano /etc/ssh/sshd_config
sudo service ssh start
sudo service ssh stop
sudo service ssh restart
7.2.
ssh {nazwa_uzytkowniak_na_serwerze}@{adres_IP_servera}
np:
ssh tomek@192.168.1.221
ssh -p{port} {nazwa_uzytkowniak_na_serwerze}@{adres_IP_servera}
sudo nano /etc/ssh/sshd_config
sudo service ssh restart
sudo nano /etc/ssh/ssh_config
{nazwa_uzytkownika} ALL=(ALL:ALL) ALL
netstat -lp
netstat -a
7.3.
http://www.putty.org/
putty.exe
7.4.
sudo apt-get install ntfs_config
sudo fdisk -l
sudo mkdir /media/usb
sudo mount /dev/{nazwa_zasobu} /media/usb
sudo umount/usb
możliwe problemy:
{
chmod 700 ~ / .ssh
chmod 600 ~ / .ssh / id_rsa
chmod 644 ~ / .ssh / id_rsa.pub
chmod 644 ~ / .ssh / authorized_keys
chmod 644 ~ / .ssh / known_hosts
}
7.5.
ssh-keygen -t rsa
scp id.pub {nazwa_uzytkowniak_na_serwerze}@{adres_IP_servera}
sudo nano /etc/ssh/sshd_config
more id_rsa.pub
cat id_rsa.pub >> authorized_keys
ssh {nazwa_uzytkowniak_na_serwerze}@{adres_IP_servera}
7.6.
cat > przeslany.txt
cat > pobrany.txt
sftp tomek@192.168.1.211
sftp> ?
sftp> lls
sftp> lls -a
sftp> ls -a
sftp> put przeslany.txt
sftp> get pobrany.txt
sftp> mkdir katalog_zdalny
sftp> exit
7.7.
http://www.winscp.net
*******************************************
Rozdzial 8
*******************************************
8.1.
sudo apt-get install cifs-utils
mkdir ~/windows
sudo mount.cifs //{adres_IP_stacja_widows}/{nazwa_udostepnionego_folderu}
~/windows -o user={nazwa_uzytkownika}
np:
sudo mount.cifs //192.168.1.224/udostepniony ~/windows -o user=tomasz
8.2.
sudo apt-get install samba
sudo smbpasswd -a tomek
mkdir ~/dla_windows
sudo nano /etc/samba/smb.conf
dopisać:
[dla_windows]
path = /home/tomek/dla_windows
available = yes
valid users = tomek
read only = no
browsable = yes
public = yes
writable = yes
#opcjonalnie
guest ok=yes
create mask = 0755
sudo service smbd restart
sudo service nmbd restart
#usunięcie samby: sudo apt-get autoremove samba samba-common
8.4 i 8.5.
sudo apt-get install cups
sudo nano /etc/cups/cupsd.conf
Listen 0.0.0.0:631
Allow from 192.168.1.*
sudo apt-get install jplip-dbg hplip-gui
hp-setup –i
*******************************************
Rozdzial 9
*******************************************
9.1.
jobs
bg
bg %1
fg %1
kill -3 %1
9.2.
free -m
free -g
free -m -s 2 -c 5
free -m -s 2 -c 5 > zapis_pamieci.txt
9.3.
ps
ps -ef
ps -aux
ps -axjf
ps -eLF
9.4.
top
htop
sudo apt-get install htop
man kill
kill
kill -9 -1
kill -15
*******************************************
Rozdzial 10
*******************************************
10.01
w pliku:
sudo nano /etc/apt/sources.list
dopisać:
deb http://download.webmin.com/download/repository sarge contrib
wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install webmin