---
title: sprawdzian PWI
---

1. Generating Keys

* pokazać zawartość klucza publicznego:
cat .shh/id_rsa.pub
* następnie skopiować klucz do .ssh/authorized_keys
Add Key to server in one command
$ cat ~/.ssh/id_rsa.pub | ssh brad@192.168.1.29 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys
$ cat .ssh/authorized_keys
* Create & copy a file to the server using SCP
$ touch test.txt
$ scp ~/test.txt brad@192.168.1.29:~
* W przypadku problemów z dostępem do github przez ssh
Could not open a connection to your authentication agent.
or
Permission denied (publickey).
fatal: Could not read from remote repository.
(otwórz w nowym oknie)

2. Logowanie na serwer
(prawdopodobnie przez ssh k325730@pwi.ii.uni.wroc.pl)
Once an SSH key has been created, the ssh-copy-id command can be used to install it as an authorized key on the server
ssh-copy-id -i ~/.ssh/mykey user@host
3. SSH
ssh-keygen - creates a key pair for public key authentication
ssh-copy-id - configures a public key as authorized on a server
ssh-agent - agent to hold private key for single sign-on
ssh-add - tool to add a key to the agent
scp - file transfer client with RCP-like command interface
sftp - file transfer client with FTP-like command interface
sshd - OpenSSH server
4. Plik konfiguracyjny
http://edukacja.3bird.pl/download/informatyka/etap4/gentoo/informatyka-etap4-gentoo-sshd-conf.pdf
5. "Zadania 2-3. Porób coś na tamtym serwerze (np. wyszukaj coś grepem, pobaw się screenem, mv, cp, >>, scp, itd.)."
**grep**: the grep command is used to search text. It searches the given file for lines containing a match to the given strings or words.
$ grep 'word' filename
$ fgrep 'word-to-search' file.txt
https://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/