Set up expansion EEPROM i2c-2 BeagleBoneBlack Rev-C - beagleboneblack

The BeagleBoneBlack comes with an "internal" EEPROM connected to i2c-0 line. I can see that clearly when I do i2cdetect:
debian#beaglebone:~$ i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: UU -- -- -- -- -- -- --
It is showing under address 0x50. When I try to do ahexdump I get the following values with no issue:
sudo hexdump -C /sys/class/i2c-dev/i2c-0/device/0-0050/eeprom | head -5
00000000 aa 55 33 ee 41 33 33 35 42 4e 4c 54 30 30 30 43 |.U3.A335BNLT000C|
00000010 31 38 33 37 42 42 42 47 30 36 32 32 ff ff ff ff |1837BBBG0622....|
00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00001000 aa 55 33 ee 41 33 33 35 42 4e 4c 54 30 30 30 43 |.U3.A335BNLT000C|
Now I want to add another EEPROM (with cape) on i2c-2 line which is supported according to BBB SRM section 8.2. It is the CAT24C256 as mentioned in the SRM. The allowable address range for the expansion cards is 0x54-0x57. When I do i2cdetect I can see the following:
debian#beaglebone:~$ i2cdetect -r -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I can see the addresses 0x54-0x57 showing, but when I try hex dump I get an error:
hexdump: /sys/class/i2c-dev/i2c-2/device/2-0054/eeprom: Connection timed out
Questions:
Why are they showing as U's not actual address numbers? I know U stands for used resource?
Why am I failing to read from that EEPROM? I have tried all addreses from 0x54-0x57 with no luck. I can confirm that those addresses are showing in /sys/class/i2c-dev/i2c-2/device and the each dir has the following in it:
debian#beaglebone:~$ ls /sys/class/i2c-dev/i2c-2/device/2-0054/ -la
total 0
drwxr-xr-x 4 root root 0 Oct 26 19:46 .
drwxr-xr-x 8 root root 0 Oct 26 19:46 ..
drwxr-xr-x 3 root root 0 Oct 26 19:47 2-00540
lrwxrwxrwx 1 root root 0 Oct 26 19:47 driver -> ../../../../../../bus/i2c/drivers/at24
-rw------- 1 root root 32768 Oct 26 19:47 eeprom
-r--r--r-- 1 root root 4096 Oct 26 19:47 modalias
-r--r--r-- 1 root root 4096 Oct 26 19:47 name
lrwxrwxrwx 1 root root 0 Oct 26 19:47 of_node -> ../../../../../../firmware/devicetree/base/ocp/i2c#4819c000/cape_eeprom0#54
drwxr-xr-x 2 root root 0 Oct 26 19:47 power
lrwxrwxrwx 1 root root 0 Oct 26 19:47 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Oct 26 19:47 uevent
I can see the addresses mapping into the kernel but when I try to hexdump eeprom it doesn't work at all. I though this was supposed to be setup by kernel since it is mentioned in BeagleBone SRM. Am I going to need an overlay to add to uboot for this?
All I'm trying to do is read from the EEPROM like I did with the "internal" one to confirm it is working. What am I doing wrong?

The issue was that the cape manager was "hogging" those addresses on i23c-2. We will need to disable the cape manager in order to free those addresses. After doing that it shows 0x57 under i2c-2 so it should work afterwards.
Please checkout the following link as to how to disable Cape Manager on BeagleBone:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/beagleboard/NG8cDWuv2Y0/69vk5F5ZAgAJ)
Make sure to edit the am335x-boneblack-uboot.dts file remove the include on line 11 and replace with the following:
#include "am335x-bone-common-no-capemgr.dtsi"
Note this will disable your i2c-2 line by default so either enable it via overlays or edit the am335x-bone-common-no-capemgr.dtsi & add after &i2c0 (around line 245):
&i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pins>;
status = "okay";
clock-frequency = <100000>;
};

Related

WiFi not working in Ubuntu20 on MacBookPro 13 (2020), dual booting, trinidad wifi drivers issue

