Tag Info

New answers tagged

0

Recently had this issue myself, because these solutions require you to re-enter the password every time if you use a password login I used sshpass in a loop along with a text prompt to avoid having the password in the batch file. Thought I'd share my solution on this thead in case anyone else has the same issue: #!/bin/bash read -s -p "Password: " pass ...


0

This is what worked for me: I created a new virtual machine (using VirtualBox) with the same Ubuntu version as the one that crashed. Then using WinSCP I downloaded the corrupted VM (i.e. VDI file) locally on my machine and mounted it as a drive on the newly created VM. Then I just copied the initrd.img files to root directory of the corrupted VM and it ...


0

Effectively, what I am doing is to do a "man-in-the-middle-attack". Therefore, the original question is kind of nonsensical and I retract it.


0

I can help you to connect your local build (Server-Software-Application?) to a local port, which is a tunnel to your database server. You should be able to connect to your localbuild via browser on port 8080 while your Server-Software-Application is connecting to the database server, which can be reached by a ssh-tunnel via the whitelisted server. If this ...


-1

If you're on a unix-like system, try cat ~/.ssh/id_rsa.pub | cut -c 9-28 This starts at 9 because the key file starts with ssh-rsa


0

I don't have 50 reputation points yet, so can not comment and had to put this in as an answer... there are some interesting points here: RSA vs. DSA for SSH authentication keys


0

Much better solution then tunnelling is using ProxyCommand, as described here: Forward SSH traffic through a middle machine To match your use case: Host tunnel HostName 192.168.1.27 Host target HostName localhost Port 2003 ProxyCommand ssh tunnel -W %h:%p or ProxyCommand ssh tunnel nc %h %p Then doing just ssh target does everything for you. ...


-1

I have been on the Windows Evaluation, and had not heard of that ability. Dokan is an option, but I have not tried it on Windows 10. https://code.google.com/p/win-sshfs/


1

Yes. This is expected behaviour. You don't want to have processes from logged out users hanging around your system. For this use case, there are services. Internally, it is basically caused by the fact, that ssh is waiting for the time when the executed process will close file handles (stdin, stdout, stderr), which are redirected to client. By running ...


1

Of course it is encrypted! Just to understand well what is going on here: [ client $ ssh destination ] | '-> [ gateway $ nc destination 22 ] | '-> [ destination $ whatever] On client you run just ssh destination. This is translated into ssh gateway nc destination 22. So first executed command is ssh gateway with command. We have ...


1

Specify an ssh: URL which allows you to set the port. git remote add <repoLocalName> ssh://<hostX>:2222/public_html/test


0

You cannot SSH to machine, that cannot boot. In no way. You have to ask someone with physical access to machine (hypervisor management console in your case) to fix the problem. For removing old kernels under Ubuntu you should use apt-get autoremove.


1

The initrd.img files contain all the drivers required to boot your VM. That means it probably can't boot to the point where the network is up, let alone sshd. You'll need to get console access and (virtual) CD access, and boot from an ISO file. Or else roll back to a snapshot before you deleted the files from /boot. You shouldn't delete files from /boot ...


0

There is an option for that in your synology configuration gui/web interface. Depending on your synology version it might be in different places. I woudn't recommend to do that over ssh as synolgy reads the configuration from an xml file and generates the service config files dynamically during boot which are then stored on a tmpfs mount.


1

The best-practice method for copying public keys to remote servers is by using ssh-copy-id. ssh-copy-id [-i [identity_file]] [user@]machine I would suggest to delete the created authorized_keys files and copy over your key again with ssh-copy-id. ssh-copy-id -i /opt/gitquery/gitquery-rsa gitquery@company During key generation you just have to press ...


1

Create a new user account. Password 8+ digits 1+ upper, 1+ lower 1+symbol and 1+ special character. Use iptables and/or ipset to block ip's you won't be coming from, or create allow rules for ip's with CIDR you will be coming from. install and configure fail2ban in case they try and brute force you.


2

