Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I recently started using Cyanogenmod and I noticed some odd behavior in the shell for certain commands. The command works as expected in the Terminal app directly on the phone, but strange things occur when connected by ssh. For instance pwd:

/data/dropbear # pwd

/data/dropbear # which pwd
/data/dropbear # busybox pwd
/data/dropbear # ls -l /system/xbin/pwd
lrwxrwxrwx    1 root     root             7 Apr  1 23:30 pwd -> busybox

As you can see, pwd prints a blank line ![enter image description here][1]when typed normally at the command line. Even though it is just a link to busybox. I've fooled around with other embedded systems (DD-WRT), and noticed busybox was set up the same way - and works. The way it's behaving here breaks functionality with WinSCP, which depends on pwd when it connects.

I thought I could be a little clever here and use WinSCP to transfer files to my phone over my wireless lan. But as you can see it isn't quite working yet. For the record I'm using a Motorola Droid, Cyanogenmod 7 RC4, and also PuTTy from a Windows 7 machine.

share|improve this question
What do you get if you just run busybox without any parameters? It looks like that's what's happening on your first line, since as you say, pwd is just a link to busybox. –  Matt H Apr 3 '11 at 20:08

2 Answers 2

up vote 2 down vote accepted

Can you replace the pwd symbolic link with a script that just runs 'busybox pwd'?

Or would an alias work?

share|improve this answer
I think this would work, it will also get me back into busybox shell. The default shell (the workaround I posted) is very limited. Definitely a good workaround at least until the problem gets fixed/addressed. –  briankb Apr 5 '11 at 23:26

The reason for the different behavior is that dropbear was using a different shell than the terminal app. A workaround would be to just use the same shell as the terminal app:

echo "/system/bin/sh" > /data/dropbear/.profile

Note that this is in contrast to the Cyanogenmod wiki, which instructs you to use the busybox shell: /system/xbin/busybox sh

share|improve this answer
Bleh, kicking myself for not figuring this out sooner. At least WinSCP works now. I think this may be a dropbear bug, so I'll mention it to the guys in #cyanogenmod. –  briankb Apr 4 '11 at 0:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.