New answers tagged

-1

After the command below it all works on bigsur brew install rsync


0

My wireguard interface and my vio0 interface had mismatched MTU values. I set them all to the same value of 1420 with doas ifconfig $interface mtu 1420 up and that fixed it. Able to run htop and vim and tmux and screen and all that jazz as much as I want now without issue.


1

The simple answer is that no, there's no record of the original client stored on the final endpoint server. The server can only detect what IP address immediately connected to it, and the connection credentials (user, password or public key). From the server's point of view, the user is logged in from the jump host. The only record that may exist is on the ...


1

Why are you piping the output of head -n 1 into read -a array and then printing the first element of the array? try just | sed -e 's/^[^ ]* //' to strip everything before the first space instead. i.e. strip the timestamp from the beginning of the line). Quote your variables. using curly braces is not a substitute for quoting, their only purpose is to ...


2

A no route to host error message means the network interface is not up and running yet. Have you perhaps saved your network configuration as per-user settings? If so, then NetworkManager won't have access to that network configuration until you log in, and so cannot set up the network interface. If you configure the network interface using a graphical user ...


-3

If you run: ssh [ip addr] -l [username] what is the output? It should ask you for the user password. Enter the password and you're inside your kali linux machine. Also, instead of sudo systemctl enable ssh do sudo systemctl enable ssh.service.


0

I think you have a quoting issue. sshScript remote: remote, script: "./bash.sh $env.gitTag $env.Version"


2

The centos user is present on all CentOS cloud images. It doesn't have password set (if it had password it would mean all CentOS cloud instances share the same password), you should be able to SSH to it using your SSH key (usually you provide your SSH key when creating the instance, but this can be different with your cloud provider). If you don't want to ...


0

Allow root to access the remote system? You really do not want to do that. There should however, be a setting in /etc/ssh/sshd_config: # PermitRootLogin yes|no It's all in the man page.


0

Spent most of the day trying to get this to work. The problem is the minimalistic kernel and lack of pre-loaded apps especially the lack of support for Google apps. I deleted all apps that were flagged as "downloaded". This fixed the "Android is updating" boot message. I also stopped WiFi as I suspect it was sending usage statistics to a ...


1

The issue is likely that the non-root user on the server does not have a ~/.ssh/authorized_keys file, or that it does not contain the correct public SSH key. Copying the correct public SSH key to that file should make the login over SSH work. Related: Add a public ssh key to the authorized_keys of a user


0

I agree with @satch_boogie comment above - use ansible when you need SUDO and use pssh when you don't - its cleaner to SUDO in ansible IMO although initial setup is more involved. Short answer: Example updating and upgrading package with apt: ansible myservers -a "sudo apt -y update" --become -K ansible myservers -a "sudo apt -y upgrade" -...


0

I don't really know what you're trying to accomplish, but Termux is great as a client as well as ssh server. After the install you just need to install the openssh package with apt/pkg install openssh. (They use a wrapper so it doesn't matter if you use apt or pkg) They even have a wiki about it https://wiki.termux.com/wiki/Remote_Access A nice addition (if ...


3

Reading from your final-list directly and assuming that the remote system is a Linux system: while read -r a1 a2 remote a3 pathnames do ssh -n "$remote" stat -c %n:%y "$pathnames" done <final-list This further relies on the pathnames in the list of pathnames to be nice, i.e. that they contain no embedded whitespace characters or ...


2

I've done something like this before. Looping thru every lines: #!/bin/bash while read line; do host_ip=$(cut -d' ' -f3 <<< "$line") file_paths=($( cut -d' ' -f5- <<< "$line" )) for f in "${file_paths[@]}"; do ssh "$host_ip" "stat $f" done done < input-file


2

There is no home directory located at that location, as indicated by the error line Could not chdir to home directory /gel/usr/my_username: No such file or directory Usually home directories are located in /home/, for example /home/username. You can either edit the /etc/passwd file directly and input a proper, preexisting path, or you can utilize the ...


0

Your issue comes from having the shell expand the command substitution in the here-document locally rather than on the remote system. It does this because the here-document is not quoted. It would additionally expand both $NF and ${getValue} as shell variables to empty strings for the same reason (unless these shell variables had values previous). The ...


0

You need to quote your 'EOF' to prevent your shell from interpreting $ locally, ie. trying to run grep within your shell before the remote command. Compare: ssh username@remotehost << 'EOF' echo "THIS IS $(hostname)" EOF with ssh username@remotehost << EOF echo "THIS IS $(hostname)" EOF


2

The ssh client uses a shell variable SSH_AUTH_SOCK to communicate with the ssh agent. This variable contains the socket where the agent listens. If it is not set, or not set correctly, your ssh client can't communicate with the agent. I think this is what happens in your case: When you log on to your computer, SSH_AUTH_SOCK is not set. The ssh client doesn'...


1

A very simple generic command: sudo xauth merge /home/$USER/.Xauthority This activates the root environment and merges the xauth info of the current (non root) user. Another alternative, should prevent ownership problem reported in the comments on Slackware: cat ~/.Xauthority | sudo xauth merge -


0

As an alternative (especially in Linux where -K does something else), you can add the following line to your ~/.ssh/config: AddKeysToAgent yes This way when you first use a given key after reboot, you'll get asked for the password, but then SSH will keep it in agent. This way the password isn't stored anywhere and it's still very convenient.


2

ssh_config is the configuration file for the SSH client. There, the Port option tells it which port to connect to. That could be different for different servers, so you might want to have one port specified in one Host block, and another in another block. But you can only form a connection to just one port at a time, so I suppose the latter directive takes ...


0

authorized_keys is a file that allows you to add ssh public keys of users that should be allowed to log into your server (the server in which the authorized_keys file lives) using key based auth. known_hosts is a file that contains a list of keys from...known hosts that you have logged into. These keys pair an IP address with a server's key to help prevent ...


0

I had a similar problem when I ran ssh-keyscan github.com. I tried putting a custom -T flag to increase the timeout but there was no output whatsoever. So to debug the problem I ran ssh -vvv github.com to connect to github.com on port 22. The -vvv gave some debug information and ultimately the command ran to Operation timed out. So there might be a few ...


1

One way to save those parameters to have a quick access is to add the connection details to ~/.ssh/config. Something like this, based on the command line you provided: Host myredis Hostname 8.8.8.8 User root LocalForward 6479 127.0.0.1:6373 SessionType none You can then just run ssh myredis. You may add multiple hosts, and change details. ...


1

The problem was the /home permissions. I had a sneaking suspicion but refused to entertain the thought because I didn't see how the problem could have happened. As I jog my memory I vaguely remember mistyping a setfacl command when working on ACL entries for a directory. I accidentally did a setfacl -Rn [...] /home, which messed up the permissions that sshd ...


0

killall ssh is quite canonical - it sends the SIGTERM signal which is how you normally tell applications in Unix/Linux to exit. kill -l has a ton of options and among them is e.g. SIGQUIT and SIGINT which can also be used. Check this discussion for more info: https://stackoverflow.com/questions/4042201/how-does-sigint-relate-to-the-other-termination-signals-...


7

I'd suggest using a while read loop so that you can assign whitespace-separated tokens to individual variables, rather than relying on the implicit split+glob behavior of $(cat hosts) The only tricky bit is that read reads from standard input by default - and so does ssh. So you either need to pass the -n flag to tell ssh to read from /dev/null: while read -...


3

In your case, tee logs.out writes to the terminal, and will be killed when it attempts to write after the SSH connection closes. This will in turn cause nohup to be killed as well, the next time a.out writes to its standard output. If you want nohup ./a.out to survive, you should run it in the background with no pipe, and separately watch the nohup.out file: ...


-1

If you have enough space (in the remote server), you can made an archive first by something (for example x, creating something like a mycopy.x, launched by ssh), then transfer locally with rsync the mycopy.x If fact with some archivers you can even use --append, which reduce the traffic (for multiple runs, ex. daily) of about 2/3 orders of magnitude (~100x/...


2

sshd doesn’t need to decide which user a key belongs to; it knows which user is attempting to connect (user on the target system), and it knows which key is provided in the attempt. After expansion, the file pointed to by AuthorizedKeysFile is used to determine whether the provided key is allowed for the target user. Again, it already knows which user this ...


2

it's complicated tar ssh root@main_server "tar czf - /DB_TABLES" |tar xzf - -C /bck (note z before f as pointed out in comment, along with f - in extracting tar) Will transfer files from remote main_server to local /bck directory, since /DB_TABLES is not small, some files might have changed by the time transfert is done, and as a result /bck might ...


0

Try running your ssh line with the -t option and make sure your remote command is delimited by ' as that tells ssh to run the command on the remote host, making your line much more error-proof. ssh user@remoteHost -t 'ls' FYI: The -t option enables pseudo-terminal allocation which actually simulates opening an SSH terminal then typing the command, then ...


0

Just check if the environment variable SSH_TTY is set. See how to distinguish ssh from scp in ~/.ssh/rc? .


0

For me the issue was with the permissions of ChrootDirectory directory. Ehh, who cares about the custom permissions? I shall give the universal permissions, so that everything will covered in it. IS that what you thought before setting the permissions? Apparently, that is not how it works for Linux. I had a team coming up to me complaining about their new ...


0

I don't specifically know how sudo will behave in this context, however many programs which rely on a user interaction will fail if not connected to a tty when they are invoked. It would be simple to create a sudo privilege WITHOUT "NOPASSWD" and run it via cron or at to test: echo "sudo touch /tmp/writtenAsRoot" | at now (and check the ...


10

You can configure sudo to allow specific users (or groups) to run named commands; in /etc/sudoers (use visudo to edit it): user ALL = NOPASSWD: /path/to/command will allow user user to run sudo /path/to/command without being prompted for a password.


1

Since your phone is connected to the same local network as you laptop and since you presumably use the local addresses of the devices on that local network (i.e. not any public addresses or names), no data will ever be transferred through your Internet provider's router. It's on that router that your bandwidth is limited. This means that rsync will be able ...


1

as from comment. key comment may be located in public key file id_rsa.pub private key file id_rsa ssh-agent session ssh-add -l "original" comment is stored in private key file. (I expect this is in case of public key file being deleted) You can export you private key using ssh-keygen -e [-f input_keyfile] [-m key_format] You may need to play ...


2

The environment variable SSH_TTY seems to be set only when sshing, not when scping. So the following suffices (at least in my testing): if [ -n "$SSH_TTY" ]; then /usr/bin/neofetch; fi (For what it's worth, I guessed this by looking at the output of env | grep -i ssh.)


0

There are 2 scenarios: ssh_config is the config file for ssh-client. sshd_config is the config file for ssh-server. If sshd_config does not exists, then to install ssh-server. sudo apt-get install openssh-server


0

An audit "report" without context is about 100% useless Presuming what you've shared is all that is relevant from the report, there is no context You need to get full context for each of the claimed "findings" in the report They may be correct...they may not But as stated herein, there is nothing you can do to answer them if you've ...


1

You want to create a RemoteForward kind of tunnel rather than a LocalForward kind. RemoteForward Specifies that a TCP port on the remote machine be forwarded over the secure channel. So on the client: ssh -L 49499:localhost:4949 -f number9@myserver.com -p 2222 -N should simply be replaced with: ssh -R 49499:localhost:4949 -f number9@myserver.com -p ...


0

An addition for hashed known_hosts files. In hashed know_hosts files the hostname is hashed with a "salt". This means the lines of the same host are unique. But the sort command can be helpful. Just sort the file by the third column: $ sort -k3 -u ~/.ssh/known_hosts I tested it in Ubuntu Bionic with sort version "8.28". $ ssh-keyscan -H ...


0

For me, the issue got resolved by setting a "character tx delay" of 1 ms in minicom: CTRLA, Z, T, F, 1, ⏎, ⏎ There doesn't seem to be such a setting in screen. However, see How to set "character tx delay" in GNU screen? (Like in minicom) for something similar.


4

Your SSH server is properly accepting passwordless logins; based on the output of ssh -vv that you posted it has accepted your key: debug1: Authentication succeeded (publickey). The reason why you are being prompted for a password still is because your private key is encrypted and has a password set, as per the request for which specific password to input: ...


2

The issue that you describe is realated to sshd_config but with the following part. #PubkeyAuthentication yes You need to uncomment this line, as the next. PubkeyAuthentication yes After that, it's necesary the server will take this change, you will need to restart the service. systemctl restart sshd With this change you are allowing the RSA keys.


Top 50 recent answers are included