After purchasing new equipment which is MacBook Pro 13
Catalina 10.15.7
4 x USB-C
release year: 2020
model 16,2
I decided to install Ubuntu 20 as dual boot.
Previously I installed Ubuntu from raw .iso but it has created too many problems with drivers:
keyboard
touchpad
WIFI !
Then I came across to ready .ISO Image dedicated for MacBooks generally - https://github.com/marcosfad/mbp-ubuntu
While I was reading the article, I found mention about not working WiFi with MBP 16,1 (I was hoping on 16,2 is working)... after Ubuntu installed I noticed WiFi problem (no adapters detected) - this is where hell began...
I tried several ways to solve this problem (mainly mentioned below) - unsuccessfully.
ioreg -l | grep C-4364 | tr "|" "\n"
"RequestedFiles" = ({"Firmware"="C-4364__s-B3/trinidad.trx","TxCap"="C-4364__s-B3/trinidad-X0.txcb","Regulatory"="C-4364__s-B3/trinidad-X0.clmb","NVRAM"="C-4364__s-B3/P-trinidad-X0_M-HRPN_V-u__m-7.7.txt"})
"images" = {"C-4364__s-B3/trinidad.trx"={"imagetype"="Firmware","required"=Yes,"imagename"="C-4364__s-B3/trinidad.trx"},"C-4364__s-B3/trinidad-X0.clmb"={"imagetype"="Regulatory","required"=Yes,"imagename"="C-4364__s-B3/trinidad-X0.clmb"},"C-4364__s-B3/trinidad-X0.txcb"={"imagetype"="TxCap","required"=No,"imagename"="C-4364__s-B3/trinidad-X0.txcb"},"C-4364__s-B3/P-trinidad-X0_M-HRPN_V-u__m-7.7.txt"={"imagetype"="NVRAM","required"=Yes,"imagename"="C-4364__s-B3/P-trinidad-X0_M-HRPN_V-u__m-7.7.txt"}}
ls -la /usr/share/firmware/wifi/C-4364__s-B3 | grep "trinidad"
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-ID_M-HRPN_V-m__m-7.9.txt -> P-trinidad_M-HRPN_V-m__m-7.9.txt
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-ID_M-HRPN_V-u__m-7.7.txt -> P-trinidad_M-HRPN_V-u__m-7.7.txt
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-X0_M-HRPN_V-m__m-7.9.txt -> P-trinidad_M-HRPN_V-m__m-7.9.txt
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-X0_M-HRPN_V-u__m-7.7.txt -> P-trinidad_M-HRPN_V-u__m-7.7.txt
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-X2_M-HRPN_V-m__m-7.9.txt -> P-trinidad_M-HRPN_V-m__m-7.9.txt
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-X2_M-HRPN_V-u__m-7.7.txt -> P-trinidad_M-HRPN_V-u__m-7.7.txt
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-X3_M-HRPN_V-m__m-7.9.txt -> P-trinidad_M-HRPN_V-m__m-7.9.txt
lrwxr-xr-x 1 root wheel 32 28 maj 03:46 P-trinidad-X3_M-HRPN_V-u__m-7.7.txt -> P-trinidad_M-HRPN_V-u__m-7.7.txt
-rw-r--r-- 1 root wheel 12950 1 wrz 07:05 P-trinidad_M-HRPN_V-m__m-7.9.txt
-rw-r--r-- 1 root wheel 12891 1 wrz 07:05 P-trinidad_M-HRPN_V-u__m-7.7.txt
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-ID.clmb -> trinidad.clmb
lrwxr-xr-x 1 root wheel 12 28 maj 03:46 trinidad-ID.trx -> trinidad.trx
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-ID.txcb -> trinidad.txcb
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-X0.clmb -> trinidad.clmb
lrwxr-xr-x 1 root wheel 12 28 maj 03:46 trinidad-X0.trx -> trinidad.trx
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-X0.txcb -> trinidad.txcb
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-X2.clmb -> trinidad.clmb
lrwxr-xr-x 1 root wheel 12 28 maj 03:46 trinidad-X2.trx -> trinidad.trx
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-X2.txcb -> trinidad.txcb
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-X3.clmb -> trinidad.clmb
lrwxr-xr-x 1 root wheel 12 28 maj 03:46 trinidad-X3.trx -> trinidad.trx
lrwxr-xr-x 1 root wheel 13 28 maj 03:46 trinidad-X3.txcb -> trinidad.txcb
-rw-r--r-- 1 root wheel 35322 9 kwi 2020 trinidad.clmb
lrwxr-xr-x 1 root wheel 10 2 paź 15:17 trinidad.trx -> borneo.trx
-rw-r--r-- 1 root wheel 723 9 kwi 2020 trinidad.txcb
I found a few similar issues like my:
https://github.com/mikeeq/mbp-fedora-kernel/issues/3
https://vinodhsblog.co.za/ubuntu-20-04-lts-on-a-macbook-pro/
Using this repo from article above to move drivers from MacOs to Ubuntu side https://github.com/stefanpartheym/mbp15-wifi-driver
https://github.com/Dunedan/mbp-2016-linux/issues/112
After moving drivers from MacOS to Ubuntu and configured followed by articles and people advices WiFi not working whole time... The last important log about wifi drivers from dmesg:
brcmf_pcie_download_fw_nvram: FW failed to initialize
Can you help me with this issue?
I have an exactly same model (16,2) of MacBookPro as yours, which has Broadcom 4364 v3 (rev 04). You can download the driver of Wifi and Bluetooth from
https://github.com/j3ffyang/mbp-fedora/tree/main/brcm
and place them at /lib/firmware/brcm, then execute sudo modprobe -r brcmfmac && sudo modprobe brcmfmac
This solution has been tested on Ubuntu 20.04 and Fedora 35 both.

Using Lua package (LuaSocket) with HAProxy