You mentioned cronjob running randomly; have you checked the cronjobs with crontab -l for anything unusual? Is the account that was compromised the root account? Even if it isn't, have you checked the last logins and cron entries for the root account as well, if you have root access? I've seen dictionary attacks from IP addresses throughout the world on a ...


0

madeddie gave me an answer in their last comment: to stop the instance, detach the EBS volume, and attach the EBS volume to another instance.


4

Sure: ProxyCommand "~/bin/connect-via-dropbox %h %p" …where the connect-via-dropbox script would look up the IP address from your Dropbox, then connect to it using nc, socat, or ncat. For example: #!/bin/sh host=$1 port=$2 file="$HOME/Dropbox/Server IPs/$host.txt" if [ ! -s "$file" ]; then echo "error: '$file' empty or not found" >&2; ...


2

You can use backquote -->`<-- to substitute a command with its output Something like ssh `cat file`


0

I finally realized what happened. So the setup at my apartment setup goes from my raspberry pi -> my router -> apartment's own router/switch -> internet. So I figured out I wasn't able to port forward incoming traffic because the incoming traffic first hits my apartment's personal router/switch before it hits my own router! I have no access to this so I have ...


0

The ssh -L syntax with the ports you've listed would be: ssh -L 8899:<Host B>:22 user@<Host A> This would listen on port 8899 on , and anything it receives will be forwarded via ssh to and from there sent to in the clear. will think it's communicating with something running on I'm not sure how this would help you. You can chain up ssh ...


13

ssh does not support passing a password on the command line, it is interpreting the -pw as "Connect to port w". In order to do automated logins via ssh, use .ssh/authorized_keys: On the OSX terminal, create a key using ssh_keygen. If you accept the default filenames, your ssh client will automatically try this key when it connects. Copy the contents of ...


8

What you're trying to do is impossible with the built-in SSH client in OS X. The OpenSSH client is incapable of accepting a password from the command line. The reason you're getting the "Bad port" error is because the -p flag is used to specify the port to connect to and the -pw flag does not exist. See the man page for more details. Additionally, it's ...


1

I have written a bash script which does a kind of similar thing, exhausting local CPU cores. When a core frees, it calls a new calculation, until the calculations are finished. I also have a bit of experience scripting bash with ssh (it requires a passwordless ssh-key, if you are comfortable with that security risk). This is a personal example out of ...


3

The reasons could be various, of course. The most obvious answer is that, for one reason or another, you cannot be authenticated by the remote system. However, since you are outputting the directory permissions on the remote system, I assume you have the rights and ability to access it by some means (but perhaps not by ssh). So, the first thing to do is ...


1

If you login as The root then root has all permissions allowed, regardless permissions on any directory (exclusion can be only if directory has system immutable flag over chflags(1)) You either providing a wrong password or remote host used public key authentication only.


0

I tried to google this as well, since adding custom SSH Keys with OpenSSH is available in the Tools section in SourceTree(ST) for Windows. Although I was able to ssh -T successfully from terminal, ST for Mac was denying access. Finally, I thought of adding the keys to my agent again. Now, when I checked the list of identities added - there were none ...


0

The idea is that your IP doesn't change. If it does change, you can update it in the Security Group either via the AWS console or via an API call. The guide doesn't assume you have an IP that changes often. If it does, either ignore its advice and open SSH to the world (or perhaps the IP range your ISP uses for customers) or write a script that updates the ...


1

Solved for no reason, maybe the config file was reloaded when my mac went to sleep. Thank you.


0

Quoting from PuTTY documentation : Not all features are accessible from the command line yet, although we'd like to fix this. In the meantime, you can use most of PuTTY's features if you create a PuTTY saved session, and then use the name of the saved session on the command line in place of a hostname.


1

To answer this question So when I try SSHing from the outside world through my router, it doesn't know where to go because we have a shared IP address. I have no idea how to deal with this exact situation. You need to assign a specific port on your shared IP address to port-forward to your Raspberry Pi's port 22. How you do this depends on your ...


0

If you do not want to have to specify environment variables every time you run git, do not want another wrapper script, do not/can not run ssh-agent(1), nor want to download another package just for this, use the git-remote-ext(1) external transport: $ git clone 'ext::ssh -i $HOME/.ssh/alternate_id git.example.com %S /path/to/repository.git' Cloning into ...


0

You have probably set up ClientAliveCountMax 0 and some ClientAliveInterval option in sshd_config (or there is used some default value). Setting these values to something non-zero should allow server to send keep-alive messages that will verify that client is still responding. There should be similar option on client (in openssh called) ...


1

I would guess user@server does not have read/write/execute access to /mnt/test.git: $ sudo sh -c 'cd $(mktemp -d) && git init --bare' Initialized empty Git repository in /tmp/tmp.TNLcXTZQcN/ $ cd $(mktemp -d) $ git remote add /tmp/tmp.TNLcXTZQcN fatal: Not a git repository (or any parent up to mount point /tmp) Stopping at filesystem boundary ...


1

Multi-part answer: If chat screen is not started then start it, otherwise close it. screen -S chat -X quit || screen -S chat Could also detach rather than kill the screen session, if that's what you meant. execute a command in chat session (ex: node chat.js) If you mean to start a new screen and execute a command, then screen -dm ...


1

No. You can run only "new" commands from remote shell that will use your display (X server). It can't be also used for running full featured graphical session, nor to view whole "Desktop" like VNC and it was never intended to.


0

I have no idea what this command really does but running it changes the wireless channel. $ rc start


1

it's still attached. Meaning you can't reattach with -r. Try -x instead. This should work. With -x, you have multiple parties attached to the same screen Edit 1 You can also remotely detach a screen with -D. Or combine it with -D -r. Force it with -D -R. Or even do everything your possible by saying -D -RR. -x only allows you to use this screen with other ...


0

The error message says it all: your host does not know how to get to the destination, because the destination host's IP address or network address is not on your routing table. Enter netstat -rn. You should see something like: Destination Gateway Genmask Flags MSS Window irtt Iface ...


0

Seems to be working with port 35. I didn't realize port 25 was generally used for something else. Switching to another port and setting it up as a static IP seems to have solved the problem.


0

You could run commands based on a signal trap. Usually a disconnection would end the shell with a SIGPIPE, so add this to the .bash_profile trap "echo do your command here; exit" 13 You need the "exit" otherwise the shell won't close as a result of the trap.


1

The strength of your computer system(s) is only as strong as the weakest link. Using SSH keys is a far stronger approach than username/password, but if username and password is still an option then that is your weakest link. If you were to disable password authentication on all the other computers, it would be marginally safer only due to the fact that your ...


1

Short answer: yes. The reason is because instead of tunneling directly from computer A to computer D you are hopping through B, and C as well. Each computer has it's own latency and service running that must perform the proper processes to decrypt the incoming traffic from one end, and re-encrypt the traffic going out the other end. How much is will slow ...


1

If you want to transfer a local file to the remote system use the following: scp ~/filename remoteUserName@remoteIP:~/path Don't put your local userid and system before the name of the file you want to transfer.


2

You should have << instead of <<<. Or perhaps: ssh -t -t server-a.com ssh -t -t server-b.com '" cd /pylons/web/app/ . envs/bin/activate paster shell /lib/config.ini "'


0

I'd say that many business and corporate environments use technology that's often outdated yet this fact is overlooked due to the following issues: Poorly technically-informed higher-ups that don't consider cybersecurity The fact that companies usually must have a software license for each version of any piece of software Sometimes a network is built on a ...


0

After resizing your terminal, you need use resize command. eval `resize` nowadays just resize works. resize This command changes LINES, COLUMNS environment variable. You can check your current terminal size with echo $LINES $COLUNNS. try echo $LINES $COLUMNS before and after resize.


1

What if you put after you ruby shell exit? ssh -t -t dev.example.com <<EOF cd var/dev/ ...other commands... exit EOF I am not sure about you ruby command, but this worked for me.


0

When you connect to the VPN, you get the IP from the VPN server, that makes you appear local to the remote network your VPN client connected to. So when you ssh you are as free to ssh as any computer on the network you connected to. You are not clear when you say both services are running on the same machine. Both involve a client and a server on different ...



Top 50 recent answers are included