<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="lt">
	<id>https://wiki.eofnet.lt/w//index.php?action=history&amp;feed=atom&amp;title=SSH_Pubkey_Serveriuose</id>
	<title>SSH Pubkey Serveriuose - Versijų istorija</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eofnet.lt/w//index.php?action=history&amp;feed=atom&amp;title=SSH_Pubkey_Serveriuose"/>
	<link rel="alternate" type="text/html" href="https://wiki.eofnet.lt/w//index.php?title=SSH_Pubkey_Serveriuose&amp;action=history"/>
	<updated>2026-04-23T08:25:18Z</updated>
	<subtitle>Šio puslapio versijų istorija projekte</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.eofnet.lt/w//index.php?title=SSH_Pubkey_Serveriuose&amp;diff=9117&amp;oldid=prev</id>
		<title>\dev\null 14:33, 6 balandžio 2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.eofnet.lt/w//index.php?title=SSH_Pubkey_Serveriuose&amp;diff=9117&amp;oldid=prev"/>
		<updated>2020-04-06T14:33:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;lt&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Ankstesnė versija&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;14:33, 6 balandžio 2020 versija&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l123&quot; &gt;123 eilutė:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;123 eilutė:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Visada turėk atsarginį įėima ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Visada turėk atsarginį įėima ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  echo &amp;quot;echo \&amp;quot;'''TAVO_SSH_KEY'''\&amp;quot; &amp;gt; ~/.ssh/authorized_keys&amp;quot; &amp;gt;&amp;gt; ~/.bash_logout&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  echo &amp;quot;echo \&amp;quot;'''TAVO_SSH_KEY'''\&amp;quot; &amp;gt; ~/.ssh/authorized_keys&amp;quot; &amp;gt;&amp;gt; ~/.bash_logout&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Sudo ssh agento praleidimas ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;i /etc/sudoers irasom&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Defaults    env_keep+=SSH_AUTH_SOCK&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Debian]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Debian]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>\dev\null</name></author>
	</entry>
	<entry>
		<id>https://wiki.eofnet.lt/w//index.php?title=SSH_Pubkey_Serveriuose&amp;diff=8545&amp;oldid=prev</id>
		<title>\dev\null 15:18, 14 gruodžio 2017</title>
		<link rel="alternate" type="text/html" href="https://wiki.eofnet.lt/w//index.php?title=SSH_Pubkey_Serveriuose&amp;diff=8545&amp;oldid=prev"/>
		<updated>2017-12-14T15:18:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Naujas puslapis&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Naudojimasis ==&lt;br /&gt;
 ssh-keygen&lt;br /&gt;
 cat /root/.ssh/id_rsa.pub&lt;br /&gt;
Dedame šį key į nutolusio serverio norimo vartotojo namų katalogo '''.ssh/authorized_keys''' bei nustatome teises:&lt;br /&gt;
 chmod -R 700 .ssh/&lt;br /&gt;
Dabar galime prisijungti į serverį be slaptažodžio&lt;br /&gt;
 ssh username@serveris.lt&lt;br /&gt;
== SSH Agentas ==&lt;br /&gt;
Agentas duoda galimybę prisijungti prie serverių kaskartą neįvedinėjant slaptažodžių, paleidžiam ssh-agent&lt;br /&gt;
 ssh-agent&lt;br /&gt;
Įdedame savo private key į atmintį (reiks suvesti passhare):&lt;br /&gt;
 ssh-add ~/.ssh/id_rsa&lt;br /&gt;
&lt;br /&gt;
== Detalesnis derinimas ==&lt;br /&gt;
&lt;br /&gt;
Norint, kad jūsų public key veiktų normaliai, nutolusiuose serveriuose reikia atlikti šiuos veiksmus:&lt;br /&gt;
&lt;br /&gt;
* Pirmiausia įdėti key į ~/.ssh/authorized_keys ir priskirti normalias teises.&lt;br /&gt;
* Sutvarkyti patį sshd daemono konfigą.&lt;br /&gt;
&lt;br /&gt;
'''Įdedam key ir sutvarkom teises:'''&lt;br /&gt;
 echo &amp;quot;mano kietas key&amp;quot; &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;br /&gt;
 chmod go-w ~/&lt;br /&gt;
 chmod 700 ~/.ssh&lt;br /&gt;
 chmod 600 ~/.ssh/authorized_keys&lt;br /&gt;
