LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-31-2011, 05:37 PM   #1
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Rep: Reputation: 4
SSHing into an iPod, how do I display/open files and how do I move them to filesystem


Well, figuring out that just plugging in my iPod in Ubuntu only shows certain files, music, and images, the other important and "Juicy" stuff that I've saved on iFile is there, like PDFs and documents and whatnot. Should I just take the easy way out and move everything from my iPod to a file that can be easily read *Yet hard to locate on my iPod* so I can just transfer it from there, or should I do it the hard way and try to find out how? Well, I've always wanted to learn how to move files over a Secure Shell, so I guess now would be the best time to learn. What commands do I have to use to move files from one machine/device to another? Should I copy the files first before attempting to move them? Are there any switching accompanying the commands and can you explain what they do so I know what and why I'll be using them so I can consider them in future use. Also, in order to SSH into it, I had to do it as root
Code:
 sudo -i
Anyway, another thing, if you could be so kind, this is optional, could you tell me more about how SSH works? You don't need to though, I only need an answer for SSH commands.
 
Old 05-31-2011, 08:34 PM   #2
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,361

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
To ssh to a device, that device needs to be running and ssh server/daemon. I've never used and ipod, but I would be amazed if they run an ssh daemon: have you read/heard something that indicates that they do?

Anyway, you can't really "move" files, but you can "copy" them (but I guess by deleting the local file after copying it you have effectively moved it). scp is the classic command for copying files over ssh, but you can also use things like rsync: eg "rsync -e ssh". Other fun things you can do include mounting a remote file system with fuse/sshfs.

Evo2.
 
