0

Desired Behaviour:

I'm setting up a Windows machine next to my Linux machine as a client needs me to use some Windows specific software.

I need to copy a bunch of folders from Linux to Windows 10.

I'm trying to use WinSCP to achieve this, and these are the things I think I need:

IP Address:

ifconfig on Linux machine returns inet addr: 192.xxx.x.x

Whilst googling 'whats my ip' on Linux machine returns 118.xxx.xx.xx

Q01: Which one do I use?

Protocol and Port Number:

Q02: SCP and 22?

Username and Password:

Q03: Do I just use the username and password I usually use to login to my Linux machine?

...A lot of the tutorials I've come across talk about connecting to a Linux computer as a virtual machine, or server, and therefore I'm wondering if I need something to be 'running' on the Linux machine for this to work?

So, last questions:

Q04: Does something need to be running on Linux?

Q05: How do I define which folders will be 'browsable' on the Linux Machine?

What I've Tried:

My last attempt in WinSCP used these credentials:

  • Protocol: SCP
  • Port: 22
  • Hostname: [the inet addr ip from ifconfig]
  • Username: [my normal Linux login username]
  • Password: [my normal Linux login password]

And gave me this error:

Network error: Connection to "192.xxx.x.x" refused.

(Help page for that error)

Edit:

The answer below is more comprehensive, but as a follow up:

I did this on Linux machine:

sudo service ssh start

And got this:

ssh: unrecognised service

So, I had to do this:

sudo apt-get purge openssh-server
sudo apt-get install openssh-server

And then start with:

sudo service ssh restart

And then I used credentials in WinSCP as stated in original post and it worked.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
user1063287
  • 2,255

1 Answers1

3

Question 1:

The second one: 118.xxx.xx.xx - this is your public IP address (although if both computers are on the same network - you may use any of them)

Question 2:

Yes (unless you change it). 22 is the default port for SSH (apparently - SCP too, since it uses SSH for connections). However, many change it to something else to avoid attacks.

Question 3:

Yes.

Question 4:

sshd - the SSH daemon.

  1. Install openssh-server.
  2. Copy the existing /etc/ssh/sshd_config to a backup.
  3. Edit the (non-backup) /etc/ssh/sshd_config
  4. For security, you may want to change Port 22 in the above file to a higher number (2020, for example)
  5. Save.
  6. Allow the port in the firewall - sudo ufw allow {port number}.
  7. Start sshd - sudo service ssh start

Now you can access your computer's files using {port number you chose}

Question 5:

You'll need to use a chroot jail - see this.