I have installed HAProxy with Lua 5.3.1, and also LuaSocket.
I have LUA_PATH and LUA_CPATH defined:
export LUA_PATH="/usr/local/share/lua/5.3/?.lua;?.lua"
export LUA_CPATH="/usr/local/lib/lua/5.3/?.so;?.so"
and I'm using LuaSocket in my .lua file
core.register_fetches("myfunc", function(txn)
...
local http = require("socket.http")
r, e = http.request("http://localhost:5001/api/Registry/")
however I can see from journalctl -xe that it isn't working
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: [ALERT] 344/232733 (16734) : Lua sample-fetch 'myfunc': runtime error: /home/ubuntu/haproxy-mapping.lua:12: module 'socket.http' not found:
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no field package.preload['socket.http']
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/share/lua/5.3/socket/http.lua'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/share/lua/5.3/socket/http/init.lua'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/lib/lua/5.3/socket/http.lua'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/lib/lua/5.3/socket/http/init.lua'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file './socket/http.lua'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file './socket/http/init.lua'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/lib/lua/5.3/socket/http.so'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/lib/lua/5.3/loadall.so'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file './socket/http.so'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/lib/lua/5.3/socket.so'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file '/usr/local/lib/lua/5.3/loadall.so'
Dec 11 23:27:33 ip-172-31-5-92 haproxy[16731]: no file './socket.so' from [C] global 'require', /home/ubuntu/haproxy-mapping.lua:12 C function line 4.
I'm surprised that it cannot find /usr/local/share/lua/5.3/socket/http.lua because it's there:
me$ ls -l /usr/local/share/lua/5.3/socket
total 56
-rw-r--r-- 1 root root 10640 Dec 11 21:31 ftp.lua
-rw-r--r-- 1 root root 3698 Dec 11 21:31 headers.lua
-rw-r--r-- 1 root root 14588 Dec 11 21:31 http.lua
-rw-r--r-- 1 root root 8074 Dec 11 21:31 smtp.lua
-rw-r--r-- 1 root root 3766 Dec 11 21:31 tp.lua
-rw-r--r-- 1 root root 11675 Dec 11 21:31 url.lua
It is saying
no file './socket.so' from [C] global 'require', /home/ubuntu/haproxy-mapping.lua:12 C function line 4.
is that the core of the issue? There is no socket.so on the machine
Update: forgot to mention that I can use LuaSocket from Lua directly, just not when it's embedded in HAProxy.
Update 2: I suspect permissions. I ran strace on it and found
open("/usr/local/share/lua/5.3/socket/http.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
and I know that haproxy is running as the user haproxy
me :/usr/local/share/lua/5.3/socket$ ps -o user= -p 3273
haproxy
and yet if I switch user to haproxy I can read the file
me :/usr/local/share/lua/5.3/socket$ su - haproxy
Password:
No directory, logging in with HOME=/
$ more /usr/local/share/lua/5.3/socket/http.lua
...listing...
and I also changed owner of the http.lua file to haproxy and it still can't open the file.
I can only assume this is something to do with the context that the Lua function runs with-in when it is called, because changing the code to
local http = require("socket.http")
core.register_fetches("myfunc", function(txn)
...
worked.
UPDATE: according to this https://www.arpalert.org/src/haproxy-lua-api/1.7/index.html during initialization you can DNS lookups but in runtime mode you cannot. It doesn't say anything about files but it seems reasonable to believe you can't do files either.

I need to know how to write my manifest.json file to deploy my application on oracle

Initialized application creation...
Acquired resources for instance(2G) web.1...
Acquired resources for instance(2G) web.2...
Failed to deploy application(v1) for instance(2G) web.1...
Application is not running. Following are application logs 2018-03-29T00:59:27.429357+00:00 ACCS[web.1]: drwxr-xr-x 1 apaas apaas 46 Mar 29 00:58 .....
2018-03-29T00:59:27.430904+00:00 ACCS[web.1]: Starting application with launch command [ ruby app.rb ]
2018-03-29T00:59:27.466311+00:00 APP[web.1]: ruby: No such file or directory -- app.rb (LoadError)
2018-03-29T00:59:40.674751+00:00 ACCS[web.1]: "Content of APP_HOME [ /u01/app ] dir "
2018-03-29T00:59:40.676669+00:00 ACCS[web.1]: total 0
2018-03-29T00:59:40.676752+00:00 ACCS[web.1]: drwxr-xr-x 1 apaas apaas 192 Mar 28 02:31 bitview
2018-03-29T00:59:40.676804+00:00 ACCS[web.1]: drwxr-xr-x 1 apaas apaas 14 Mar 29 00:58 .
2018-03-29T00:59:40.676878+00:00 ACCS[web.1]: drwxr-xr-x 1 apaas apaas 46 Mar 29 00:58 ..
2018-03-29T00:59:40.678051+00:00 ACCS[web.1]: Starting application with launch command [ ruby app.rb ]
2018-03-29T00:59:40.713732+00:00 APP[web.1]: ruby: No such file or directory -- app.rb (LoadError)
Log-URL: [https://gse00014896.us.storage.oraclecloud.com/v1/Storage-gse00014896/_apaas/testrun/logsV2/4157996400_web.1_538e60cd_2018-03-29-010000_cust_server.out.zip]
App Summary - Name:[testrun], Identity domain: [idcs-f2b25b3358db4bd7a23ab81ff93845e1], Service Entitlement:[595583085], Compute Site:[US006_Z55]
For the complete application log, refer to log URL
Failed to deploy application(v1) for instance(2G) web.2...
Application is not running. Following are application logs 2018-03-29T00:59:26.758054+00:00 ACCS[web.2]: drwxr-xr-x 1 apaas apaas 46 Mar 29 00:58 .....
2018-03-29T00:59:26.759390+00:00 ACCS[web.2]: Starting application with launch command [ ruby app.rb ]
2018-03-29T00:59:26.794616+00:00 APP[web.2]: ruby: No such file or directory -- app.rb (LoadError)
2018-03-29T00:59:39.974943+00:00 ACCS[web.2]: "Content of APP_HOME [ /u01/app ] dir "
2018-03-29T00:59:39.977470+00:00 ACCS[web.2]: total 0
2018-03-29T00:59:39.977618+00:00 ACCS[web.2]: drwxr-xr-x 1 apaas apaas 192 Mar 28 02:31 bitview
2018-03-29T00:59:39.977749+00:00 ACCS[web.2]: drwxr-xr-x 1 apaas apaas 14 Mar 29 00:58 .
2018-03-29T00:59:39.977890+00:00 ACCS[web.2]: drwxr-xr-x 1 apaas apaas 46 Mar 29 00:58 ..
2018-03-29T00:59:39.979596+00:00 ACCS[web.2]: Starting application with launch command [ ruby app.rb ]
2018-03-29T00:59:40.015352+00:00 APP[web.2]: ruby: No such file or directory -- app.rb (LoadError)
App Summary - Name:[testrun], Identity domain: [idcs-f2b25b3358db4bd7a23ab81ff93845e1], Service Entitlement:[595583085], Compute Site:[US006_Z55]
For the complete application log, refer to log URL
Log-URL: [https://gse00014896.us.storage.oraclecloud.com/v1/Storage-gse00014896/_apaas/testrun/logsV2/4157996401_web.2_b475cb31_2018-03-29-005959_cust_server.out.zip]
Failed to create application...
For a basic app you don't need much, there's an example here
http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/apaas/ruby/ruby-getting-started/ruby-getting-started.html
{
"runtime":{
"majorVersion":"2.4.1"
},
"command": "ruby app.rb",
"release": {},
"notes": "Ruby Hello World"
}
substitute app.rb with whatever the name of your main file is.
What you can do if you need to install gems or something is call a shell script instead with sh start.sh and (in the same directory) have a shell file like so
#!/bin/env sh
gem install rails
ruby app.rb
I hope this helps! :smiley:

Rails 4 / Capistrano 3 Deployment Stopped Working (no errors)

I built my first Rails app and am running production off a home server. Capistrano 3 worked for about a month and now it just stopped deploying. When I run cap production deploy, my app does not change on the server. It uploads my git-ssh.sh file to the root temp directory, then exits "successfully". I haven't changed anything except modifying some html since it was originally working.
My remote repo is on bitbucket and has the latest commits. I can go as far as commenting out the :repo_url in deploy.rb and not have an error.
Since there isn't an error and since I am a newb, I have a feeling that this is a very general behavior and I have overlooked something small. Any ideas?
Normal Output:
INFO [38ef66f0] Running /usr/bin/env mkdir -p /tmp/PATH/ on MYSERVER.com
INFO [38ef66f0] Finished in 1.571 seconds with exit status 0 (successful).
INFO Uploading /tmp/PATH/git-ssh.sh 100.0%
INFO [aae6143c] Running /usr/bin/env chmod +x /tmp/PATH/git-ssh.sh on MYSERVER.com
INFO [aae6143c] Finished in 0.109 seconds with exit status 0 (successful).
Verbose Output:
INFO [b15bb422] Running /usr/bin/env mkdir -p /tmp/PATH/ on MYSERVER.com
D, [TIME:14.310370] DEBUG -- net.ssh.transport.session[SESSION]: establishing connection to MYSERVER.com:PORT
D, [TIME:14.814878] DEBUG -- net.ssh.transport.session[SESSION]: connection established
I, [TIME:14.815000] INFO -- net.ssh.transport.server_version[VERSION]: negotiating protocol version
D, [TIME:14.882919] DEBUG -- net.ssh.transport.server_version[VERSION]: remote is `SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1'
D, [TIME:14.883020] DEBUG -- net.ssh.transport.server_version[VERSION]: local is `SSH-2.0-Ruby/Net::SSH_2.7.0 x86_64-darwin12.3.0'
D, [TIME:14.934561] DEBUG -- tcpsocket[SOCKET]: read 984 bytes
D, [TIME:14.934662] DEBUG -- tcpsocket[SOCKET]: received packet nr 0 type 20 len 980
I, [TIME:14.934719] INFO -- net.ssh.transport.algorithms[ALGORITHMS]: got KEXINIT from server
I, [TIME:14.934810] INFO -- net.ssh.transport.algorithms[ALGORITHMS]: sending KEXINIT
D, [TIME:14.934914] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 0 type 20 len 1620
D, [TIME:14.934974] DEBUG -- tcpsocket[SOCKET]: sent 1624 bytes
I, [TIME:14.934999] INFO -- net.ssh.transport.algorithms[ALGORITHMS]: negotiating algorithms
D, [TIME:14.935071] DEBUG -- net.ssh.transport.algorithms[ALGORITHMS]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-sha1
* hmac_server: hmac-sha1
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [TIME:14.935093] DEBUG -- net.ssh.transport.algorithms[ALGORITHMS]: exchanging keys
D, [TIME:14.935202] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 1 type 34 len 20
D, [TIME:14.935238] DEBUG -- tcpsocket[SOCKET]: sent 24 bytes
D, [TIME:15.035995] DEBUG -- tcpsocket[SOCKET]: read 152 bytes
D, [TIME:15.036218] DEBUG -- tcpsocket[SOCKET]: received packet nr 1 type 31 len 148
D, [TIME:15.038033] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 2 type 32 len 140
D, [TIME:15.038149] DEBUG -- tcpsocket[SOCKET]: sent 144 bytes
D, [TIME:15.113155] DEBUG -- tcpsocket[SOCKET]: read 720 bytes
D, [TIME:15.113304] DEBUG -- tcpsocket[SOCKET]: received packet nr 2 type 33 len 700
D, [TIME:15.114762] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 3 type 21 len 20
D, [TIME:15.114857] DEBUG -- tcpsocket[SOCKET]: sent 24 bytes
D, [TIME:15.114923] DEBUG -- tcpsocket[SOCKET]: received packet nr 3 type 21 len 12
D, [TIME:15.115172] DEBUG -- net.ssh.authentication.session[SESSION]: beginning authentication of `USER'
D, [TIME:15.115267] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 4 type 5 len 28
D, [TIME:15.115315] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:15.245792] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:15.246035] DEBUG -- tcpsocket[SOCKET]: received packet nr 4 type 6 len 28
D, [TIME:15.246215] DEBUG -- net.ssh.authentication.session[SESSION]: trying publickey
D, [TIME:15.246510] DEBUG -- net.ssh.authentication.agent[AGENT]: connecting to ssh-agent
D, [TIME:15.246633] DEBUG -- net.ssh.authentication.agent[AGENT]: sending agent request 1 len 51
D, [TIME:15.246750] DEBUG -- net.ssh.authentication.agent[AGENT]: received agent packet 2 len 5
D, [TIME:15.246801] DEBUG -- net.ssh.authentication.agent[AGENT]: sending agent request 11 len 0
D, [TIME:15.246921] DEBUG -- net.ssh.authentication.agent[AGENT]: received agent packet 12 len 5
D, [TIME:15.247091] DEBUG -- net.ssh.authentication.methods.publickey[PUBKEY]: trying publickey
D, [TIME:15.247242] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 5 type 50 len 348
D, [TIME:15.247341] DEBUG -- tcpsocket[SOCKET]: sent 372 bytes
D, [TIME:15.298246] DEBUG -- tcpsocket[SOCKET]: read 324 bytes
D, [TIME:15.298404] DEBUG -- tcpsocket[SOCKET]: received packet nr 5 type 60 len 300
D, [TIME:15.300524] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 6 type 50 len 620
D, [TIME:15.300583] DEBUG -- tcpsocket[SOCKET]: sent 644 bytes
D, [TIME:15.347646] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:15.347769] DEBUG -- tcpsocket[SOCKET]: received packet nr 6 type 52 len 12
D, [TIME:15.347829] DEBUG -- net.ssh.authentication.methods.publickey[PUBKEY]: publickey succeeded
D, [TIME:15.348064] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 7 type 90 len 44
D, [TIME:15.348175] DEBUG -- tcpsocket[SOCKET]: sent 68 bytes
D, [TIME:15.928356] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:15.928650] DEBUG -- tcpsocket[SOCKET]: received packet nr 7 type 91 len 28
I, [TIME:15.928842] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 0 0 0 32768
I, [TIME:15.928956] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "auth-agent-req#openssh.com"
D, [TIME:15.929074] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 8 type 98 len 44
I, [TIME:15.929227] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "env"
D, [TIME:15.929324] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 9 type 98 len 44
I, [TIME:15.929511] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "exec"
D, [TIME:15.929607] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 10 type 98 len 76
D, [TIME:15.929751] DEBUG -- tcpsocket[SOCKET]: sent 236 bytes
D, [TIME:15.974678] DEBUG -- tcpsocket[SOCKET]: read 124 bytes
D, [TIME:15.974830] DEBUG -- tcpsocket[SOCKET]: received packet nr 8 type 99 len 12
I, [TIME:15.974895] INFO -- net.ssh.connection.session[SESSION]: channel_success: 0
D, [TIME:15.974950] DEBUG -- net.ssh.service.forward[FORWARD]: authentication agent forwarding is active
D, [TIME:15.975012] DEBUG -- tcpsocket[SOCKET]: received packet nr 9 type 93 len 28
I, [TIME:15.975052] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 0 +2097152
D, [TIME:15.975111] DEBUG -- tcpsocket[SOCKET]: received packet nr 10 type 99 len 12
I, [TIME:15.975145] INFO -- net.ssh.connection.session[SESSION]: channel_success: 0
D, [TIME:15.980283] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:15.980403] DEBUG -- tcpsocket[SOCKET]: received packet nr 11 type 96 len 12
I, [TIME:15.980455] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 0
D, [TIME:15.985198] DEBUG -- tcpsocket[SOCKET]: read 104 bytes
D, [TIME:15.985276] DEBUG -- tcpsocket[SOCKET]: received packet nr 12 type 98 len 44
I, [TIME:15.985337] INFO -- net.ssh.connection.session[SESSION]: channel_request: 0 exit-status false
INFO [b15bb422] Finished in 1.677 seconds with exit status 0 (successful).
D, [TIME:15.985583] DEBUG -- tcpsocket[SOCKET]: received packet nr 13 type 97 len 12
I, [TIME:15.985633] INFO -- net.ssh.connection.session[SESSION]: channel_close: 0
D, [TIME:15.985706] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 11 type 97 len 28
D, [TIME:15.985916] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 12 type 90 len 44
D, [TIME:15.986043] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.029662] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.029837] DEBUG -- tcpsocket[SOCKET]: received packet nr 14 type 91 len 28
I, [TIME:16.029900] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 1 2 0 32768
I, [TIME:16.030024] INFO -- net.ssh.connection.channel[3fdef9deb620]: sending channel request "env"
D, [TIME:16.030116] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 13 type 98 len 44
I, [TIME:16.030238] INFO -- net.ssh.connection.channel[3fdef9deb620]: sending channel request "exec"
D, [TIME:16.030309] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 14 type 98 len 76
D, [TIME:16.030389] DEBUG -- tcpsocket[SOCKET]: sent 168 bytes
D, [TIME:16.075046] DEBUG -- tcpsocket[SOCKET]: read 88 bytes
D, [TIME:16.075278] DEBUG -- tcpsocket[SOCKET]: received packet nr 15 type 93 len 28
I, [TIME:16.075359] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 1 +2097152
D, [TIME:16.075448] DEBUG -- tcpsocket[SOCKET]: received packet nr 16 type 99 len 12
I, [TIME:16.075501] INFO -- net.ssh.connection.session[SESSION]: channel_success: 1
D, [TIME:16.081736] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.081907] DEBUG -- tcpsocket[SOCKET]: received packet nr 17 type 94 len 28
I, [TIME:16.081982] INFO -- net.ssh.connection.session[SESSION]: channel_data: 1 1b
D, [TIME:16.082185] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 15 type 94 len 44
D, [TIME:16.082273] DEBUG -- tcpsocket[SOCKET]: sent 68 bytes
D, [TIME:16.136866] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.137045] DEBUG -- tcpsocket[SOCKET]: received packet nr 18 type 94 len 28
I, [TIME:16.137113] INFO -- net.ssh.connection.session[SESSION]: channel_data: 1 1b
INFO Uploading /tmp/PATH/git-ssh.sh 100.0%
D, [TIME:16.137318] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 16 type 94 len 108
D, [TIME:16.137408] DEBUG -- tcpsocket[SOCKET]: sent 132 bytes
D, [TIME:16.137514] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 17 type 94 len 28
D, [TIME:16.137574] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:16.258376] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.258656] DEBUG -- tcpsocket[SOCKET]: received packet nr 19 type 94 len 28
I, [TIME:16.258789] INFO -- net.ssh.connection.session[SESSION]: channel_data: 1 1b
D, [TIME:16.258974] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 18 type 96 len 28
D, [TIME:16.259094] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:16.303592] DEBUG -- tcpsocket[SOCKET]: read 140 bytes
D, [TIME:16.303733] DEBUG -- tcpsocket[SOCKET]: received packet nr 20 type 96 len 12
I, [TIME:16.303788] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 1
D, [TIME:16.303861] DEBUG -- tcpsocket[SOCKET]: received packet nr 21 type 98 len 44
I, [TIME:16.303907] INFO -- net.ssh.connection.session[SESSION]: channel_request: 1 exit-status false
D, [TIME:16.303966] DEBUG -- tcpsocket[SOCKET]: received packet nr 22 type 97 len 12
I, [TIME:16.304003] INFO -- net.ssh.connection.session[SESSION]: channel_close: 1
D, [TIME:16.304068] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 19 type 97 len 28
INFO [265118f7] Running /usr/bin/env chmod +x /tmp/PATH/git-ssh.sh on MYSERVER.com
D, [TIME:16.304365] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 20 type 90 len 44
D, [TIME:16.312579] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.354938] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.355150] DEBUG -- tcpsocket[SOCKET]: received packet nr 23 type 91 len 28
I, [TIME:16.355235] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 2 0 0 32768
I, [TIME:16.355389] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "env"
D, [TIME:16.355501] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 21 type 98 len 44
I, [TIME:16.355650] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "exec"
D, [TIME:16.355734] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 22 type 98 len 76
D, [TIME:16.355856] DEBUG -- tcpsocket[SOCKET]: sent 168 bytes
D, [TIME:16.401684] DEBUG -- tcpsocket[SOCKET]: read 88 bytes
D, [TIME:16.401888] DEBUG -- tcpsocket[SOCKET]: received packet nr 24 type 93 len 28
I, [TIME:16.401970] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 2 +2097152
D, [TIME:16.402037] DEBUG -- tcpsocket[SOCKET]: received packet nr 25 type 99 len 12
I, [TIME:16.402070] INFO -- net.ssh.connection.session[SESSION]: channel_success: 2
D, [TIME:16.409522] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:16.409723] DEBUG -- tcpsocket[SOCKET]: received packet nr 26 type 96 len 12
I, [TIME:16.409811] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 2
D, [TIME:16.409866] DEBUG -- tcpsocket[SOCKET]: read 104 bytes
D, [TIME:16.409916] DEBUG -- tcpsocket[SOCKET]: received packet nr 27 type 98 len 44
I, [TIME:16.409960] INFO -- net.ssh.connection.session[SESSION]: channel_request: 2 exit-status false
INFO [265118f7] Finished in 0.106 seconds with exit status 0 (successful).
D, [TIME:16.410112] DEBUG -- tcpsocket[SOCKET]: received packet nr 28 type 97 len 12
I, [TIME:16.410144] INFO -- net.ssh.connection.session[SESSION]: channel_close: 2
D, [TIME:16.410203] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 23 type 97 len 28
D, [TIME:16.424746] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 24 type 90 len 44
D, [TIME:16.435241] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.476281] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.476476] DEBUG -- tcpsocket[SOCKET]: received packet nr 29 type 91 len 28
I, [TIME:16.476569] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 3 2 0 32768
I, [TIME:16.476736] INFO -- net.ssh.connection.channel[3fdefac6f7f0]: sending channel request "env"
D, [TIME:16.476833] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 25 type 98 len 44
I, [TIME:16.477009] INFO -- net.ssh.connection.channel[3fdefac6f7f0]: sending channel request "exec"
D, [TIME:16.477088] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 26 type 98 len 172
D, [TIME:16.477186] DEBUG -- tcpsocket[SOCKET]: sent 264 bytes
D, [TIME:16.521258] DEBUG -- tcpsocket[SOCKET]: read 88 bytes
D, [TIME:16.521526] DEBUG -- tcpsocket[SOCKET]: received packet nr 30 type 93 len 28
I, [TIME:16.521663] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 3 +2097152
D, [TIME:16.521816] DEBUG -- tcpsocket[SOCKET]: received packet nr 31 type 99 len 12
I, [TIME:16.521879] INFO -- net.ssh.connection.session[SESSION]: channel_success: 3
D, [TIME:16.945782] DEBUG -- tcpsocket[SOCKET]: read 68 bytes
D, [TIME:16.946049] DEBUG -- tcpsocket[SOCKET]: received packet nr 32 type 90 len 44
I, [TIME:16.946157] INFO -- net.ssh.connection.session[SESSION]: channel open auth-agent#openssh.com
I, [TIME:16.946343] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "env"
D, [TIME:16.946458] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 27 type 98 len 44
I, [TIME:16.946576] INFO -- net.ssh.service.forward[FORWARD]: opening auth-agent channel
D, [TIME:16.946641] DEBUG -- net.ssh.authentication.agent[AGENT]: connecting to ssh-agent
D, [TIME:16.946758] DEBUG -- net.ssh.authentication.agent[AGENT]: sending agent request 1 len 51
D, [TIME:16.946886] DEBUG -- net.ssh.authentication.agent[AGENT]: received agent packet 2 len 5
D, [TIME:16.947073] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 28 type 91 len 28
D, [TIME:16.947252] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.990720] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.990882] DEBUG -- tcpsocket[SOCKET]: received packet nr 33 type 94 len 28
I, [TIME:16.990963] INFO -- net.ssh.connection.session[SESSION]: channel_data: 4 5b
D, [TIME:16.991002] DEBUG -- net.ssh.service.forward[FORWARD]: data:5 on agent forwarded channel
D, [TIME:16.991282] DEBUG -- unixsocket[SOCKET]: sent 5 bytes
D, [TIME:16.991351] DEBUG -- unixsocket[SOCKET]: read 9 bytes
D, [TIME:16.991412] DEBUG -- net.ssh.connection.channel[CHANNEL]: read 9 bytes from client, sending over agent forwarded connection
D, [TIME:16.991489] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 29 type 94 len 28
D, [TIME:16.991555] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:17.066021] DEBUG -- tcpsocket[SOCKET]: read 84 bytes
D, [TIME:17.066253] DEBUG -- tcpsocket[SOCKET]: received packet nr 34 type 95 len 60
I, [TIME:17.066392] INFO -- net.ssh.connection.session[SESSION]: channel_extended_data: 3 1 32b
D, [TIME:17.068527] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:17.068733] DEBUG -- tcpsocket[SOCKET]: received packet nr 35 type 96 len 12
I, [TIME:17.068798] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 4
D, [TIME:17.068855] DEBUG -- net.ssh.service.forward[FORWARD]: eof agent on agent forwarded channel
D, [TIME:17.068945] DEBUG -- tcpsocket[SOCKET]: read 240 bytes
D, [TIME:17.069009] DEBUG -- tcpsocket[SOCKET]: received packet nr 36 type 95 len 76
I, [TIME:17.069067] INFO -- net.ssh.connection.session[SESSION]: channel_extended_data: 3 1 43b
D, [TIME:17.069151] DEBUG -- tcpsocket[SOCKET]: received packet nr 37 type 98 len 44
I, [TIME:17.069207] INFO -- net.ssh.connection.session[SESSION]: channel_request: 3 exit-status false
D, [TIME:17.069293] DEBUG -- tcpsocket[SOCKET]: received packet nr 38 type 96 len 12
I, [TIME:17.069335] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 3
D, [TIME:17.069397] DEBUG -- tcpsocket[SOCKET]: received packet nr 39 type 97 len 12
I, [TIME:17.069455] INFO -- net.ssh.connection.session[SESSION]: channel_close: 3
D, [TIME:17.069539] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 30 type 97 len 28
Not that anyone was following, but for the record:
My issue was that I had just set up a github key for other reasons since my last deployment. In doing so, a github_rsa.pub file was created in my .ssh directory. Apparently that made my id_rsa.pub no longer locally known, so Capistrano wasn't sending any of my keys to the server and not getting any errors back.
To fix it, I simply had to run ssh-add to add my key back to my ssh-agent.
Credits go to How to add a ssh key to remote server?, though not completely.

cap uses admin instead of ec2-user

I'm trying to do a "cap ec2onrails:setup" for my ROR website to an EC2 instance (Amazon image) but authentication keeps asking me for a password no matter what I do. I've tried almost anything I've read in this and/or other forums:
copy public key from ~/.ssh to ec2-user#_.sa-east-1.compute.amazonaws.com:/home/ec2-user/.ssh/authorized_keys2 (or authorized_keys)
generate private key using Amazon Management Console and then copying the public key from the server to my machine
adding any of these keys using ssh-add -l
generating new keys using ssh-keychain
using the public/private set of keys already in my machine (id_rsa & id_rsa.pub)
naming the keys following the above ^^ convention
chmod 400 for the keys in ~/.ssh
moving the keys to ~/.ec2
setting environment vars like stated here
Notes:
Connecting to the server using ssh and the AWS .pem key works just
fine
It doesn't matter how I set the "keys" value in "ssh_options",
Capistrano always seems to ignore it. However, it doesn't ignore the
keys listed in ssh-add -l
Here's how I try to set the key path
set :ssh_options, {:keys => ["/Users/dalef/.ssh/pk"]}
Here's the output code from my latest test, using verbose output
Damians-MacBook-Pro:test dalef$ cap ec2onrails:setup
[Deprecation Warning] This API has changed, please hook `deploy:create_symlink` instead of `deploy:symlink`.
* 2013-03-20 20:10:52 executing `ec2onrails:setup'
* 2013-03-20 20:10:52 executing `ec2onrails:server:update_hostname'
* executing "sudo -p 'sudo password: ' /usr/local/ec2onrails/bin/update_hostname"
servers: ["___.sa-east-1.compute.amazonaws.com"]
D, [2013-03-20T20:10:52.471872 #2647] DEBUG -- net.ssh.transport.session[3fe825c3c40c]: establishing connection to ___.sa-east-1.compute.amazonaws.com:22
D, [2013-03-20T20:10:52.539934 #2647] DEBUG -- net.ssh.transport.session[3fe825c3c40c]: connection established
I, [2013-03-20T20:10:52.540236 #2647] INFO -- net.ssh.transport.server_version[3fe825c45728]: negotiating protocol version
D, [2013-03-20T20:10:52.591866 #2647] DEBUG -- net.ssh.transport.server_version[3fe825c45728]: remote is `SSH-2.0-OpenSSH_5.3'
D, [2013-03-20T20:10:52.591965 #2647] DEBUG -- net.ssh.transport.server_version[3fe825c45728]: local is `SSH-2.0-Ruby/Net::SSH_2.6.6 x86_64-darwin12.2.0'
D, [2013-03-20T20:10:52.635419 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 784 bytes
D, [2013-03-20T20:10:52.635555 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 0 type 20 len 780
I, [2013-03-20T20:10:52.635654 #2647] INFO -- net.ssh.transport.algorithms[3fe825c484dc]: got KEXINIT from server
I, [2013-03-20T20:10:52.635844 #2647] INFO -- net.ssh.transport.algorithms[3fe825c484dc]: sending KEXINIT
D, [2013-03-20T20:10:52.636042 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 0 type 20 len 1620
D, [2013-03-20T20:10:52.636141 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 1624 bytes
I, [2013-03-20T20:10:52.636196 #2647] INFO -- net.ssh.transport.algorithms[3fe825c484dc]: negotiating algorithms
D, [2013-03-20T20:10:52.636319 #2647] DEBUG -- net.ssh.transport.algorithms[3fe825c484dc]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-sha1
* hmac_server: hmac-sha1
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [2013-03-20T20:10:52.636373 #2647] DEBUG -- net.ssh.transport.algorithms[3fe825c484dc]: exchanging keys
D, [2013-03-20T20:10:52.636563 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 1 type 34 len 20
D, [2013-03-20T20:10:52.636613 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 24 bytes
D, [2013-03-20T20:10:52.738438 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 152 bytes
D, [2013-03-20T20:10:52.738637 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 1 type 31 len 148
D, [2013-03-20T20:10:52.744324 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 2 type 32 len 140
D, [2013-03-20T20:10:52.744468 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 144 bytes
D, [2013-03-20T20:10:52.790733 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 720 bytes
D, [2013-03-20T20:10:52.790938 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 2 type 33 len 700
D, [2013-03-20T20:10:52.795329 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 3 type 21 len 20
D, [2013-03-20T20:10:52.795447 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 24 bytes
D, [2013-03-20T20:10:52.795542 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 3 type 21 len 12
D, [2013-03-20T20:10:52.795871 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: beginning authentication of `admin'
D, [2013-03-20T20:10:52.796008 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 4 type 5 len 28
D, [2013-03-20T20:10:52.796071 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 52 bytes
D, [2013-03-20T20:10:52.944233 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 52 bytes
D, [2013-03-20T20:10:52.944626 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 4 type 6 len 28
D, [2013-03-20T20:10:52.945125 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: trying publickey
D, [2013-03-20T20:10:52.945906 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: connecting to ssh-agent
D, [2013-03-20T20:10:52.946221 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: sending agent request 1 len 51
D, [2013-03-20T20:10:52.946460 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: received agent packet 2 len 5
D, [2013-03-20T20:10:52.946578 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: sending agent request 11 len 0
D, [2013-03-20T20:10:52.946859 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: received agent packet 12 len 294
D, [2013-03-20T20:10:52.947478 #2647] DEBUG -- net.ssh.authentication.methods.publickey[3fe826263fd8]: trying publickey (b7:96:23:2d:21:f3:5e:dd:ba:e9:7c:7d:f5:4c:fd:0c)
D, [2013-03-20T20:10:52.947821 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 5 type 50 len 348
D, [2013-03-20T20:10:52.947994 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 372 bytes
D, [2013-03-20T20:10:52.993286 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 52 bytes
D, [2013-03-20T20:10:52.993497 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 5 type 51 len 28
D, [2013-03-20T20:10:52.993717 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: allowed methods: publickey
D, [2013-03-20T20:10:52.993904 #2647] DEBUG -- net.ssh.authentication.methods.publickey[3fe826263fd8]: trying publickey (40:2c:20:e7:0c:f4:65:32:76:7c:39:5e:83:84:70:b2)
D, [2013-03-20T20:10:52.994095 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 6 type 50 len 348
D, [2013-03-20T20:10:52.994202 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 372 bytes
D, [2013-03-20T20:10:53.035308 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 52 bytes
D, [2013-03-20T20:10:53.035556 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 6 type 51 len 28
D, [2013-03-20T20:10:53.035693 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: allowed methods: publickey
E, [2013-03-20T20:10:53.035782 #2647] ERROR -- net.ssh.authentication.session[3fe826273f28]: all authorization methods failed (tried publickey)
Password:
Here's my list of keys for this latest test (just the one I retrieved from the server)
Damians-MacBook-Pro:test dalef$ ssh-add -l
2048 b7:96:23:2d:21:f3:5e:dd:ba:e9:7c:7d:f5:4c:fd:0c pk (RSA)
Is there anything I'm missing? I'm this close to trying password based authentication.
Thanks!!
Update
Still trying alternatives. I've also made sure I'm using the right key by comparing against AWS key fingerprint & authorized_keys
From Amazon:
dalef 90:04:34:df:75:cc:9c:f0:90:4f:77:17:98:ee:ec:c1:95:d9:f6:14
Damians-MacBook-Pro:.ssh dalef$ ec2-fingerprint-key dalef
90:04:34:df:75:cc:9c:f0:90:4f:77:17:98:ee:ec:c1:95:d9:f6:14
Damians-MacBook-Pro:.ssh dalef$ ssh-add dalef
Identity added: dalef (dalef)
Damians-MacBook-Pro:.ssh dalef$ ssh-add -l
2048 40:2c:20:e7:0c:f4:65:32:76:7c:39:5e:83:84:70:b2 id_rsa (RSA)
2048 e6:02:1a:a4:2a:f9:63:4a:b7:de:66:60:f2:fa:0c:b4 dalef (RSA)
[ec2-user#___ .ssh]$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCcfgMIAbEfNAiSgi4zXsObR1zGPHzVbff2suB/J2rLVgr5XNfLhf+kTRzTij0IWsutYj45j/eI87xC912WYtNG2An8262JwqRJZfwbnfDHMjwPQRwlDNjgGWRZwl8x9HO1V7EmBCaEEpeXg0ogbdhM386f/TTdWdUOofSqTEjuN2Nk73OHirPAj7MuWSGwGAwKCS4In2KbGAP/hk0c/PsCx52J+zjp2lteEaA9qWIovQggRw73dAqV++czMwCx2+7GMGxGx21fgSH4cYZ7Q6XxAxBkmsO7yoKZHUFj5QobSJ1TVh7N/61bFInt6Ua6btTXC7jwaATzkOBkv/rwLgtN **dalef**
Still asks for password.
Update
Something must be really wrong with my setup. I tried allowing password connections but that doesn't work either. Do I need to start thinking of a Capistrano-alternative?
Here's the log
[ec2-user#___ ~]$ sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes
[ec2-user#___ ~]$ sudo passwd ec2-user
Changing password for user ec2-user.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[ec2-user#___ ~]$ exit
...
E, [2013-03-21T00:31:02.582111 #3739] ERROR -- net.ssh.authentication.session[3fd0f6e21178]: all authorization methods failed (tried password)
connection failed for: admin#___.sa-east-1.compute.amazonaws.com (Net::SSH::AuthenticationFailed: admin)
From these logs what I assume is that Capistrano is trying to login as admin. How can I change that to ec2-user? (I've tried set :user, "ec2-user" in deploy.rb)
So after a lot of reading, I found the solution. This pointed me in the right direction: https://serverfault.com/questions/55343/cant-get-ssh-public-key-authentication-to-work
The main issue was that I didn't know what I was doing. So anyway if someone is interested in the solution I came up with:
Somehow Capistrano always uses an admin user, besides the one you setup, so I created one. You can go ahead and follow these steps: http://aws.amazon.com/articles/1233
I created my own set of pub/private keys using ssh-keygen -b 1024 -f ec2admin -t dsa
I copied the ec2admin.pub file to /home/admin/.ssh in the server, by using scp
I appended the pub contents to the /home/admin/.ssh/authorized_keys file in the server
Then it really helped to read the sshd log at: /var/log/secure (YMMV)
And finally solved three faulty permissions at /home:
chmod 700 /home/.ssh
chmod 600 /home/.ssh/*
chmod 755 /home/admin
And that did the trick. I can now login without a password. Thanks for your help!

Resources