Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using SSH with terminal - how do I transfer a file?

Featured Replies

This is my first time using SSH. I'm using whatever the default program is that comes with Ubuntu and runs through the terminal. As far as I can tell it really just works like the terminal... I can use ls, cp, rm, etc.

 

However, I'm a little bit stuck. Obviously now I can move, delete and copy files, but I'd like to move a file from my computer to my website. I don't see a way to access my computer through it. Can anyone help?

Edited by rhubarblover

You can also use your ssh credentials with something Filezilla you just set the port to 22 and it will connect using ssh but will be as if you are using FTP.

 

If you purly want to use the command line you can use scp as said above or rsync

You should be using GIT with your projects. Then it's as simple as pushing your local project to your remote repository, then logging into the live server via SSH then using 'git pull' to pull down your project. It takes literally a few seconds, and is even faster when you assign aliases. To deploy my local changes to live on my own site is less than 20 keystrokes, that is literally it.

 

The mere thought of going back to FTP or some kind of point and click GUI for deployment sends shivers down my spine, it's so slow and tedious. Learning to work with GIT and SSH properly will also help you in the job market, all decent agencies, startups etc make heavy use of GIT and SSH.

 

Obviously with GIT you also get tonnes of control over your project with ability to revert to previous versions etc etc, this is especially important when working with teams - any decent sized project is gonna involve teamwork. There's good GIT tutorials over on codeschool. It's getting to the stage where you'll struggle even to get junior roles without GIT knowledge now that it's that heavily used.

Edited by rbrtsmith

  • Author

D4Y0 -
Thanks for the tip, though I'm happy using the terminal as I've become quite used to it.

Rbrtsmith -
I'm not sure I see the advantage of GIT over using SSH in the terminal. I haven't counted, but I don't think it takes over 20 keystrokes to upload a file to my website using the SCP command (or more, if you use tab to autocomplete names). And it hardly takes any time at all to complete. Logging in to SSH and browsing through my website's directories is easy/quick enough (ok, there's a tiny bit of lag when typing). I have only been using it since yesterday, but there doesn't seem to be anything wrong with it?

D4Y0 -

Thanks for the tip, though I'm happy using the terminal as I've become quite used to it.

 

Rbrtsmith -

I'm not sure I see the advantage of GIT over using SSH in the terminal. I haven't counted, but I don't think it takes over 20 keystrokes to upload a file to my website using the SCP command (or more, if you use tab to autocomplete names). And it hardly takes any time at all to complete. Logging in to SSH and browsing through my website's directories is easy/quick enough (ok, there's a tiny bit of lag when typing). I have only been using it since yesterday, but there doesn't seem to be anything wrong with it?

 

Full version history, the ability roll back a deployment (essential) and a log of code changes. Imagine working in a team where every developer is submitting code, you need to keep track of that.

 

Simply deploying blind to a production server is dangerous. There's no guarantee your code would be in sync with others, and you can't see what has been added or removed.

 

It's also helpful locally. Let's say you update all of your dependancies, like NPM modules, or Ruby Gems, if something breaks your build in some way, you can roll back to before those changes were made.

  • Author

Oh, okay, that makes sense. Though I'm not actually working with anyone else anyway - and I don't even know what NPM modules or Ruby Gems are. I really need to devote all my efforts towards finding clients at the moment, but I'll have a look at it in my spare time - since it doesn't sound like it's actually something I need at the moment?

Oh, okay, that makes sense. Though I'm not actually working with anyone else anyway - and I don't even know what NPM modules or Ruby Gems are. I really need to devote all my efforts towards finding clients at the moment, but I'll have a look at it in my spare time - since it doesn't sound like it's actually something I need at the moment?

 

I find Git is one of those things.. You won't know beneficial it is until something bad or unexpected happens, and then you'll wish it was in place from the get-go.

 

Let's say you do a bunch of edits to a site, and a few weeks later notice there's a breaking bug on one of the pages. There's know way for you to now know what has changed, you may have deleted something important. It may also be of benefit to roll back temporarily until you can get the issue fixed. If you don't have a backup of this, then it can become a big problem. Even if you do have a backup, is it the right one? These are the kind of problems that version control fixes. As well as smoother deployments.

 

I admit it is a real pain though, I still struggle with it quite often, especially now I'm having to manage multiple accounts on Github and Bitbucket.

You don't use GIT instead of SSH. I don't suggest that in my post. SSH is just a secure connection, GIT is a version controll system. You use them both together. Push up your project using GIT. Login to server via SSH, Pull down project using GIT.

Oh, okay, that makes sense. Though I'm not actually working with anyone else anyway - and I don't even know what NPM modules or Ruby Gems are. I really need to devote all my efforts towards finding clients at the moment, but I'll have a look at it in my spare time - since it doesn't sound like it's actually something I need at the moment?

 

This is why I recommend seeking out employment and gaining experience rather than freelancing. I could freelance now for considerably more than I make right now, but experience gained working with more advanced developers now will benefit me greatly in the future if and when I decide to do it alone.

Especially at beginner / intermediate level I really think working with other developers will allow you to gain crucial experience.

You learn and get paid on the job instead of devoting time to seeking out clients (who at this stage mostly have crappy project ideas) and dealing with things that will take up a lot of time... leaving little time for actually getting better at programming.

Unfortunately this might come across as a harsh reality, but the devs I know who have succeeded - and i mean REALLY succeded all worked for somebody else for a number of years, moved onto a large company before branching out on their own.

 

Have a read through these slides detailing how Harry Roberts made it to where he is now https://speakerdeck.com/csswizardry/dont-you-wish-youd-done-it-sooner

Edited by rbrtsmith

I also cannot imagine going back to FTP.

 

I remember in my last job where I HAD to learn Git I felt clueless. Took a couple of hours but once you get it, you get it.

 

And you will understand how amazing it is.

I use GIT for absolutely every little thing I do now, I even set up my own GIT server so that I didn't have to pay for private repositorys.

 

Where I work on multiple work stations it is very handy being able to get the latest revision by typing 8 characters

Can I also point out that the use of git is extremely helpful if ( heaven forbid ) your websites are compromised you can also use Git to work out what code's been changed.

I use GIT for absolutely every little thing I do now, I even set up my own GIT server so that I didn't have to pay for private repositorys.

 

Where I work on multiple work stations it is very handy being able to get the latest revision by typing 8 characters

 

Switched to BitBucket a while back, unlimited private repo's :)

 

Switched to BitBucket a while back, unlimited private repo's :)

 

Same reason we use BitBucket for internal projects. For personal ones I use GH as it has superior social capabilities.

Can I also point out that the use of git is extremely helpful if ( heaven forbid ) your websites are compromised you can also use Git to work out what code's been changed.

 

and by whom ;)

 

Switched to BitBucket a while back, unlimited private repo's :)

i use gogs myself as the UI is very similar to github

Have you got into branching yet? Branching is Git's killer feature (other older version control systems like Subversion also supported branching, but the way branching worked was far more expensive and more difficult to work with). It's the one thing I simply cannot live without.

 

I develop features on branches even if I'm working on a personal project and I'm the sole developer.

 

Branching is great, it gives you a lot of freedom and makes life a lot easier :D

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.