/srv/irclogs.ubuntu.com/2009/04/24/#ubuntu-classroom.txt

raphaWhat about a Ubuntu Classroom lecture on how to package software for Ubuntu?00:32
HymnToLifethere's been a lot of them already IIRC00:38
bodhi_zazen10 min or so ..00:49
bodhi_zazenI will be demo on a shared session :)00:49
bodhi_zazento log on : http://paste.ubuntu.com/156798/00:49
bodhi_zazenif we can get people connected to the server in advance - woot00:49
bodhi_zazenIf people need help connecting , ask00:50
bodhi_zazenIf you know how to connect, please help in a /msg ;)00:50
bodhi_zazendon't all connect all at once now :)00:54
bodhi_zazenwelcmoe ibuclaw , thanks for coming ;)00:54
bodhi_zazenibuclaw: do you know how to use my shared ssh session ?00:55
WastePotatoHallo.00:56
bodhi_zazen'lo WastePotato , thank you for coming as well00:56
bodhi_zazendo you recall how to connect to my ssh session ?00:57
WastePotatoHey bodhi_zazen.00:57
WastePotatoI still have your key, but I don't remember the command.00:57
bodhi_zazenhttp://paste.ubuntu.com/156798/00:58
bodhi_zazen2 min or so ;)00:58
bodhi_zazenwho is here for the session ?00:58
bodhi_zazenI am hoping to have a more interactive session, as they are more fun ;)00:58
WastePotatoPresent.00:58
WastePotatobodhi_zazen... is that.. screen?00:58
bodhi_zazenyes WastePotato ;)00:59
bodhi_zazenscreen FTW00:59
WastePotatoDang. o:00:59
bodhi_zazen?00:59
WastePotatoLooks nice. :D01:00
bodhi_zazen>:)01:00
HymnToLifebodhi_zazen: can we run commands in your SSH session?01:00
WastePotatoLawl no.01:00
HymnToLife:(01:00
bodhi_zazenno, but if you ask I will run them for you ;)01:00
WastePotatoIt's read only. |:01:00
bodhi_zazenIf too many people enter stuff at the same time it gets confusing01:01
bodhi_zazenShall we start ?01:01
bodhi_zazenssh is one of my favorite topics :)01:01
bodhi_zazenBrief into to ssh ?01:02
WastePotatoSSH \o/01:02
bodhi_zazenssh == Secure SHell01:02
bodhi_zazenit allows one to log into a server and execute commands01:02
bodhi_zazenone can forward X applications, an entire desktop, ports, sockets, etc01:03
bodhi_zazenI would like to cover some of the basics today ;)01:03
WastePotatoCool. :)01:03
bodhi_zazenthe computer you log into will be called "the server" today01:03
bodhi_zazenYou first need to install ssh onto the server01:04
ibuclawbodhi_zazen, I know vaguely how to use it...01:04
bodhi_zazenapt-get install ssh-server01:04
HymnToLifeopenssh-server*01:04
HymnToLife(or does ssh-server work too?)01:04
WastePotato?01:04
bodhi_zazenthanks HymnToLife , lol01:04
WastePotatoOh.01:04
bodhi_zazenyou then ssh user@server01:04
bodhi_zazenif you are on *unix , and have the same account name on clinet and server, you can ssh server01:05
bodhi_zazento execute a command on the server01:05
bodhi_zazenssh server command01:05
HymnToLifenot only on *nix :o01:05
HymnToLifeit works on Windows too01:06
bodhi_zazendoes it work on Windows ?01:06
bodhi_zazennice01:06
WastePotatoPuTTy?01:06
bodhi_zazenyes, use putty on windows01:06
HymnToLifeWastePotato: you can also install OpenSSH on Windows01:06
bodhi_zazenalthough if you like putty you can install it on Linux as well01:06
HymnToLifeputty is a bit more convenient though01:06
WastePotatoI see...01:06
bodhi_zazenputty is nice in that it stores servers and idents :)01:06
WastePotatoPutty on Linux as well? Nice.01:07
bodhi_zazenOK, want to see a demo of ssh on my session ?01:07
WastePotatoYes!01:07
bodhi_zazenor shall we move on01:07
bodhi_zazenkk ..01:07
WastePotato\o/01:07
bodhi_zazensee how the first time we connect to the server, we are asked to accept the server key ?01:08
bodhi_zazenthe key is stored in ~/.ssh/known_hosts01:08
bodhi_zazennow we will not be asked to accept the key , watch01:08
bodhi_zazensee ?01:09
bodhi_zazenOK, lets run a command on the server :)01:09
bodhi_zazen::)01:09
bodhi_zazenyou forward application with -X01:09
WastePotatoAh. Didn't know you could specify a command on connection. o:01:10
bodhi_zazenssh -X user@server xeyes01:10
kklimondaany idea why i can't forward firefox this way?01:10
bodhi_zazenwill run xeyes on your local client, assuming you have X installed ;)01:10
bodhi_zazenyes kklimonda01:10
HymnToLifeWastePotato: actually, if you   ssh server command01:10
bodhi_zazenfirefox is an exception to this01:10
bodhi_zazenfirefox will run LOCAL01:10
HymnToLifeonly that command will be run on the server01:11
bodhi_zazenunless you tell it NOT to01:11
HymnToLifeyou won't get a prompt01:11
kklimondabodhi_zazen: why is that?01:11
bodhi_zazenit is the way they built firefox01:11
HymnToLifekklimonda: actually, the "firefox" command runs a shell script that in turn runs Firefox itself01:11
kklimondabodhi_zazen: is it ssh problem or generally X forwarding?01:11
kklimondaHymnToLife: and that's the reason?01:12
HymnToLifeso if you do that, you'll run the shell script that is on the server01:12
kklimondai see01:12
bodhi_zazenthis is a firefox problem kklimonda01:12
HymnToLifebut it will then run the firefox that is on the client01:12
HymnToLifekklimonda: see for example   gedit `which firefox`01:13
bodhi_zazenTry ssh server /usr/bin/firefox -p -no-remote01:13
bodhi_zazen:)01:13
HymnToLifethat's what is run when you type "firefox" at your prompt01:13
kklimondaHymnToLife: i thought that wrapper script will pass everything that is needed to firefox binary01:13
bodhi_zazenyou need to tell firefox -no-remote to run it on server and forward it back over ssh01:13
bodhi_zazenOK, if you run a ssh server, BE SURE YOU SECURE IT :)01:14
bodhi_zazenhttps://help.ubuntu.com/community/AdvancedOpenSSH01:14
HymnToLifeit is already fairly secure by default though01:14
bodhi_zazenshall I show you how to use keys ?01:14
kklimondabodhi_zazen: is it possible to disable login by password for some users?01:14
bodhi_zazenyou use a key pair to log onto the server, then disable password logins01:14
bodhi_zazenkklimonda: I do not think you can disable password logins per user01:15
MattJSSH is only as secure as the password you use (I learnt that the hard way)01:15
bodhi_zazenyou can do it for root01:15
bodhi_zazen+1 MattJ01:15
kklimondabodhi_zazen: i can set up that root and only root doesn't use password login?01:16
bodhi_zazenshall we demo a key ?01:16
HymnToLifekklimonda: yes, but it's really better to disable it altogether01:16
kklimondaHymnToLife: i know01:16
bodhi_zazenyes kklimonda01:16
kklimondaHymnToLife: but it is the case that I don't want to do it01:16
HymnToLifemay I ask why?01:16
bodhi_zazenI think it is AllowRootLogin nopassword01:16
bodhi_zazensomething like that01:16
bodhi_zazendo not let "nopassword" fool you01:16
bodhi_zazensee man sshd_config01:17
bodhi_zazenOK, everyone on my shared ssh session ?01:17
bodhi_zazenwant to see how to make a key ?01:17
kklimondaHymnToLife: other users doesn't use linux, configuring keys in putty isn't as easy, they don't want to do it.01:18
bodhi_zazenCommand : ssh-keygen -t rsa -b 4096 -f root01:18
bodhi_zazenenter your desired password01:18
bodhi_zazennow we have 2 files , root and root.pub01:19
bodhi_zazenwe transfer root.pub to the server01:19
kklimondabodhi_zazen: can I force password login by passing an argument to ssh ?01:19
kklimondai'd like to test PermitRootLogin without-password01:19
bodhi_zazeninto /root/.ssh/authorized_keys01:19
bodhi_zazenkklimonda: I can show you this ;)01:19
kklimondasure01:20
bodhi_zazenwatch in the session and we can config01:20
bodhi_zazenCommand : ssh-copy-id -i ./root.pub root@192.168.1.1401:21
bodhi_zazenthe command ssh-copy-id does all this for us automatically01:21
bodhi_zazennow let us ssh into server again ;)01:21
bodhi_zazenthat went by fast :)01:22
bodhi_zazensee we get 1 attempt w/ key, then if the wrong PW is entered, fall back to password ?01:22
bodhi_zazenlet us change that on the server :)01:22
bodhi_zazennow kklimonda :)01:23
bodhi_zazensee kklimonda , no log in w/o key :)01:24
bodhi_zazenbut with key :)01:24
bodhi_zazenlol01:24
kklimondabodhi_zazen: but what when I have key already on server, password already in seahorse cache and I want to simulate password login? :)01:24
kklimondacan I use -i /dev/null or something?01:24
kklimonda(i should check but if you are already here to poke... ;) )01:25
bodhi_zazenthat change will disable passwords :)01:25
bodhi_zazentest it out kklimonda :)01:25
bodhi_zazenOK , now a bit of security01:25
bodhi_zazenthe key from the server insures against a "man in the middle" attack01:26
bodhi_zazenlet us change the stored server key :)01:26
bodhi_zazenI changed the key01:26
bodhi_zazennow let us log in01:26
bodhi_zazenOH NO !!!01:27
bodhi_zazennow what everyone says , just delete ~/.ssh/known_hoses01:27
bodhi_zazen*hosts01:27
bodhi_zazenDO NOT DO THIS01:27
bodhi_zazenfirst  contact the sys admin on the server01:27
bodhi_zazenand make sure the keys changed01:27
bodhi_zazenwe know we changed the key01:27
bodhi_zazenso how to remove the key ?01:28
bodhi_zazeneasily ?01:28
bodhi_zazenwithout removing all your keys ?01:28
bodhi_zazenssh-keygen -R 192.168.1.1401:28
bodhi_zazennow watch :)01:28
bodhi_zazen>:)01:28
bodhi_zazeneasy as pie01:29
kklimondaindeed01:29
bodhi_zazennow ...01:29
bodhi_zazenwant to log in w/o entering a password ?01:29
bodhi_zazenuse ssh-agent / ssh-add01:29
bodhi_zazenNormally you use ssh-add in an X session01:29
bodhi_zazenie seahorse01:29
bodhi_zazenbut in a terminal ?01:29
bodhi_zazenCould not open a connection to your authentication agent.01:30
bodhi_zazenanyone know what to do in a terminal w/o X ?01:30
bodhi_zazen???01:30
HymnToLifeyup01:30
kklimondayou should tell about keys without password - it's still common to see it as a solution in some guides01:30
bodhi_zazenssh-agent bash01:30
bodhi_zazenor ssh-agent zsh01:30
HymnToLifethat's not how I do it01:31
HymnToLifeI have this in my crontab:01:31
HymnToLife@reboot ssh-agent -s | grep -v echo > $HOME/.ssh-agent01:31
bodhi_zazennow :)01:31
HymnToLifeand a   source ~/.ssh-agent01:31
HymnToLifein my .zshrc01:31
bodhi_zazenlol HymnToLife :)01:31
bodhi_zazensee, I ssh into server w/o entering a PW01:31
bodhi_zazenand look ma, no empty key :)01:32
bodhi_zazennow when I close the shell01:32
ibuclawhehe01:32
bodhi_zazenpassword is forgotten :)01:32
* ibuclaw is running a remote upgrade01:33
HymnToLifeI also have keyon/keyoff as aliases for ssh-add01:33
bodhi_zazenif you use ssh, you should look at screen01:33
HymnToLifeto just make it "forget" the pasphrase in one command01:33
HymnToLifeinstead of exitting the shell01:33
bodhi_zazenscreen allows you to run a command in the server, exit the ssh session, and the command keeps on running ;)01:34
bodhi_zazenwe shall save screen for another day ?01:34
kklimondabodhi_zazen: is you screen profile the same bundled with ubuntu screen package?01:34
bodhi_zazenhere is how to use putty :01:35
bodhi_zazenhttp://wiki.amahi.org/index.php/Key-based_SSH_Logins_With_Putty01:35
bodhi_zazenworks on windows and linux :)01:35
bodhi_zazenkklimonda: for this session it is01:35
bodhi_zazenOK, that is ssh 101 :)01:35
bodhi_zazenquestions ?01:35
kklimondai think you have answered all mine.01:36
kklimondathanks :)01:36
bodhi_zazennp :)01:36
bodhi_zazenI think there were some additional questions ?01:36
kklimondahmm.. weird.. i can't remove ssh key pass phase from seahorse cache01:37
kklimondaat least not from any gui01:37
bodhi_zazenI have not been a huge fan of seahorse :)01:38
bodhi_zazenyes it makes it easy, but if you want to change something it is a pain :(01:38
bodhi_zazenAny other questions on ssh ?01:39
kklimondanope01:39
bodhi_zazenand HymnToLife I made a rsa key "just for your" , lol01:39
bodhi_zazen*you01:39
bodhi_zazenI will hold another session in 2 weeks01:40
bodhi_zazensuggestions for topic ?01:40
kklimondaabout?01:40
kklimondaoh :)01:40
kklimondahmm.. screen magic would be nice01:40
kklimondaBut I won't be here probably01:40
bodhi_zazenscreen would be fun :)01:40
kklimondaor maybe..01:40
kklimondayeah01:40
bodhi_zazenother suggestions ?01:40
kklimondaI know some basics etc. but I know that screen has a lot of potential..01:40
bodhi_zazenkklimonda: http://www.pixelbeat.org/lkdb/screen.html01:41
bodhi_zazenhttp://blog.bodhizazen.net/linux/shared-ssh-sessions-update-for-jaunty-ubuntu-904/01:41
kklimondathanks for this post - i'll read it later.01:42
kklimondai was going to ask how you did it :)01:42
bodhi_zazen;)01:42
bodhi_zazenIt is a very nice, secure teaching tool ;)01:43
kklimondaexactly01:43
bodhi_zazenI had to open a few small holes to allow this session in fact ;)01:43
bodhi_zazenibuclaw: questions ?01:44
bodhi_zazenWastePotato: you ?01:44
ibuclawbodhi_zazen, not any from me...01:44
bodhi_zazenaww ...01:44
kklimondabodhi_zazen: why is apparmor policy modification needed?01:45
bodhi_zazenwhat ?01:46
bodhi_zazenyou mean why did I write an apparmor policy for the shared session ?01:46
kklimondaoh, i see - jailbash is used instead of rbash?01:46
ibuclawbodhi_zazen, I've actually not paid a great amount of attention. Just picked up the `ssh iain@192.168.1.8`, `ssh -X iain@192.168.1.4 gui-app`, `ssh-keygen -t rsa -b 4096 -f root` and `ssh-copy-id -i ./iain.pub iain@192.168.1.8` commands and have been playing about ever since ;)01:46
bodhi_zazennice ibuclaw01:47
bodhi_zazenjailzsh actually01:47
bodhi_zazenI can give out the guru key to members of the BT for teaching01:47
bodhi_zazenand this allows them to do a whole ton01:47
bodhi_zazenbut I restrict what they can do01:47
ibuclawsince I'm behind a router, and I don't plan on port forwarding, I don't think I need to look too deep into the security side... yet. But I've learnt something today, that's for sure ;)01:47
bodhi_zazenfor example, you still in the shared session ?01:48
bodhi_zazenwant to see a demo of apparmor ?01:48
kklimondano, i can login again01:48
ibuclawkklimonda, you can break out of rbash in less than 3 seconds01:48
bodhi_zazenkk01:48
kklimondaibuclaw: nice :)01:48
bodhi_zazenyou in ?01:48
kklimondayes01:48
bodhi_zazensee how I allow root access ?01:49
bodhi_zazenbut apparmor will restrict even root01:49
bodhi_zazen:)01:50
kklimondabodhi_zazen: btw.. there is a lot of discussion about apparmor vs. selinux - do you know what do ubuntu developers think about it?01:50
bodhi_zazensee how I restrict the access to the net w/ iptables01:50
kklimondayeh01:51
bodhi_zazenapparmor does not allow root to turn it off01:51
bodhi_zazenhe he he01:51
bodhi_zazennor read sshd-config, let alone change01:51
bodhi_zazenso I am resticting what this machine can do no my LAN01:52
bodhi_zazenI specifically allowed access to 192.168.1.14 for this session ;)01:52
kklimondaoh :)01:53
bodhi_zazensee, apparmor blocks access to .bashrc as well >:)01:53
bodhi_zazenlol01:53
bodhi_zazenand everyone likes that command :)01:54
kklimondathis one should be default :)01:54
bodhi_zazenthis shell ?01:54
kklimondanah, preventing rm -rf / ;)01:54
bodhi_zazenpreventing rm -rf /01:54
bodhi_zazenis default as of 8.1001:54
kklimondaoh? damn :)01:54
kklimondanice01:54
bodhi_zazenbut do not01:55
bodhi_zazenrm -rf /*01:55
bodhi_zazenlol01:55
kklimondait still works? :)01:55
bodhi_zazensee ?01:55
kklimondayes01:55
bodhi_zazen>:)01:55
bodhi_zazenshh, don't tell anyone01:55
kklimonda:D01:55
bodhi_zazenI like to see everyone's response when root is restricted by apparmor01:56
bodhi_zazenas you can see, it is not a "fake" root account01:56
bodhi_zazenuid = 001:56
bodhi_zazen3 min left01:57
bodhi_zazenquestions ?01:57
bodhi_zazenother things to see and do ?01:57
bodhi_zazenkklimonda: you still loged in ?01:57
kklimondayes01:57
bodhi_zazenwatch this :)01:57
bodhi_zazensee that command ?01:57
kklimonda*nods*01:58
kklimonda:)01:58
bodhi_zazensee what happened ?01:58
kklimondayup - nice feature01:58
bodhi_zazenif I am not running a shared session -> no guest log in01:58
bodhi_zazentry it01:58
bodhi_zazenmy iptables rules will block you for 10 min or so, nothing serious :)01:59
bodhi_zazengo ahead, hit it 3 times or so :p01:59
kklimonda;)01:59
kklimondabodhi_zazen: great job with this screen setup.02:00
kklimondaIt works great and looks nice :)02:00
kklimondaok, time for my02:00
kklimondagood night everyone02:00
bodhi_zazenthanks kklimonda :)02:01
bodhi_zazenthank  you all for coming :)02:05
WastePotatoo/02:10
WastePotatoDamn. Missed half of it. I'll read the scrollback. :S02:11
=== serverchen is now known as javapi
=== notLight is now known as Light-
=== kenny is now known as Guest91775
=== iTroll is now known as WastePotato
=== kenny is now known as Guest20760
=== Guest20760 is now known as KennyM
=== kenny is now known as KennyM

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!