ssh

rvham

New Member
Using Linux computers. Both have ssh installed and putty. Have ip address for both computers. When I put the ip address in putty for the other computer and hit enter only a black box appears. Both using port 22. Neither one is set as a server. Both on same network. Been watching youtub vids but dead end so far. What am I missing? Thanks
 

beers

Moderator
Staff member
Make sure the server daemon is installed as a package. You'd also need the server component to be running as a service. This is on ParrotOS but probably has the same package names in Ubuntu/Debian.

Also, why did you install Putty on Linux in order to use SSH?

─[beers@deathstar]─[~]
└──╼ $apt search openssh-server
Sorting... Done
Full Text Search... Done
openssh-server/parrot,now 1:8.4p1-5+deb11u1 amd64 [installed,automatic]
secure shell (SSH) server, for secure access from remote machines

┌─[beers@deathstar]─[~]
└──╼ $ssh localhost
ssh: connect to host localhost port 22: Connection refused
┌─[✗]─[beers@deathstar]─[~]
└──╼ $sudo service ssh start
┌─[beers@deathstar]─[~]
└──╼ $ssh localhost
beers@localhost's password:
 

rvham

New Member
Installed putty from watching youtub vids. Later saw where its for winblows. If I install the server on one of the computer can it be easily be hacked from the outside. Also want to thank you for your input.
 

rvham

New Member
Found an linux laptop with MX on it and installed openssh-server on it. In terminal I put user name@ip address and I get the connection refused. Firewall has port 22 open.
 

rvham

New Member
reinstall this command on the 2 desktops and laptop sudo apt-get install ssh. Connected went through. Now just seeing what can be done with it. Thanks again for your help and Happy New Year.
 

beers

Moderator
Staff member
Installed putty from watching youtub vids. Later saw where its for winblows. If I install the server on one of the computer can it be easily be hacked from the outside. Also want to thank you for your input.
Without a running daemon you'll never be able to connect. Also there's no ability to reach inward to your network without port forwarding due to NAT. Your idea of having a running LAN service = being hacked isn't really based in reality.

I have an internet exposed SSH service, even just using pubkey and keeping the service up to date has been sufficient for years.

Found an linux laptop with MX on it and installed openssh-server on it. In terminal I put user name@ip address and I get the connection refused. Firewall has port 22 open.
I can almost guarantee you didn't start the service, which was the entire reason I included specific output.

┌─[beers@deathstar]─[~]
└──╼ $ssh localhost
ssh: connect to host localhost port 22: Connection refused
┌─[✗]─[beers@deathstar]─[~]
└──╼ $sudo service ssh start
 
Last edited:

rvham

New Member
The way the computers (2 desktops, 1 laptop) are setup now I can SSH into them using the command "ssh name@ip". Installed ssh-server on the laptop and with the laptop turned off can still ssh into the desktop from the other desktop.
 

beers

Moderator
Staff member
You also don't have to specify the name if it's the same username you're already using, the client will forward that for you.
 

rvham

New Member
From my Mint computer I ssh into my MX computer. From there I went to a directory to copy a file using this command:
scp filename user@ip:/~/Home/user/Desktop (is this syntax correct?)
When I hit enter and put pass in it says no file or folder found
Hope this makes some kind of since.
 

beers

Moderator
Staff member
/~/ isn't a directory, but ~/ is a shortcut to your home directory, which is a relative path. Some platforms are sensitive about requiring absolute paths (like /home/username/ instead).

You can run similar commands on the target PC, cd /~/ will give you the same error, since it isn't a valid path.

┌─[beers@deathstar]─[~]
└──╼ $cd /~/
bash: cd: /~/: No such file or directory
┌─[beers@deathstar]─[~]
└──╼ $echo test > testfile.txt
┌─[beers@deathstar]─[~]
└──╼ $scp testfile.txt remotehost.domain.or.ip:~/
testfile.txt 100% 5 0.2KB/s 00:00
┌─[beers@deathstar]─[~]
└──╼ $ssh remotehost.domain.or.ip "cat ~/testfile.txt"
test
 
Top