/etc/ssh/sshd_config ChallengeResponseAuthentication yes UsePAM yes AuthenticationMethods publickey,keyboard-interactive:pam PasswordAuthentication no /etc/pam.d/sshd #@include common-auth auth required /usr/local/lib/security/pam_google_authenticator.so
Archive for the ‘Пингвин’ Category
Дано: сервер локальной сети ourproxy.provider.ru, доступный извне. Требуется: получить из дома доступ к ресурсам внутри локальной сети, например, к интранет-серверу 10.10.5.1:80 Решение: выполнить на домашней машине команду, пробрасывающую туннель к искомому IP-адресу через ourproxy.provider.ru: ssh -f -N user@ourproxy.provider.ru -L 8080:10.10.5.1:80 Опция -f говорит ssh, что после соединения нужно уйти в background. Опция -N указывает, что […]
1 |
ip link add link DEVNAME name VLANNAME type vlan id VLAN-ID reorder_hdr on|off |
loose_binding on|off gvrp on|off ingress-qos-map FROM:TO egress-qos-map FROM:TO
1 2 3 4 5 6 |
#cat /etc/rc.local vconfig add eth0 418 ip l s up eth0.418 ip a a 192.168.168.21/24 dev eth0.418 ip r a default via 192.168.168.1 |
Here’s how to disable the protocol on a Red Hat-based system:
1 2 |
# sysctl -w net.ipv6.conf.all.disable_ipv6=1 # sysctl -w net.ipv6.conf.default.disable_ipv6=1 |
To re-enable IPv6, issue the following commands:
1 2 |
# sysctl -w net.ipv6.conf.all.disable_ipv6=0 # sysctl -w net.ipv6.conf.default.disable_ipv6=0 |
Here’s how to disable the protocol on a Debian-based machine. 1. Open a terminal window. 2. Issue the command sudo nano /etc/sysctl.conf 3. Add the following at the bottom of the file:
1 2 3 |
# net.ipv6.conf.all.disable_ipv6 = 1 # net.ipv6.conf.default.disable_ipv6 = 1 # net.ipv6.conf.lo.disable_ipv6 = 1 |
4. Save […]
1 2 |
# apt-get install samba # apt-get install samba-client |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#vi /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = Samba Server %v netbios name = OPI security = user map to guest = bad user dns proxy = no hosts allow = 192.168.0.0/255.255.255.0 hosts deny = all interfaces = eth0 socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 [Downloads] comment = Downloads read only = no locking = no path = /home/user/Downloads guest ok = no |
Add Samba users Samba uses it’s own password system so users need to be added by root. Note that the users have to exist in /etc/passwd
1 2 |
# smbpasswd -a me # smbpasswd -a you |
You will be prompted for a password for each of those users. To list existing Samba users:
1 |
# pdbedit -w -L |
Restart the Samba daemon
1 |
# /etc/init.d/samba restart |
or, if you […]
To enable wifi connection from command line run: sudo nmcli -a d wifi connect and enter your wifi credentials Зло! apt-get remove network-manager (:
1 2 |
iw dev wlp4s0 scan | grep -i ssid wpa_passphrase ssid pswd |
/etc/wpa_supplicant.conf
1 2 3 4 5 6 7 8 |
ap_scan=1 ctrl_interface=/var/run/wpa_supplicant network={ ssid="xxxxxx" scan_ssid=1 psk="yyyyyyy" } |
/etc/network/interfaces
1 2 3 4 |
auto wlan0 iface wlan0 inet dhcp pre-up sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dnl80211 post-down sudo killall -q wpa_supplicant |
Fedora: https://ask.fedoraproject.org/en/question/59278/how-can-i-enable-wpa_supplicant-on-boot/
1. IOS не NPE, т.е. без NPE в назнавнии, т.е., например, вот такой: c2900-universalk9-mz.SPA.151-3.T.bin. У вас — нпе. http://pig.lsd-25.ru/uploads/ios/ (меня разбанили) 2. ИОС не ниже версий: 15.0(1)M4, 15.1(1)T2, 15.1(2)T2, 15.1(3)T. У вас — сами угадаете? 3. Зайти на роутере в привелегированный режим и в режим глобальной конфигурации. Это может быть проблемой. Но это обязательное условие. […]
Configuration on Cisco IOS router: version 12.4 ! hostname L2TP ! ! aaa new-model ! ! aaa authentication ppp VPDN_AUTH local ! ! vpdn enable ! vpdn-group L2TP ! Default L2TP VPDN group accept-dialin protocol l2tp virtual-template 1 no l2tp tunnel authentication ! ! ! username cisco privilege 15 password 0 cisco ! ! crypto […]
script: #!/bin/bash filename=$(perl -e «print time») foldername=$(date —rfc-3339=date) curl «http://127.0.0.1:8080/?action=snapshot» > $filename timestamp=stat -c %y $filename if ! [ -d/path/to/dir/$foldername ]; then mkdir /path/to/dir/$foldername fi ### timestamp convert $filename -fill black -fill white -pointsize 15 -draw «text 5,15 ‘${timestamp:0:19}’»/path/to/dir/$foldername/$filename.jpg ### rm $filename add to crontab: */1 * * * * /snapshot.sh >/dev/null 2>&1 […]
mjpg-streamer.tar (from http://lilnetwork.com/download/raspberrypi/mjpg-streamer.tar.gz) sudo apt-get update sudo apt-get install libv4l-dev libjpeg8-dev subversion imagemagick sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/ mjpg-streamer cd mjpg-streamer/ make USE_LIBV4L2=true clean all sudo make DESTDIR=/usr install sudo cp mjpg_streamer /usr/local/bin sudo cp -R www /usr/local/www mjpg_streamer -i «/usr/lib/input_uvc.so -d /dev/video0 -y -r 1280×720 -q 95 -f 4 -l auto» […]