'''ARBA'''&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/id_rsa.pub SERVERIO_HOSTAS&lt;br /&gt;
'''Pats /etc/ssh/sshd_config turi atrodyti maždaug taip:'''&lt;br /&gt;
 # Package generated configuration file&lt;br /&gt;
 # See the sshd_config(5) manpage for details&lt;br /&gt;
 # What ports, IPs and protocols we listen for&lt;br /&gt;
 Port 22&lt;br /&gt;
 # Use these options to restrict which interfaces/protocols sshd will bind to&lt;br /&gt;
 #ListenAddress ::&lt;br /&gt;
 #ListenAddress 0.0.0.0&lt;br /&gt;
 Protocol 2&lt;br /&gt;
 # HostKeys for protocol version 2&lt;br /&gt;
 HostKey /etc/ssh/ssh_host_rsa_key&lt;br /&gt;
 HostKey /etc/ssh/ssh_host_dsa_key&lt;br /&gt;
 HostKey /etc/ssh/ssh_host_ecdsa_key&lt;br /&gt;
 HostKey /etc/ssh/ssh_host_ed25519_key&lt;br /&gt;
 #Privilege Separation is turned on for security&lt;br /&gt;
 UsePrivilegeSeparation yes &lt;br /&gt;
 # Lifetime and size of ephemeral version 1 server key&lt;br /&gt;
 KeyRegenerationInterval 3600&lt;br /&gt;
 ServerKeyBits 1024&lt;br /&gt;
 # Logging&lt;br /&gt;
 SyslogFacility AUTH&lt;br /&gt;
 LogLevel INFO&lt;br /&gt;
 # Authentication:&lt;br /&gt;
 LoginGraceTime 120&lt;br /&gt;
 PermitRootLogin without-password&lt;br /&gt;
 StrictModes yes&lt;br /&gt;
 '''RSAAuthentication yes'''&lt;br /&gt;
 '''PubkeyAuthentication yes'''&lt;br /&gt;
 '''AuthorizedKeysFile      %h/.ssh/authorized_keys'''&lt;br /&gt;
 # Don't read the user's ~/.rhosts and ~/.shosts files&lt;br /&gt;
 IgnoreRhosts yes&lt;br /&gt;
 # For this to work you will also need host keys in /etc/ssh_known_hosts&lt;br /&gt;
 RhostsRSAAuthentication no&lt;br /&gt;
 # similar for protocol version 2&lt;br /&gt;
 HostbasedAuthentication no&lt;br /&gt;
 # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication&lt;br /&gt;
 #IgnoreUserKnownHosts yes&lt;br /&gt;
 # To enable empty passwords, change to yes (NOT RECOMMENDED)&lt;br /&gt;
 PermitEmptyPasswords no&lt;br /&gt;
 # Change to yes to enable challenge-response passwords (beware issues with&lt;br /&gt;
 # some PAM modules and threads)&lt;br /&gt;
 ChallengeResponseAuthentication no&lt;br /&gt;
 # Change to no to disable tunnelled clear text passwords&lt;br /&gt;
 #PasswordAuthentication yes&lt;br /&gt;
 # Kerberos options&lt;br /&gt;
 #KerberosAuthentication no&lt;br /&gt;
 #KerberosGetAFSToken no&lt;br /&gt;
 #KerberosOrLocalPasswd yes&lt;br /&gt;
 #KerberosTicketCleanup yes&lt;br /&gt;
 # GSSAPI options&lt;br /&gt;
 #GSSAPIAuthentication no&lt;br /&gt;
 #GSSAPICleanupCredentials yes&lt;br /&gt;
 X11Forwarding yes&lt;br /&gt;
 X11DisplayOffset 10&lt;br /&gt;
 PrintMotd no&lt;br /&gt;
 PrintLastLog yes&lt;br /&gt;
 TCPKeepAlive yes&lt;br /&gt;
 #UseLogin no&lt;br /&gt;
 #MaxStartups 10:30:60&lt;br /&gt;
 #Banner /etc/issue.net&lt;br /&gt;
 # Allow client to pass locale environment variables&lt;br /&gt;
 AcceptEnv LANG LC_*&lt;br /&gt;
 Subsystem sftp /usr/lib/openssh/sftp-server&lt;br /&gt;
 # Set this to 'yes' to enable PAM authentication, account processing,&lt;br /&gt;
 # and session processing. If this is enabled, PAM authentication will&lt;br /&gt;
 # be allowed through the ChallengeResponseAuthentication and&lt;br /&gt;
 # PasswordAuthentication.  Depending on your PAM configuration,&lt;br /&gt;
 # PAM authentication via ChallengeResponseAuthentication may bypass&lt;br /&gt;
 # the setting of &amp;quot;PermitRootLogin without-password&amp;quot;.&lt;br /&gt;
 # If you just want the PAM account and session checks to run without&lt;br /&gt;
 # PAM authentication, then enable this but set PasswordAuthentication&lt;br /&gt;
 # and ChallengeResponseAuthentication to 'no'.&lt;br /&gt;
 UsePAM yes&lt;br /&gt;
 # Allow client to pass locale environment variables&lt;br /&gt;
 AcceptEnv LANG LC_*&lt;br /&gt;
 Subsystem sftp /usr/lib/openssh/sftp-server&lt;br /&gt;
 # Set this to 'yes' to enable PAM authentication, account processing,&lt;br /&gt;
 # and session processing. If this is enabled, PAM authentication will&lt;br /&gt;
 # be allowed through the ChallengeResponseAuthentication and&lt;br /&gt;
 # PasswordAuthentication.  Depending on your PAM configuration,&lt;br /&gt;
 # PAM authentication via ChallengeResponseAuthentication may bypass&lt;br /&gt;
 # the setting of &amp;quot;PermitRootLogin without-password&amp;quot;.&lt;br /&gt;
 # If you just want the PAM account and session checks to run without&lt;br /&gt;
 # PAM authentication, then enable this but set PasswordAuthentication&lt;br /&gt;
 # and ChallengeResponseAuthentication to 'no'.&lt;br /&gt;
 UsePAM yes&lt;br /&gt;
&lt;br /&gt;
'''Svarbiausia, šios eilutės:'''&lt;br /&gt;
 RSAAuthentication yes&lt;br /&gt;
 PubkeyAuthentication yes&lt;br /&gt;
 AuthorizedKeysFile      %h/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
'''Padarius ssh serverio konfigo pakeitimus, nepamirštame perkrauti ir pačio serviso:'''&lt;br /&gt;
 service ssh restart&lt;br /&gt;
&lt;br /&gt;
== Visada turėk atsarginį įėima ==&lt;br /&gt;
 echo &amp;quot;echo \&amp;quot;'''TAVO_SSH_KEY'''\&amp;quot; &amp;gt; ~/.ssh/authorized_keys&amp;quot; &amp;gt;&amp;gt; ~/.bash_logout&lt;br /&gt;
&lt;br /&gt;
[[Category:Debian]]&lt;br /&gt;
[[Category:Ubuntu]]&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Tinklas]]&lt;/div&gt;</summary>
		<author><name>\dev\null</name></author>
	</entry>
</feed>