« first day (1844 days earlier)
← previous day
next day →
last day (3469 days later) »
00:00 - 11:00
11:00 - 12:00
12:00 - 13:00
13:00 - 14:00
14:00 - 20:00
20:00 - 22:00
22:00 - 23:00
23:00 - 00:00
Sajad
22:00
@tereško yes ! ok
tereško
now, in the rules window you need to add new rule
name it .. dunno ... "ssh", protocol: tcp, host port: 22, guest port: 22
Sajad
I can not write a name, It is deavtivate
tereško
did you click the green "+" button?
Sajad
no yet :-)
Adapter type ?
Ok done !
so
tereško
what ?
Sajad
22:03
name ?
tereško
49 secs ago
, by
Sajad
Adapter type ?
Sajad
@tereško nothing
tereško
there is no "adapter type" in that window
there are name, protocol, ports and IPs
Sajad
any way I leave it on default
tereško
don't touch that
Sajad
22:05
@tereško ok
name ?
I change "Rule 1" ?
tereško
4 mins ago
, by
tereško
name it .. dunno ... "ssh", protocol: tcp, host port: 22, guest port: 22
Sajad
ok
tereško
done?
Sajad
host IP and guest IP ?
tereško
leave them empty
Sajad
22:07
ok
done
tereško
now open putty and try connecting to: root@localhost
Sajad
I save it, so and start ?
tereško
yes, you need to start the VM
(I actually didn't tell you to turn it off)
Sajad
@tereško ok!
1 sec ...
ok
putty wants a password
tereško
well, you are trying to log in as root
Sajad
22:10
ok
access denied !
password for root@sajad:
is the same with that password for login in VM ?
tereško
you are using putty to connect to the same system
Sajad
ah
but I don't know why It says my password is wrong
tereško
because you make a mistake
1 sec
I think I actually know why
Sajad
why ?
tereško
because it is protected by default
Sajad
22:14
em, what's that mean ?
tereško
which is really good, but we need to temporary change that
Sajad
how ?
tereško
ok, switch to your VM window
Sajad
ok
so ?
tereško
and type in: ee /etc/ssh/sshd_config
that will open a file and let you edit it
"ee" is "easy edit" .. or something like that
Sajad
22:15
@tereško where I type it ?
tereško
in the black console
(you have to be logged in as root)
Sajad
aha
ok
tereško
did the file open?
Sajad
oh !
yes
tereško
go to about 40-ish line, there will be text: #PermitRootLogin: no
Sajad
22:17
there is 148 lines of text
ok
tereško
you need to remove the # and change that one to "yes"
then press Esc key > leave editor > save changes
Sajad
# Logging
to
Loggin
?
tereško
1 min ago
, by
tereško
go to about 40-ish line, there will be text: #PermitRootLogin: no
Sajad
ah, I found it
I just remove # or set yes instead of no ?
tereško
yes
Sajad
22:19
@tereško set yes ?
tereško
2 mins ago
, by
tereško
you need to remove the # and change that one to "yes"
please pay attention
Sajad
really I don't know why sometimes I don't see some of your comments !!
I pressed ESC
a) leave editor
b) help
c) file operations
... ?
a ?
tereško
2 mins ago
, by
tereško
then press Esc key > leave editor > save changes
seriously
for fuck sake
PAY ATTENTION
Sajad
@tereško ok :-)
done
I go back to putty ?
tereško
no
there is an sshd service running on your server and you need to restart it
Sajad
22:22
ok, how ?
tereško
if you write: service -l
Sajad
ok so ?
tereško
it will list all the available services
Sajad
yes, exactly
tereško
if you write: service -l | grep ssh
it will list all service that have "ssh" in the name
Sajad
22:23
I gives me "sshd"
tereško
so, you know that service is called sshd
to restart it you write: service sshd restart
Sajad
ok, how restatr it ?
ah ok
tereško
and now you go back to putty
Sajad
done
ok
one question:
tereško
try to log in root@localhost with putty
Sajad
22:25
vm windows is like a command line ?
@tereško ok
tereško
did you get in now?
Sajad
CONNECTED :) ! Huraa !
@tereško yes, exactly seems are the same
tereško
so, now the VM window and putty window both are connected to the same server
those are two separate terminals, but with exactly the same functionality
Sajad
@tereško yes !
"terminals" is a word that I searched for it few min ago :-)
so I have a VPS, right ?
tereško
yes
ko, but we did a bad thing here
Sajad
22:28
?
tereško
the security of your system was lowered, because you permitted for a root to directly connect to a server
Sajad
how should I increase it ?
I should to limit myself :-P
?
tereško
you need to be able to log in with out "sajad" username instead
but, when you created that user, I explicitly told you not to enable "password login"
now, @Sajad, go you have puttygen
if you don't, you can download it here:
chiark.greenend.org.uk/~sgtatham/putty/download.html
(I hope you can access that page)
Sajad
The latest release version (beta 0.65) ?
or
The latest development snapshot ?
tereško
pick "release", you want the stable version
Sajad
22:33
downloaded !
tereško
you will be generating an RSA key .. read later:
en.wikipedia.org/wiki/Public-key_cryptography
Sajad
@tereško ok
tereško
launch the exe file and click "generate" button
Sajad
I did
tereško
it should be telling you to wave mouse around to to generate "random data"
did you get the bar filled?
Sajad
22:35
OMG !!!!!!
when I move my mouse, It will fill !
really and really intresting !
tereško
what you are doing there is creating random information
kinda like salt for password hashing
Sajad
@tereško yes!
very good ! I like it !
done
tereško
ok .. you got it filled, I assume
Sajad
@tereško correct !
there is two this:
key fingerprint
key comment
tereško
I would recommend to set comment to: sajad@laptop
or something like that
it weill just be there to help you recognise it later
Sajad
22:37
aha ok
tereško
and for passphrase you put some password (not the same as root)
Sajad
ok
and press Generate ?
tereško
no
now you want to save the private key
Sajad
so what ?
ah ok
it want me a path
tereško
I would recommenf name: freebsd-vm.ppk
and put it in your windows user folder
or you could create a separate "keys" folder
Sajad
22:40
@tereško windows user folder ? where is that ?
tereško
it should be the one that the "save file" dialog opened
with "downloads", "desktop", "video" and other crap
Sajad
your mean is my documents ?
tereško
user folder is C:/users/<your username>
Sajad
ah ok
now I create a folder here
?
tereško
I would
Sajad
22:43
here is a folder: VirtualBox VMs
I can use it ?
tereško
no, don't put your keys there
Sajad
ok
tereško
have a separate folder
Sajad
ok done
so Generate ?
tereško
no
Sajad
22:45
:)
ok
tereško
in tame you will have more keys .. for example, github or bitbucket
ok .. now you need to register that key for the user
go to putty, where you logged in with root
Sajad
ok
tereško
and type in: su sajad
and then: cd /home/sajad
Sajad
sajad@sajad:~:
Anmol Raghuvanshi
morning
Sajad
22:47
@AnmolRaghuvanshi morning, but please don't say anything now:)
@tereško I did
Anmol Raghuvanshi
i could type
tereško
ok, on linux and bsd hidden files and folder start with . (a dot)
to see them you have to write: ls -la
do that and check if there is a folder ".ssh"
(it probably wont be there)
@Sajad ?
Sajad
there is several files
tereško
but not ".ssh"
so, you need to create that directory: mkdir .ssh
Sajad
done
tereško
22:51
(as you might guess, it stands for "make directory")
Sajad
.ssh added to my list
tereško
and inside that directory you will create "authorized_keys" file: ee .ssh/authorized_keys
(it will open an empty text editor)
Sajad
"ee" will open an empty text editor ?
tereško
you have to write: ee .ssh/authorized_keys
Sajad
I did not create
authorized_keys
yet
tereško
22:54
if you try to open a file, which does not exist, then the file will be crated, when you save on exit
Sajad
ow ! got it
I opened it via a editor
tereško
ok, now, switch back to puttygen
Sajad
ok
tereško
and all of the content that is in the gray field
Sajad
so
tereško
22:55
it will start with something like ssh-rsa AAAA....
Sajad
it is a big string !
tereško
a lot of content and it will end with ...== sajad@laptop
yes
copy all of it
Sajad
ok
so ?
tereško
now, back to putty
Sajad
ok
tereško
22:56
you need to paste it in the editor
Sajad
how ? ctrl+V does not work
tereško
IIRC, you could to that in putty by pressing "right-click"
Sajad
ah ok :)
so ?
I save it ?
tereško
did it work?
if yes, then save it
Sajad
yes
tereško
22:57
esc > leave > save
Sajad
ok done
tereško
and to complete this thing, you will need to change the permissions for that file
Sajad
which file ?
tereško
authorized_keys
Sajad
ah ok
I open it again via editor ?
tereško
22:58
no
Sajad
how to change the permissions ?
tereško
you can do that with command: chmod 600 .ssh/authorized_keys
and: chmod 700 .ssh
Sajad
I just write
chmod 600 .ssh/authorized_keys
in putty ?
tereško
yes
00:00 - 11:00
11:00 - 12:00
12:00 - 13:00
13:00 - 14:00
14:00 - 20:00
20:00 - 22:00
22:00 - 23:00
23:00 - 00:00
« first day (1844 days earlier)
← previous day
next day →
last day (3469 days later) »
all rooms
Transcript for
Aug
23
Aug '15
24
Aug
25
Root Access
For all you Super Users out there. You have backups, right?
4
computers
technology
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2025 Stack Exchange Inc;
legal
mobile