NSLU2-Linux
view · edit · print · history

Unslung.ChangeTheUnslungShellUsingDotProfile History

Hide minor edits - Show changes to markup

March 30, 2008, at 07:51 PM by tlhackque --
Changed lines 3-4 from:

You might want to see RunAnotherShellForRootSafely? instead.

to:

You might want to see HowTo.RunAnotherShellForRootSafely instead.

March 30, 2008, at 07:51 PM by tlhackque --
Added lines 3-4:

You might want to see RunAnotherShellForRootSafely? instead.

December 20, 2004, at 09:38 PM by jake --
Changed line 21 from:

An alternative (although dangerous one) is to change your shell in the /etc/password file. This may require the creation of an /etc/shells file that lists the new shell, but I haven't tested this to know for sure.

to:

An alternative (although dangerous one) is to change your shell in the /etc/passwd file. This may require the creation of an /etc/shells file that lists the new shell, but I haven't tested this to know for sure.

November 12, 2004, at 02:44 AM by kolla --
Changed line 35 from:
@@test -x /opt/bin/bash && exec /opt/bin/bash
to:
test -x /opt/bin/bash && exec /opt/bin/bash
November 12, 2004, at 02:44 AM by kolla --
Changed lines 31-37 from:

greg lawler

to:

greg lawler

  • Another way to do this and also avoid double-shelling is to use exec, I simple have this in my .profile
@@test -x /opt/bin/bash && exec /opt/bin/bash

kolla

September 17, 2004, at 06:09 AM by greg lawler --
Added line 31:

greg lawler

September 17, 2004, at 06:08 AM by greg lawler --
Changed lines 23-30 from:

heath

to:

heath

  • if you create an /etc/shells and insert the following line:

/opt/bin/sh you will be able to edit your shell in /etc/passwd as follows: root:3Na3KhotdogAM:0:0:root:/root:/opt/bin/sh and still be able to log in...

September 16, 2004, at 09:09 PM by heath --
Changed line 18 from:
  • login and verify that you are now in the new busybox (double-shelled, but it works)
to:
  • login and verify that you are now in the new shell(double-shelled, but it works)
September 16, 2004, at 09:09 PM by heath --
Changed lines 4-5 from:
  1. Unslung firmware and drive
  2. newer version of busybox
to:
  • Unslung firmware and drive
  • newer version of busybox
Changed lines 8-17 from:
  1. create /root directory (probably aready did this if you use dropbear to login)
  2. create /root/.profile (I actally created it as .login with a symlink to .profile)
  3. chmod 755 /root/.profile
  4. add commands to .profile to be executed on login
#!/bin/sh
->/opt/bin/sh
->alias l='ls -la'
->alias c='cd ..'
# logout
  1. login and verify that you are now in the new busybox (double-shelled, but it works)
to:
  • create /root directory (probably aready did this if you use dropbear to login)
  • create /root/.profile (I actally created it as .login with a symlink to .profile)
  • chmod 755 /root/.profile
  • add commands to .profile to be executed on login
#!/bin/sh
export PATH=$PATH:/my/dir
/opt/bin/sh
alias l='ls -la'
alias c='cd ..'
  • logout
  • login and verify that you are now in the new busybox (double-shelled, but it works)
September 16, 2004, at 09:07 PM by heath --
Changed lines 12-15 from:
#!/bin/sh
/opt/bin/sh
alias l='ls -la'
alias c='cd ..'
to:
#!/bin/sh
->/opt/bin/sh
->alias l='ls -la'
->alias c='cd ..'\\
September 16, 2004, at 09:04 PM by heath --
Changed lines 1-22 from:
to:

Change your Shell using .profile

Requires:

  1. Unslung firmware and drive
  2. newer version of busybox

Steps:

  1. create /root directory (probably aready did this if you use dropbear to login)
  2. create /root/.profile (I actally created it as .login with a symlink to .profile)
  3. chmod 755 /root/.profile
  4. add commands to .profile to be executed on login
#!/bin/sh
/opt/bin/sh
alias l='ls -la'
alias c='cd ..'
  1. logout
  2. login and verify that you are now in the new busybox (double-shelled, but it works)

An alternative (although dangerous one) is to change your shell in the /etc/password file. This may require the creation of an /etc/shells file that lists the new shell, but I haven't tested this to know for sure.

heath

view · edit · print · history · Last edited by tlhackque.
Based on work by tlhackque, jake, kolla, greg lawler, and heath.
Originally by heath.
Page last modified on March 30, 2008, at 07:51 PM