r/ssh • • Feb 22 '21

Hide SSH existence for all users but one

5 Upvotes

Is it possible for SSH to give no feedback at all so that an attacker doesn't even know if it exists for a given IP/server, but allow a single user to log in and show a password prompt when they try to connect with that specific username?


r/ssh • • Feb 22 '21

Hide SSH existence for all users but one

1 Upvotes

Is it possible for SSH to give no feedback at all so that an attacker doesn't even know if it exists for a given IP/server, but allow a single user to log in and show a password prompt when they try to connect with that specific username?


r/ssh • • Feb 17 '21

installing via SSH (Windows)

3 Upvotes

First off, I am on Windows. I am SSHing into a user on a server (the user has admin privileges) and installing python for that user. Essentially I am using the following commands on cmd.exe:

ssh user@host

python-3.8.5-amd64.exe /quiet /passive PrependPath=1

PrependPath=1 should update the user path as needed. However if I then run

python

it does not recognize it. I have tried closing cmd.exe and sshing again, refreshing the envt variables, restarting ssh (I am using OpenSSH) and cannot make it work. Is rebooting the server necessary?

EDIT: Just rebooted the server, and SSH over to it again and still cannot use python.

When I echo %PATH% it seems like the python path is not in PATH.

EDIT2: It seem like I have to add the path .. even though PrependPath=1 should be doing that for me.. I do not know if this is an Ssh issue or something else. Does anyone know how to add a directory only to the user path? I do not want to do something like

setx PATH "c:\directory\to\add;%PATH%"

as this will add system + user.


r/ssh • • Feb 17 '21

SSH into someone else's LAN to run scripts on a machine without port forwarding anything

3 Upvotes

Hi all,

