Difference between revisions of "Install SU and VI"

From AwkwardTV
Jump to: navigation, search
m
m
Line 24: Line 24:
 
To copy them to your AppleTV, first find them. They are both stored under /usr/bin. If you are using a graphical SSH client, you can drag and drop them to your AppleTV (you'll need to copy them to the frontrow user directory - /Users/frontrow). If you're using the command line:
 
To copy them to your AppleTV, first find them. They are both stored under /usr/bin. If you are using a graphical SSH client, you can drag and drop them to your AppleTV (you'll need to copy them to the frontrow user directory - /Users/frontrow). If you're using the command line:
  
  scp -1 -r /usr/bin/su frontrow@<AppleTVIPAddress>
+
  scp -1 -r /usr/bin/su frontrow@<AppleTVIPAddress>:~/
  scp -1 -r /usr/bin/vim frontrow@<AppleTVIPAddress>
+
  scp -1 -r /usr/bin/vim frontrow@<AppleTVIPAddress>:~/
  
Obviously replace <AppleTVIPAddress> with either the IP address or hostname of your AppleTV.
+
Obviously replace <AppleTVIPAddress> with either the IP address or hostname of your AppleTV. The default hostname is appletv.local.
  
 
That copied the files to your AppleTV, now we need to move them to their correct location.
 
That copied the files to your AppleTV, now we need to move them to their correct location.
Line 37: Line 37:
 
Then move the files to the correct location:
 
Then move the files to the correct location:
  
  sudo mv ~frontrow/su /usr/bin/su
+
  sudo -s
  sudo mv ~frontrow/vim /usr/bin/vim
+
mv ~frontrow/su /usr/bin/su
 +
  mv ~frontrow/vim /usr/bin/vim
  
 
If you're used to executing vi rather than vim, create a symbolic link:
 
If you're used to executing vi rather than vim, create a symbolic link:
  
  sudo ln -s /usr/bin/vim /usr/bin/vi
+
  ln -s /usr/bin/vim /usr/bin/vi
  
 
[[Category:How-to]]
 
[[Category:How-to]]

Revision as of 07:10, 12 June 2007

The prerequisites for these are running SSH on your AppleTV, and having access to an Intel Mac using universal binaries (except for su; see the note below). This assumes you haven't upgraded the SSH version on your AppleTV (which you should: Install_SSH) and therefore can only connect using SSH v1.


Installing su

Note: you don't need to install su to derive its functionality. To obtain a root shell, simply type 'sudo bash' and enter the password. The prompt will change from a dollar sign (bash-2.05b$) to a hash (bash-2.05b#) to indicate the elevated privileges.

su allows you to login as root ([1]). Ordinarily, you'd need to know the root password. Try typing the following to see what I mean:

su -

You get prompted for the root password....

On an OS X box, your administrator user has sudo rights to execute any command and therefore elevate your shell to be root:

sudo su -

You get prompted for your password.

Installing vi

vi is a line editor for making changes to files. On OS X, vim ([2]) is installed by default.

To copy them to your AppleTV, first find them. They are both stored under /usr/bin. If you are using a graphical SSH client, you can drag and drop them to your AppleTV (you'll need to copy them to the frontrow user directory - /Users/frontrow). If you're using the command line:

scp -1 -r /usr/bin/su frontrow@<AppleTVIPAddress>:~/
scp -1 -r /usr/bin/vim frontrow@<AppleTVIPAddress>:~/

Obviously replace <AppleTVIPAddress> with either the IP address or hostname of your AppleTV. The default hostname is appletv.local.

That copied the files to your AppleTV, now we need to move them to their correct location.

First, log into the AppleTV using ssh:

ssh -1 frontrow@<AppleTVIPAddress>

Then move the files to the correct location:

sudo -s
mv ~frontrow/su /usr/bin/su
mv ~frontrow/vim /usr/bin/vim

If you're used to executing vi rather than vim, create a symbolic link:

ln -s /usr/bin/vim /usr/bin/vi