Midspot

Correct syntax for using SSH and SFTP on Ubuntu on irregular ports

October 5, 2006 · 4 Comments

I’m posting the following more for my own benefit and reference than anything else…

Correct syntax for SSH and SFTP on Ubuntu on irregular ports: (replace items in < > with your stuff, without the < >)

SSH:
ssh -p <port number> <username>@<server name>

SSH to accept socks 5 proxy on port you specify:
ssh -p <port number> <username>@<server name> -D <port to watch>

SFTP:
sftp -oPort=<port number> <username>@<server name>

Forward the X server from your remote box:
ssh -X -p <port number> <username>@<remote computer>

Unless your are a Linux geek or have some remote Linux servers you will probably never use this, but in case you do it sure is handy…

Next week we will dive into how to create a SSH tunnel (shunnel) using your Ubuntu box at home.


Technorati : , , , , , , , , , , , , , ,

Categories: Linux · ubuntu

4 responses so far ↓

  • fak3r // October 6, 2006 at 1:07 pm | Reply

    This is helpful, and the reason I post HOWTOs on my site, to help me remember!

    Also, I use scp constantly to move things from work to my home server, but switches are different than those in ssh *and* cp! Ah, the inconsistent ways of *nix. So, following your above sftp example

    scp (put):

    scp -P -r @:

    scp (get):

    scp -P -r @:

    Pretty self explaniotry, but the -r is for recursive, just like cp’s -R.

  • fak3r // October 6, 2006 at 1:10 pm | Reply

    Ah, that didn’t work, the brackets were stripped. Ok, how about {}’s

    scp (put):
    scp -P {port} -r {files_or_directory} {username}@{servername}:{target_directory}

    scp (get):
    scp -P {port} -r {username}@{servername}:{files_or_directory} {target_directory}

  • Anonymous // October 6, 2006 at 4:55 pm | Reply

    scp (and sftp) is fine for one or two files, but you might want to look at rsync for lots-o-files and/or directories. I’ll leave reading “man rsync” to the user, but to use rsync with remote irregular ports, you might do something like this:

    rsync (put):

    rsync -avuzb –rsh “ssh -p{port}” {/path/to/local/files_dirs} {user}@{host}:{/path/to/remote}

    rsync(get):

    rsync -avuzb –rsh “ssh -p{port}” {user}@{host}:{/path/to/remote} {/path/to/local}

  • Melioner56 // March 13, 2008 at 9:52 am | Reply

    Do not take Kamagra if you are taking any nitrate-based drug, including nitroglycerin patches (Nitro-Dur, Transderm-Nitro), nitroglycerin ointment (Nitro-Bid, Nitrol), nitroglycerin pills (Nitro-Bid, Nitrostat), and isosorbide pills (Dilatrate-SR, Isordil, Sorbitrate). Combining Kamagra with these drugs can cause a severe drop in blood pressure.
    If you have heart problems severe enough to make sexual activity a danger, you should avoid using Kamagra. Use it cautiously if you’ve had a heart attack, stroke, or life-threatening heart irregularities within the past 6 months. Be equally cautious if you have severe high or low blood pressure, heart failure, or unstable angina.
    If you take Kamagra and develop cardiac symptoms (for example, dizziness, nausea, and chest pain) during sexual activity, do not continue. Alert your doctor to the problem as soon as possible.
    If you have a condition that might result in long-lasting erections, such as sickle cell anemia, multiple myeloma (a disease of the bone marrow), or leukemia, use Kamagra with caution. Also use cautiously if you have a genital problem or deformity such as Peyronie’s disease. If an erection lasts more than 4 hours, seek treatment immediately. Permanent damage and impotence could result.
    If you have a bleeding disorder, a stomach ulcer, or the inherited eye condition known as retinitis pigmentosa, use Kamagra with caution. Its safety under these circumstances has not yet been studied.

    kamagra,cheap kamagra, jelly kamagra, kamagra plus, jelly kamagra oral,
    kamagra uk, buy kamagra, kamagra tablet, buy kamagra online, kamagra st,
    fast kamagra, buy kamagra uk.
    Viagra, Cialis, Viagra Professional, Cialis Professional, Viagra Soft
    Tabs, Cialis Soft Tabs, Levitra, Kamagra, Viagra Jelly, Cialis Jelly,
    Propecia, Himplasia, Cardura, Yohimbe-1200, Eulexin, Speman, Pro-Erex,
    Casodex, Hytrin, Flomax, Urispas, Tentex Royal, Horny Goat Weed, Ginseng,
    Saw Palmetto, Proscar, Maxaman, Erexor, Avodart, Himcolin, Confido,
    Uroxatral, Herbal Testosterone.
    http://www.kamagrasuite.bravehost.com

Leave a Comment