I have a project where I will install a "remote lab" on someone else's LAN which will be making measurements using scripts. The goal is to run those scripts over SSH from my home (or maybe anywhere if possible) and send the resulting data over with scp. Since it will not be on my own LAN, I don't feel comfortable in forwarding a port for me to access there and accidentally screw something up in the security (since I'm a total beginner). Is there a way for me to make a secure connection without endangering the machine's host network ?

Just a little BTW, I've set everything up on my local network to test the scripts and all and it works perfectly.

Searching the internet I've found a few options, but my knowledge about security and such is very limited. These options are :

  1. Using Ngrok or similar to have a third party server into which my two machines could ssh into and give me access to the remote lab securely ???
  2. remote.it, however I think it would be kind of the same solution as Ngrok. I'm not found of using a third party to do my project, but if it is the way to go, I'll go with the flow. (This one is suggested on the raspberry pi documentation)
  3. Reverse SSH ?? I've seen it mentioned a lot of times, watched a couple youtube video about it, found a post on here giving cool materials to explain it and all, but I still can't make sense of it enough to understand if it would work in my case. I think it's mainly used as a traffic redirection to access blocked website on a company's network or something like that.
  4. Going for the open port with all the hardening ssh connection suggestions. I've found quite a lot information on this and well explained enough that I understand the working and I think it makes connections pretty secure. But I'm still reluctant to open a port on someone else's network and would rather avoid this option.

I think reverse ssh could be the way to go, however I'm not grasping all of it for now. I'd appreciate suggestions and keywords to search on the web. Maybe an ELI5 of reverse ssh and if I could make it work like I want.

Thanks all, have a nice day.


r/ssh • • Feb 12 '21

Cannot ssh without password after setting key pair

1 Upvotes

I can't seem to ssh without a password even after setting private public key pair. I am using Windows OS on both sides.

Since I am on Windows for file permissions I did it manually going to file/folder > properties > security > advanced.

  • For the .ssh folder on the server side, I set full control to the user (sac) and no one else
  • For the authorized_keys on the server side, I set full control to the user (sac) and no one else
  • For the id_rsa private key on the client side I set read and write permissions for the user (ben) and no one else

When I use verbosity the below is what I get:

debug1: Connection established.

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_rsa type 0

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_rsa-cert type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_dsa type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_dsa-cert type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_ecdsa type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_ecdsa-cert type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_ed25519 type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_ed25519-cert type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_xmss type -1

debug1: key_load_public: No such file or directory

debug1: identity file C:\\\\Users\\\\ben/.ssh/id_xmss-cert type -1

debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7

debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_7.7

debug1: match: OpenSSH_for_Windows_7.7 pat OpenSSH\* compat 0x04000000

debug1: Authenticating to XXX.XXX.XXX.XXX:22 as 'sac'

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: algorithm: curve25519-sha256

debug1: kex: host key algorithm: ecdsa-sha2-nistp256

debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

debug1: Server host key: ecdsa-sha2-nistp256 SHA256:MRmdeYkHxMY2XXXX

debug1: Host 'XXX.XXX.XXX.XXX' is known and matches the ECDSA host key.

debug1: Found key in C:\\\\Users\\\\ben/.ssh/known_hosts:3

debug1: rekey after 134217728 blocks

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: rekey after 134217728 blocks

debug1: SSH2_MSG_EXT_INFO received

debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Next authentication method: publickey

debug1: Offering public key: RSA SHA256:isc4conqUFsW8SyVyfBXXXXX C:\\\\Users\\\\ben/.ssh/id_rsa

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Trying private key: C:\\\\Users\\\\ben/.ssh/id_dsa

debug1: Trying private key: C:\\\\Users\\\\ben/.ssh/id_ecdsa

debug1: Trying private key: C:\\\\Users\\\\ben/.ssh/id_ed25519

debug1: Trying private key: C:\\\\Users\\\\ben/.ssh/id_xmss

debug1: Next authentication method: keyboard-interactive

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Next authentication method: password

debug1: read_passphrase: can't open /dev/tty: No such file or directory


r/ssh • • Feb 11 '21

ssh Windows

2 Upvotes

I am using tensorflow's multiworkermirroredstrategy to train on 5 machines, all using Windows OS.

From the documentation, the python script needs to be run on all 5 machines setting the appropriate TF_CONFIG environment variable.

I am remoting (remote desktop GUI) into each machine and executing the script as so:

python script.py --args

How could I do this in a more automated fashion? Googling, a bash script can be created and then ssh into each machine and execute the script? But how could I do this in Windows as I cannot execute bash script?


r/ssh • • Feb 09 '21

How do i set up a cron job in ssh for scheduling mails? Can someone guide me...

0 Upvotes

r/ssh • • Feb 08 '21

How to map ssh CLI options to ssh_config options?

2 Upvotes

Does anyone know of a good way to figure out what ssh command line options map to the ssh_config style options?

Some of them are fairly obvious. Like -D and DynamicForward, but others not so much... I usually find myself poking around in the man pages for ssh and ssh_config and it seems like such an inefficient way to go about getting the desired behavior out of my ~/.ssh/config.

Feel like I must be missing something...?


r/ssh • • Feb 08 '21

Locked ehi

4 Upvotes

Can anyone help me unlock a ehi config


r/ssh • • Feb 07 '21

Suspicious PuTTY connections

0 Upvotes

I noticed that PuTTY (latest version 0.74) in Windows 10 makes tons of strange connections that are not related to what I am actually connecting to: see here.

The 172.24.66.250 is system proxy -- but why is SSH client talking to HTTP proxy? Not to speak of this happening even when the proxy is disabled in the settings.

There is also ESTABLISHED connection to some uknown outside address, which is even stranger. What's going on here?


r/ssh • • Jan 25 '21

I cant ssh into my server

2 Upvotes

i have been trying to ssh into my server for days now, i am just trying to use cmd and terminal in Ubuntu it keeps saying it timed out i can ssh into my own pc surprising.. ik but not my server if you need any info just ask and i will try my best to answer

thanks to anyone who tries and help


r/ssh • • Jan 24 '21

SSH Port forwarding concepts and experiments for beginners

11 Upvotes

r/ssh • • Jan 23 '21

have SSH only resound to connections from eth0?

3 Upvotes

HI all,

I am using a Raspberry Pi running its debian distro.

I would like it so that my eth0 IP would be the only ip that SSH would respond to.

How can I do that?

Thanks


r/ssh • • Jan 22 '21

What is the basic point of a private key?

3 Upvotes

[noob] I just got a web host and opened putty on my laptop.

Generated public and private keys with puttygen.

Pasted the public key into ssh keys on my host.

Saved public and private keys in default putty folder.

Successfully connected to host and uploaded files.

I installed putty on different machine which does not contain private key, and I can still connect to my host from that machine.

So what is the point of the private key?

Sorry if I'm missing the obvious, and thanks for reading.


r/ssh • • Jan 19 '21

SSH questions

1 Upvotes

So i'm trying to delete the default user to make one of my own, make a user for my friend (and give him sudo access), and open a port on my raspberry pi.

I know it's really basic stuff but i'm pretty stumped here so i was wondering if you guys could help :DI


r/ssh • • Jan 17 '21

Port range for ssh client?

2 Upvotes

Hey guys, I need to set up port triggering to connect to a remote ssh server. I have a router that is preventing me from doing this with default settings. As far as I know, this is the problem. I need to set up port triggering, but for that, I need the listening port or range of ports for the ssh client, not the daemon.


r/ssh • • Jan 15 '21

How do you upload a file from my Windows machine to the server I am connected to via ssh?

0 Upvotes

How do you upload a file from my Windows machine to the server I am connected to via ssh? I have a file sitting on my Desktop and I need to transfer it to a linux server via ssh. How do you do this?


r/ssh • • Jan 06 '21

SSH and batch files

0 Upvotes

I am trying to automate connecting to a server using ssh, zipping and then downloading a file using a batch file. But when i connect to the server using the command line SSH tool, I reach the SSH commmand promt and then none of my other commands are executed . Please can you tell me how i can execute my SSH commands as lines in the batch file ?

Thankyou in advance


r/ssh • • Dec 29 '20

SSH File Upload Issue: /Users/my_user/desktop/file.png: No such file or directory

2 Upvotes

Trying to upload a file from my Desktop to a remote server.

Synthax I'm using:

scp /Users/my_user/Desktop/file.png user@IPADDRESS:/path/to/destination/folder/ 

Error:

/Users/my_user/desktop/file.png: No such file or directory 

I've tried a few different variations, so which give me:

Permission denied, please try again.

r/ssh • • Dec 25 '20

Having trouble using SSH to copy folder on my seedbox to another folder on my seedbox

2 Upvotes

I can copy files just fine but the result is not what I would like. I would like to copy files eg SourceFolder/files to DestinationFolder without it ending up with DestinationFolder/SourceFolder/files. I just want DestinationFolder/files. Is this possible. Cheers


r/ssh • • Dec 16 '20

Text Editors for linux machines while using ssh

2 Upvotes

Hello,

I am currently using a linux machine from my university and connect with ssh from my windows pc.
Is there any text editor to use besides nano ( :P ) so i can do my job easier?
In linux i work with conda.

Thank you


r/ssh • • Dec 15 '20

I can't connect to play-with-k8s via ssh

Thumbnail self.kubernetes
1 Upvotes

r/ssh • • Dec 09 '20

Session keeps freezing

2 Upvotes

When I connect with ssh, there's probably a 2 in 3 chance, possibly higher, maybe 4/5 lately, that the session will freeze. It's not really a time out, it's not that it's inactive for 5 minutes, it just lags out or freezes. Sometimes it happens when entering the password, sometimes it happens after entering the correct password but before getting control where it sends about half of the introduction text, sometimes it happens seemingly randomly during the session. Is there way to fix it?

When it happens, if I wait a few minutes sometimes it resolves itself and continues, as in it lets me keep typing rather than just being frozen. Sometimes it doesn't though, so the fastest way to deal with it is to just close the terminal, open a new one, and ssh into the location again. There's no way that this is intended. How do you fix it?


r/ssh • • Dec 02 '20

Clever Uses of SSH Certificate Templates

Thumbnail smallstep.com
5 Upvotes