Old 05-31-2011, 08:53 PM   #3
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
I would be amazed if they run an ssh daemon
Actually, you can install an OpenSSH server on an iPhone/iPod Touch, but it involves "jailbreaking" the device (i.e. allowing installation of apps outside Apple's App Store).
 
Old 05-31-2011, 09:01 PM   #4
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by MrCode View Post
Actually, you can install an OpenSSH server on an iPhone/iPod Touch, but it involves "jailbreaking" the device (i.e. allowing installation of apps outside Apple's App Store).
Which is what I did, I jailbroke it a while ago.
 
Old 05-31-2011, 09:07 PM   #5
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by evo2 View Post
To ssh to a device, that device needs to be running and ssh server/daemon. I've never used and ipod, but I would be amazed if they run an ssh daemon: have you read/heard something that indicates that they do?

Anyway, you can't really "move" files, but you can "copy" them (but I guess by deleting the local file after copying it you have effectively moved it). scp is the classic command for copying files over ssh, but you can also use things like rsync: eg "rsync -e ssh". Other fun things you can do include mounting a remote file system with fuse/sshfs.

Evo2.
Code:
 theif519@theif519-Inspiron-580s:~$ sudo -i
[sudo] password for theif519: 
root@theif519-Inspiron-580s:~# ssh 192.168.1.2
root@192.168.1.2's password: 
theif519s-iPod:~ root# ls
Documents/  Library/  Media/  NinjaGa.nes  Ninja_Gaiden_1.zip
theif519s-iPod:~ root# cd /
theif519s-iPod:/ root# ls
Applications@  Library/  Thumbs.db  bin/   cores/  etc@  mnt/      sbin/  usr/
Developer/     System/   User@      boot/  dev/    lib/  private/  tmp@   var@
theif519s-iPod:/ root# cd var
theif519s-iPod:/var root# ls
Keychains/             cache/    include/  log/          root/   vm/
Managed\ Preferences/  db/       keybags/  logs/         run/    wireless/
MobileDevice/          ea/       lib/      mobile/       spool/
audit/                 empty/    local/    msgs/         stash/
backups/               folders/  lock/     preferences/  tmp/
theif519s-iPod:/var root# cd ..
theif519s-iPod:/ root# ls
Applications@  Library/  Thumbs.db  bin/   cores/  etc@  mnt/      sbin/  usr/
Developer/     System/   User@      boot/  dev/    lib/  private/  tmp@   var@
theif519s-iPod:/ root# cd User
theif519s-iPod:/User root# ls
Applications/  Documents/  Library/  Media/  loader_package.tar
theif519s-iPod:/User root# cd Documents
theif519s-iPod:/User/Documents root# cd
theif519s-iPod:~ root# ls
Documents/  Library/  Media/  NinjaGa.nes  Ninja_Gaiden_1.zip
theif519s-iPod:~ root# cd Documents
theif519s-iPod:~/Documents root# ls
admob/
theif519s-iPod:~/Documents root# cd ..
theif519s-iPod:~ root# cd ..
theif519s-iPod:/var root# cd /
theif519s-iPod:/ root# ls
Applications@  Library/  Thumbs.db  bin/   cores/  etc@  mnt/      sbin/  usr/
Developer/     System/   User@      boot/  dev/    lib/  private/  tmp@   var@
theif519s-iPod:/ root# cd User
theif519s-iPod:/User root# ls
Applications/  Documents/  Library/  Media/  loader_package.tar
theif519s-iPod:/User root# cd Documents
theif519s-iPod:/User/Documents root# ls
Intro_To_Linux.pdf  Linux_Command-Line.pdf  Rute_Users_Guide.pdf  admob/
KLPhotoMosaic/      Linux_Shell.pdf         Slackware_Guide.pdf   mobclix.db
theif519s-iPod:/User/Documents root# rsync -e ssh
-sh: rsync: command not found
theif519s-iPod:/User/Documents root#
rsync wasn't recognized... do I have to do it in my own terminal or in the SSH'd iPod Terminal? Is there a front-end for SSHing that's on Linux?
 
Old 05-31-2011, 09:31 PM   #6
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,361

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
There are many ssh client front ends. I personally prefer just using ssh from the command line. However as I understand it many file managers have ssh built in so you can "drag-n-drop" files in the same way you would normally use a file manager.

One thing I thought I should mention is that you should not need to be root on you pc to ssh to your ipod, you just need to specify that the user on the ipod is root:

Eg
Code:
theif519@theif519-Inspiron-580s:~$ ssh root@192.168.1.2
It seems that rsync is not installed on your ipod. Also if it was you would use it something like:

Code:
theif519@theif519-Inspiron-580s:~$ rsync -e ssh  /home/theif519/Music root@192.168.1.2:/User/Media
Evo2.
 
1 members found this post helpful.
Old 05-31-2011, 09:52 PM   #7
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,361

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
Ok, just realized that what you want to do is copy files from your ipod onto your computer. If for example you wanted to copy all the files in /User/Documents you could do the following

Code:
theif519@theif519-Inspiron-580s:~$ scp -r root@192.1681.2.:/User/Documents .
Evo2.
 
1 members found this post helpful.
Old 06-01-2011, 03:50 PM   #8
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by evo2 View Post
Ok, just realized that what you want to do is copy files from your ipod onto your computer. If for example you wanted to copy all the files in /User/Documents you could do the following

Code:
theif519@theif519-Inspiron-580s:~$ scp -r root@192.1681.2.:/User/Documents .
Evo2.
Code:
theif519@theif519-Inspiron-580s:~$ ssh root@192.168.1.2
ssh: connect to host 192.168.1.2 port 22: No route to host
theif519@theif519-Inspiron-580s:~$ ssh root@192.168.1.2
root@192.168.1.2's password: 
theif519s-iPod:~ root# scp -r root@192.1681.2.:/User/Documents
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
theif519s-iPod:~ root# cd /User/Documents
theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents .
ssh: Could not resolve hostname 192.1681.2.: nodename nor servname provided, or not known
theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents .
It didn't work...
 
Old 06-01-2011, 03:55 PM   #9
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,361

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
You are running the command from the wrong machine.

Evo2.
 
Old 06-01-2011, 04:04 PM   #10
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by evo2 View Post
You are running the command from the wrong machine.

Evo2.
Code:
theif519@theif519-Inspiron-580s:~$ theif519@theif519-Inspiron-580s:~$ ssh root@192.168.1.2
theif519@theif519-Inspiron-580s:~$: command not found
theif519@theif519-Inspiron-580s:~$ ssh: connect to host 192.168.1.2 port 22: No route to host
No command 'ssh:' found, did you mean:
 Command 'sshd' from package 'openssh-server' (main)
 Command 'ssh' from package 'openssh-client' (main)
 Command 'sshm' from package 'sshm' (universe)
ssh:: command not found
theif519@theif519-Inspiron-580s:~$ theif519@theif519-Inspiron-580s:~$ ssh root@192.168.1.2
theif519@theif519-Inspiron-580s:~$: command not found
theif519@theif519-Inspiron-580s:~$ root@192.168.1.2's password: 
> theif519s-iPod:~ root# scp -r root@192.1681.2.:/User/Documents
> usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
>            [-l limit] [-o ssh_option] [-P port] [-S program]
>            [[user@]host1:]file1 ... [[user@]host2:]file2
> theif519s-iPod:~ root# cd /User/Documents
> theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents .
> ssh: Could not resolve hostname 192.1681.2.: nodename nor servname provided, or not known
> theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents .
> root@192.168.1.2's password: 
theif519s-iPod:~ root# scp -r root@192.1681.2.:/User/Documents
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
theif519s-iPod:~ root# cd /User/Documents
theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents .
ssh: Could not resolve hostname 192.1681.2.: nodename nor servname provided, or not known
theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents /home/theif519/Documents
bash: root@192.168.1.2s password: 
theif519s-iPod:~ root# scp -r root@192.1681.2.:/User/Documents
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
theif519s-iPod:~ root# cd /User/Documents
theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents .
ssh: Could not resolve hostname 192.1681.2.: nodename nor servname provided, or not known
theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents .
root@192.168.1.2s: No such file or directory
theif519s-iPod:~: command not found
usage:: command not found
[-l: command not found
[[user@]host1:]file1: command not found
theif519s-iPod:~: command not found
bash: theif519s-iPod:/User/Documents: No such file or directory
No command 'ssh:' found, did you mean:
 Command 'sshd' from package 'openssh-server' (main)
 Command 'ssh' from package 'openssh-client' (main)
 Command 'sshm' from package 'sshm' (universe)
ssh:: command not found
bash: theif519s-iPod:/User/Documents: No such file or directory
theif519@theif519-Inspiron-580s:~$ theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents /Home/theif519/Documents
bash: theif519s-iPod:/User/Documents: No such file or directory
theif519@theif519-Inspiron-580s:~$ theif519s-iPod:/User/Documents root# scp -r root@192.1681.2.:/User/Documents /home/theif519/Documents
bash: theif519s-iPod:/User/Documents: No such file or directory
theif519@theif519-Inspiron-580s:~$ scp -r theif519s-iPod:/User/Documents theif519@192.168.1.4:/home/theif519/Documents
theif519@theif519-Inspiron-580s:~$ $ scp -r root@192.168.1.4:/User/Documents theif519@192.168.1.4:/home/theif519/Documents
throot@192.168.1.4's password: 
Permission denied, please try again.
throot@192.168.1.4's password: 
theif519@theif519-Inspiron-580s:~$ scp -r root@192.168.1.4:/User/Documents theif519@192.168.1.4:/home/theif519/Documents
root@192.168.1.4's password: 
Permission denied, please try again.
root@192.168.1.4's password: 
theif519@theif519-Inspiron-580s:~$ scp -r root@192.168.1.2:/User/Documents theif519@192.168.1.4:/home/theif519/Documents
root@192.168.1.2's password: 
Host key verification failed.
lost connection
theif519@theif519-Inspiron-580s:~$
Sorry if I'm being a bit annoying.
 
Old 06-01-2011, 04:25 PM   #11
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,361

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
You are still trying to run the scp on the ipod. Look at what the prompt is in the command that I posted.

Evo2.
 
1 members found this post helpful.
Old 06-01-2011, 04:35 PM   #12
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by evo2 View Post
You are still trying to run the scp on the ipod. Look at what the prompt is in the command that I posted.

Evo2.
I did it! Thank you so much! But I've a question, where was it copied to?
 
Old 06-01-2011, 04:37 PM   #13
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Original Poster
Rep: Reputation: 4
Nevermind, found it in my documents section, but how did it know to send it? My present direction was /home/theif519 not /home/theif519/Documents does it automatically allocate it to a certain directory that it thinks it's supposed to go to? Also, what does the "." mean at the end of the command?
 
Old 06-01-2011, 04:41 PM   #14
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,361

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
The "." at the end is the destination for the files. So, they should have ended up in the directory you were in when you ran the command. Please try it again to confirm this.

Evo2.
 
Old 06-01-2011, 04:45 PM   #15
theif519
Member
 
Registered: Mar 2011
Location: Philadelphia, PA
Distribution: Kubuntu 12.10
Posts: 255

Original Poster
Rep: Reputation: 4
OH! I see what it did, it must have detected a file with the same name and instead of overwriting it, copied the subdirectories into it! Awesome! Also, I want to know how I do it the other way around? Do I do it from inside the iPod's side of the SSH Terminal or from my own?
 
  


Reply

Tags
ipod, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need assistance SSHing into Fedora 14 when Fedora had no problem SSHing into Ubuntu theif519 Fedora 12 06-04-2011 02:34 PM
gtkpod: Not able to open iPod files for writing reh_42 Linux - Software 0 01-17-2006 12:52 PM
ipod/ipod shuffle woes (lack of permissions to edit files) Lechium Linux - Software 1 04-13-2005 03:14 PM


All times are GMT -5. The time now is 08:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration