LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-14-2015, 04:35 PM   #1
TimeAssassin
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Rep: Reputation: Disabled
I need help getting Cygwin connected to an SSH on my Windows 7 computer.


Hi. I've been struggling to get started with Linux programming. I've had a little experience creating and moving files around from folder to folder in the terminal of my Ubuntu virtual machine on my laptop, but it's time to move forward.

So, my next big goal is to get an ssh working. I've decided that the most legitimate way to do that is to use my home desktop as the server/database, and remotely connect to it (preferably through some kind of secure port on the internet). I discovered Cygwin, and set it up on my computer. I also installed (and possibly configured, but I'm not sure) PuTTY on my computer as well, but that was two weeks ago. Since then, I never attempted to actually log out of the ssh that I supposedly set up (because I don't know how). Also, I'm assuming that "ssh-host-config" is not what I need to use for logging into an existing ssh, because when I tried that today, I got
the error:
"There are still ssh processes running. Please shut them down first."


NOTE: I'm not a business or organization of any kind. I'm just going to college for Computer Science and Cyber Security, and trying to get a few steps ahead of my peers. I do not have professional server equipment at home, just a 64-bit Windows 7 computer connected to a standard Ethernet router, so please keep that in mind when you reply to this thread.


What is the Linux command for logging out of an ssh? What is the Linux command that get the terminal to prompt you for your ssh username and password? How do I log into my ssh as the root user? What would be the easiest way to create and keep track of all the information about the
users that I create accounts for?

Last edited by TimeAssassin; 02-14-2015 at 04:36 PM.
 
Old 02-14-2015, 07:09 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Welcome to LQ!

The setup you describe should allow you to experiment with SSH by connecting to the Ubuntu virtual machine from your Windows 7, provided that you networking configured appropriately.
Either Cygwin or PuTTY can be used as SSH clients to connect to the Ubuntu virtual machine as the SSH server. (The Ubuntu virtual machine will need to be running sshd, the SSH server daemon.)

Quote:
What is the Linux command for logging out of an ssh?
Typing 'exit' in the SSH terminal window should exit the SSH connection. If you have been using X11 forwarding and running an X windows program, it may be necessary to type Ctrl-C to restore the command prompt.

Quote:
What is the Linux command that get the terminal to prompt you for your ssh username and password?
Typically you start a SSH session by including '<user>@<hostname>' in the options to the 'ssh' command. If the user is recognised on the remote host , and password login is allowed on the remote host (set by options in sshd_config on the remote host), then the connecting user will be requested to supply the password.

Quote:
How do I log into my ssh as the root user?
It is considered poor security practice to allow root login via SSH. (An attacker knows the user name and the password is vulnerable to brute forcing). It is best to disable root login, connect via SSH as a normal user, then escalate privileges when connected.
As you are experimenting on your own machine, allowing root login requires that the SSH server has root login enabled in the options in sshd_config.

Quote:
What would be the easiest way to create and keep track of all the information about the users that I create accounts for?
In Linux, when users are created, information on users is stored in /etc/passwd. User privileges are enhanced by including the user in groups. This information is stored in /etc/group.
 
Old 02-14-2015, 10:58 PM   #3
TimeAssassin
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
Either Cygwin or PuTTY can be used as SSH clients to connect to the Ubuntu virtual machine as the SSH server.
Huh? So I don't need PuTTY if I have Cygwin?

Quote:
Originally Posted by allend View Post
If you have been using X11 forwarding and running an X windows program, it may be necessary to type Ctrl-C to restore the command prompt.
I have no idea what any of those things are. In any case, here is a screen shot of the results from my attempt to disconnect from ssh in the Cygwin terminal:
Click image for larger version

Name:	moreCygwinproblems.JPG
Views:	311
Size:	25.8 KB
ID:	17579
Is User@User-PC the root user, or something else? Why does it still say that there's ssh processes still running?

Quote:
Originally Posted by allend View Post
It is considered poor security practice to allow root login via SSH. (An attacker knows the user name and the password is vulnerable to brute forcing). It is best to disable root login, connect via SSH as a normal user, then escalate privileges when connected.
OK. Am I supposed to do that from the Cygwin terminal or the sshd in my Ubuntu virtual machine?
 
Old 02-16-2015, 04:46 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Quote:
Huh? So I don't need PuTTY if I have Cygwin?
Cygwin provides a SSH client and a SSH server in the openssh package. So yes, you do not need PuTTY if you have Cygwin.
Quote:
is User@User-PC the root user, or something else? Why does it still say that there's ssh processes still running?
User@User-PC is the command prompt string in the Cygwin terminal. The 'User' is the user name in your Cygwin install and will have the same privileges on your Windows system as the Windows user that started Cygwin. The 'User-PC' is the host name of the Cygwin install.
Quote:
Why does it still say that there's ssh processes still running?
You get that message after running the 'ssh-host-config' command. That command is used to configure the sshd server daemon in your Cygwin. It probably arises because you need to stop the sshd daemon before using the command. (I must confess that in all my years of running Cygwin I have never run that command).
As an aside, you do not need to run the sshd daemon in Cygwin if you just want to do a SSH connection from Cygwin to Ubuntu.
This is a nice guide to setting up SSH in Cygwin. http://docs.oracle.com/cd/E24628_01/...cygwin_ssh.htm
Quote:
Am I supposed to do that from the Cygwin terminal or the sshd in my Ubuntu virtual machine?
The disabling of root login is done by editing the sshd_config file on the SSH server running the sshd daemon, in your case the Ubuntu machine.
Quote:
I have no idea what any of those things are.
Your screenshot shows that you are using the Cygwin terminal. If you were to have Cygwin running a desktop environment (I happen to use WindowMaker) then you have the X11 windowing system running. If you have X11 Forwarding enabled in the sshd_config on the SSH server, then you can connect to the SSH server using the '-Y' or '-X' options to ssh. You can then start graphical programs on your Ubuntu machine and have the display appear in your Cygwin desktop.

Be warned - playing these remote connection games can be addictive!
http://www.linuxquestions.org/questi...ml#post5050179
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[cygwin] How to use the cygwin.dll in Windows Programming Predatorian Programming 3 07-25-2014 10:45 AM
ring system bell of connected computer (linux ssh) i_have_a_question Linux - Newbie 1 04-27-2010 05:26 PM
Way to ssh to my computer using native windows apps? Titan485 Linux - Desktop 20 11-24-2006 06:53 PM
SSH with Cygwin UltraSoul Linux - General 0 07-07-2005 12:44 PM
Tunnel all internet traffic through a ssh connected remote computer Bateman Linux - Networking 12 12-10-2004 05:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:23 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration