Tag Info

New answers tagged

0

The home directory of the user should be relative to the chroot path. If you want to use /var/jail/home/user as the home directory, you will have to set the user's home to /home/user.


-1

I did a simple echo before ssh-keygen. So su - <user> -c "echo |ssh-keygen -t rsa" This was tested on Redhat 6


0

There are some requirements to get it to work: You need to set something (anything will do) in DISPLAY environment variable to activate SSH_ASKPASS feature. You need gpg-agent and tty-based pinentry program. On Debian/Ubuntu systems run apt-get install pinentry-curses and use /usr/bin/pinentry-curses. Run the script as follows: export DISPLAY=anything ...


0

You can find most of what you're looking for in /var/log/messages , which is where Linux usually puts logs. I usually run the following three searches with root privilege to get a good picture grep -ir ssh /var/log/* grep -ir breakin /var/log/* grep -ir security /var/log/*


1

Please, give more information on what SSH server you use (OpenSSH, dropbear, etc.). I'm using OpenSSH-6.6. It's configuration file is normally found in "/etc/ssh/sshd_config", although you can specify your own configuration file to the server as an argument to the "-f" option (for example, "sshd -f /my/config/file"). The config file has two options which ...


2

It's readable by remote_user and root. None other, unless remote_command is writing it to a globally readable file or something like that. You can inspect the environment of a process in the /proc filesystem in /proc/$pid/environ. You either need to be the same user as the euid of $pid or you need to be root, as the permissions of that file seem to default ...


0

That motd output is all generated by running scripts in /etc/update-motd.d/ on every login. The dynamic motd feature in Ubuntu is governed by pam_motd (see update-motd manpage for details), so you need to enable PAM login to see it. Alternatively, you can call the scripts in the system wide shell profile. Note that you'd better not use run-parts because ...


1

Hi First Way : You Can Use The Libeshell C++ Library For Writing Shell-like Console Applications with This Library You Can Creation Of Command-line And Shell-style Applications Second Way : Use The This Code For Execute The Command With C++ : #include <stdlib.h> int main(){ system("gnome-terminal -x sh -c 'mkdir /root/Desktop/New-Dir-1 ; ...


0

In Ubuntu, I use these commands: ssh -X user@host gnome-session or ssh -Y user@host gnome-session


0

Is the server configured to accept RSA keys? Look for RASAuthentication in the sshd_config file.


1

not yet possible. there is a pull-request for oob data which seems to work for some people, though: mosh/pull/583 all credits goes to guy named tribut from #mosh channel on freenode


0

The $HOME/.ssh directory mode must be 700 and authorized_keys should be readable by the owner only, i.e. mode 600: chmod u=rwx,g=,o= /var/git/.ssh chmod u=rw,g=,o= /var/git/.ssh/authorized_keys As to the private key, it must be read-write-able by the owner only: chmod u=rw,g=,o= /var/git/.ssh/id_?sa


4

For reasons of paranoia, the .ssh directory and authorized_keys must not be group-writable. I guess the thinking is, the user must be the only one with explicit control over his/her authorization. I believe a work-around for this lies with ACL. The other work around is StrictModes=no setting in sshd's configuration file. But it would be too dangerous to do ...


1

The problem is the fact that files permissions are too open. Try setting the mode of authorized_keys to 600 and the .ssh directory to 700.


0

I have the same problem in the Windows 2008 R2 environment but "useDNS no" does not work. I try adding to hosts file the IP and host of the connecting server and its faster by 30secs. Which makes me think that the resolution might be in DNS. I try adding DNS servers but this doesnt resolve it. My server have two DNS suffix. 1 for the corporate domain ...


1

I see "complaints" that mosh doesn't support X11 tunneling; I don't expect it supports anything other than an interactive terminal. Might get slightly nicer behavior in gnome programs if you use Files' 'connect to server' with url 'ssh://host'. I.e. gnome vfs might handle hangs slightly better. Or not.


2

The reason for this is that one of the login scripts on the target server is using stty... to set up terminal characteristics. The command fails when it doesn't have a tty, ie when you connect with scp. The solution is to protect the stty so that it runs only when an interactive session is present. There are a number of ways to do this; here are some ...


0

Create a file ~/.ssh/config, with contents: Host test01 Hostname 192.168.3.1 Then chmod it to 0600 and enjoy. You can add any ssh_config(5) options there (changing the remote username is a particularly useful one), and youy can have as many Host sections as you like.


0

Get a dns server up and running. unbound is pretty simple and allows for private authoritative zones.


-1

rsync can use directly ssh,using -e rsync -avP -e /home/share/ remote:/home/share otherwise a tunnel works fine,another solution can be stunell


2

I often use SSH port tunneling to create an encrypted channel. Since you're using an rsync:// URL I assume you have the rsync daemon running on TCP port 873 on the remote server. We can forward this port as follows: ssh -N -L 873:localhost:873 rsyncssh@server The -N option prevents the execution of a remote command, which would in your case disconnect the ...


9

I don't think any implementation of ssh has a native way to pass a command from client to server without involving a shell. Now, things can get easier if you can tell the remote shell to only run a specific interpreter (like sh, for which we know the expected syntax) and give the code to execute by another mean. That other mean can be for instance standard ...


0

I found the fix for it, just do : sudo rpi-update That updated the firmware, the kernel version, and whatever else was needed to make iptables work, now my fail2ban is working fine.


1

To make it work on other platforms this became the final solution. It checks if the ssh client disconnected and thus the parent became pid 1: $SIG{CHLD} = sub { $done = 1; }; $pid = fork; unless($pid) { # Make own process group to be able to kill HUP it later setpgrp; exec $ENV{SHELL}, "-c", ($bashfunc."@ARGV"); die "exec: $!\n"; } do { ...


0

You have two options here You can create a file with all the servers' IP addresses, then do the below while read -r ip;do ssh-copy-id -i .ssh/id_rsa.pub $ip done < servers.txt Assuming servers.txt is the file with IPs/hostnames You can put all your IPs/hostnames in a loop, and run ssh-copy-id like below for i in hostname1 hostname2 do ...


3

What you're asking for does not seem to make sense. Here I want to get root because the remote user is now root No, the remote user is now root. The fact that you've done sudo -s on the local system doesn't change that you're ssh'ing into the soyuka account remotely. The answer for "Here I want to get /home/soyuka/downloads" is similar. Is this ...


4

Using Ansible is fairly simple. Just replace <USER> with the real login name $ cd /path/to/public/key $ cat<<END > hosts host1.example.com 10.10.10.10 END $ ansible -i hosts all --ask-pass -u <USER> -m authorized_key -a "user=<USER> key='$(cat id_rsa.pub)'"


3

With ssh -D 8080 yourserver you can start a SOCKS proxy to your home server. Configure your client to use localhost:8080 as SOCKS proxy.


0

You can install zebedee in a USA VPS or dedicate and install squid beside it , then install zebedee client then enjoy it. Server side of it: zebedee -s -U But you have to write a config file for client: server false localsource true multiuse true tunnel 81:IP_OF_SERVER:3128 compression zlib:9 detached true You can use localhost:81 in your browser. For ...


1

You can use "Hola better internet" extension for Chrome browser.


5

ClusterSSH gives you a window on each machine and with a common window to control all windows. If we are talking 10 machines this will work. If we are talking 100 machines, there will be to many windows. The beauty of ClusterSSH is that if one machine is not 100% like the rest, you can just click the window, and send keystrokes only to that machine before ...


6

Alternative using xargs, sshpass and ssh-copy-id: Assuming your credentials living in credentials.txt in format user:password@server: $ cat credentials.txt root:insecure@192.168.0.1 foo:insecure@192.168.0.2 bar:realsecure@192.168.0.3 You could do: tr ':@' '\n' < credentials.txt \ | xargs -L3 sh -c 'sshpass -p $1 ssh-copy-id $0@$2' Note: ...


23

Rather than type your password multiple times you can make use of pssh and its -A switch to prompt for it once, and then feed the password to all the servers in a list. NOTE: Using this method doesn't allow you to use ssh-copy-id, however, so you'll need to roll your own method for appending your SSH pub key file to your remote account's ...


1

Using \$HOSTNAME is the correct way to escape the variable in this case. However, that variable often contains the hostname (non-fqdn), or may not be populated. You should rather use the command hostname -f to get your server FQDN. I don't know how will look like your final script, but connecting to server1 then check if this server is server1 may be some ...


2

This is entirely an issue with the command not being in your PATH. Unlike Windows systems the current directory is not implicitly in the search path for executables. To run a command such as ls (eg ls -l) it needs to be in your PATH, and indeed it is - type ls will show you it's either in /bin or /usr/bin. However, some.cmd is not in your PATH and so cannot ...


1

I need advice/best practice on how I can avoid keying in passphrase when I add this crontab to run everyday. Create a new ssh key with an empty password, specially for this task. Save it in a file, say, ~/.ssh/cron. Add its corresponding public key to ~/.ssh/authorized_keys on the remote machine. When you run your scp from cron(8) do it with the new ...


1

If you have the permission to use FUSE on your local machine, install the sshfs package. SSHFS lets you access remote files via normal filesystem access: it mounts a directory tree accessed over SFTP. You only need to have SFTP access on the remote side (which is enabled by default with OpenSSH on Ubuntu). Once the remote directory is mounted, you can use ...


0

When you run ssh, the standard input is passed to the remote command. The remote command doesn't actually do anything with it, but the local ssh process has no way to know. To avoid this, since you don't want to pass any input to the remote command, redirect the input of ssh to /dev/null. Don't forget to double quote variable substitutions. while IFS= ...


0

I know this question is old, but I wanted to share some findings I had. Check if /var/empty/sshd on the server has appropriate ownership and permissions. We had a chef script that was modified to update some directory permissions, but inadvertently updated the directory below the intended target, changing ownership of /var to an application user/group and ...


-1

I you have to pass the source folder before you state the -av -e switch: $ rsync /cygdrive/c/users/Owner/Pictures/ -av -e ssh blah@192.168.1.10:/var/files/ImageSync/


2

You can use a tar and ssh combintaion like this: sudo tar cvzf - folder/ | ssh -C user_name@host_name "cd ~/; tar xvzf -"


4

You can use scp -r to copy files recursively between different hosts. Your syntax could be like scp -r user@Ubuntu-Server:/home/myuser ./from_Ubuntu_server Besides, you might be able to upload your local rsync binary using scp to the Ubuntu server and add the --rsync-path=/home/myuser/rsync to your original rsync command to let your client rsync know which ...


0

I had the same issue on RedHat; checked logs and found that home directory had incorrect user rights. sshd[2507]: Authentication refused: bad ownership or modes for directory /home/user Fixing home dir rights solved this.


2

This looks like the linux host is configured to be some sort of RDP gateway. The command will initiate a SSH session to itself (root@localhost), start a local listener on port 3300 (L 3300:) to forward all traffic to a Windows machine on port 3389 (remote_WIN_machine1:3389), typical for RDP. I suspect that the GatewayPorts directive is set to yes in ...


1

I've just used a modified version on a virtual Linux Mint box to clone a physical hard drive on an ageing RedHat server. I ran the following as root on the virtual box: ssh root@192.168.1.5 "dd if=/dev/cciss/c0d0" | dd of=/dev/sdb 192.168.1.5 is the physical Red Hat Enterprise Linux 2.1 box. /dev/sdb is a new virtual disk, which when finished cloning ...


3

Without &, the script that you're executing remotely says “change to /root/myDir, then execute gedit and wait for it to exit”. The variant with & says not to wait for gedit to exit. Either way, the shell exits once it's executed the last command in the script. If you want to execute a script and then execute more commands that you type ...


0

how can i link godaddy to my vps to run codegen? I agree the question is not that clearly phrased. I am interpreting it to mean that you have a godaddy environment and you have a separate virtual machine which contains some script that you want to execute in your godaddy environment. You either have to pass the command to execute through SSH (piping your ...


2

One way of thinking of users are actual accounts which a person could log into on your server. But a more common view of users, which you should get used to for administration, is more like a system role. For example, if you install apache, you will see apache running as 'http' or 'apache' user. That is a legit user on your system, but noone could login ...


0

It should work fine, assuming you are not observing any errors with ssh. I would test with telnet to port 8989 and also look at netstat -an for listening connections and make sure you see connections being established all the way


0

As someone pointed out and I think is a good practice to have this directive PermitRootLogin no in sshd_config just in case. I had a ssh section on my jail local but now I see that I was missing a ssh-iptables section so it would add rules to iptables and now it works: [ssh-iptables] enabled = true filter = sshd action = iptables[name=SSH, port=ssh, ...



Top 50 recent answers are included