Tag Info

New answers tagged

0

from the sshd manpage: If ~/.ssh/rc exists and the sshd_config(5) PermitUserRC option is set, runs it; else if /etc/ssh/sshrc exists, runs it; otherwise runs xauth. The “rc” files are given the X11 authentication protocol and cookie in standard input. See SSHRC, below.


2

DO NOT SET THINGS in limits.conf !! In many new distro releases, especially enterprise distros, you'll find limits.conf is being phased out, and used now only monolithic lethergic leviathan companies like Oracle -- where the contractors who built the templates rolled into each new release's install scripts are now all long gone, and the time required to ...


2

/etc/security/limits.conf, at least on Debian. Path may vary a little by distro. There is an example in the file to limit all members of the student group to 4 logins (commented out): #<domain> <type> <item> <value> @student - maxlogins 4 You could do * instead of a group, but make sure not to hit ...


2

According to the man of limits.conf you can set restrictions in /etc/security/limits.conf: maxsyslogins maximum number of all logins on system So you can set (2 logins): * hard maxsyslogins 2 In another post is said not to use /etc/security/limits.conf. I could not find anything related to that except that value which is set in ...


2

SSH connection goes down automatically after a specified period of time set by ClientAliveInterval and ClientAliveCountMax parameters and their client-side equivalents. If these timeouts are quite high you will experience a frozen shell. However, if you use OpenSSH you don't have to wait for a timeout and can force closing a connection using escape ...


0

Here are a couple of options for speeding up X11. Use compression with the -C flag (e.g. ssh -XC) Consider using blowfish or arcfour ciphers instead of the default AES (N.B. arcfour is less secure but over twice as fast AES-128/256-ctr/cbc). So you don't have to string all this out each time you can just drop it all in your ~/.ssh/config file like ...


0

I tried all the solutions and this was the best: ssh host "sleep 99 < <(cat; kill -INT 0)" <&1 http://stackoverflow.com/questions/3235180/starting-a-process-over-ssh-using-bash-and-then-killing-it-on-sigint/25882610#25882610


3

Assuming you believe the host really did change its host key you can delete the old entry. Since this one tells you the old entry is on line 2 you can do sed -i -e '2d' ~/.ssh/known_hosts to remove the old entry from you known hosts file


1

The other answers mistakenly seem to suggest that it is OK to use a service port which isn't used on your machine (as seen from the output of nmap localhost). It is not, because if you add that particular service later, you're going to be into trouble, and services that run on another registered service port are guaranteed to cause confusion. For ...


0

Adding to John's answer, the problem ended up being that I had configured my ddclient incorrectly. Changing use=if, if=eth0 to use=web in ddclient.conf fixed the problem for me.


0

You can check what local ports are in use currently to avoid a conflict with: #netstat -taulpn


1

It's related to your machine, Suppose : root@debian:/home/mohsen# nmap localhost Starting Nmap 6.47 ( http://nmap.org ) at 2015-04-16 04:57 IRDT Nmap scan report for localhost (127.0.0.1) Host is up (0.000025s latency). Other addresses for localhost (not scanned): 127.0.0.1 Not shown: 991 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp ...


2

You can choose any other port to your liking, e.g. anything between 0 and 65535 (0 … 2¹⁶-1). You can get the information for registered ports from /etc/services or something like wikipedia.


0

The approach to take depends on the specific scenario. It would be nicest if there already is a key that exists in the user’s authorized_keys on all of the servers that can be used to authenticate when adding the new key to the remote hosts, because otherwise you have to type in your password for each host. The simplest way to automate copying a ssh key to ...


5

No, you don't have to be logged in to run tasks in cron. Its whole idea is to keep track of scheduled tasks without any need of user interaction. You just set up a crontab and forget about it, no hassle with logging in is needed. Additional tip: you can run programs in the background easily by launching <command> & or, if for some reason you ...


4

cron runs whether you are logged-in or not. It's a daemon that checks items in the crontab (cron table) and runs them at the appointed time(s). If you had to be logged-in to do it, it would be pretty unhelpful - more like running a process in the background after a sleep, or in a loop.


3

Could you just run your commands in a screen or tmux session in the VM? That would allow multiple steps to connect/send commands to the same session


1

First off, I usually create a second sshd process with its own configuration file. (sshd -f /etc/ssh/sshd-2222.conf for instance) or by overriding the configuration on the command-line (sshd -p 2222 -o PasswordAuthentication=no,AllowRoot=no). This way they share the same keys, etc, but you can override any of the parameters. Any ideas why this happen? ...


4

Oh dear, triple ssh pipeline with a loop and useless xargs, you found the worst way of doing this. The \r you are seeing appears to be a leftover of the newline that is getting across the pipeline. You should remove the -t option, it may be the cause of your problems. Output meant to display in virtual terminals is different from the normal stream. ...


0

Try the this command: ssh -f ubuntu@ubuntu -L 9000:localhost:23 If this works, it may be a host file issue


0

I had a similar problem and wrote a wrapper around SSH to verify if the host was up or not using nc - https://github.com/cws-khuntly/dotfiles/blob/master/functions.d/F09-network Have a look at validateServerAvailability. Hope it helps.


0

mhahn said there was a bug in Yocto sshd killing all current cgroup processes when leaving ssh which has an easy fix (just didn't make it to the Edison build yet): poky - Poky Build Tool and Metadata i.e. in short: echo "KillMode=process" >> /lib/systemd/system/sshd@.service https://communities.intel.com/thread/57402?start=15&tstart=0


1

Try ssh -f user@host '<your command here>'. From the ssh man page: -f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask for passwords or passphrases, but the user wants it in the background. For example, if i do ssh -f <my computer> 'echo "hello $(pstree -p | ...


0

SSH can be invoked in a few ways. The most common way people invoke it is to use: ssh user@host This opens an interactive terminal. However, SSH behind the scenes actually has a calling style more like this: ssh user@host /usr/bin/foo So the first type basically just connecting and running bash for you, it's a convenience. It's basically doing this for ...


1

You need to allow your command line ssh to connect to an ssh server somewhere. Your existing ProxyCommand doesn't do that - it provides all the means to log in somewhere and there's nothing left for your initial ssh. This seems to work reasonably well for me, and I think I've got your chain right (obviously it's harder for me to test with the same hostnames ...


0

----- command.sh #! /bin/sh trap 'trap - EXIT; kill 0; exit' EXIT (sleep 1000;echo f) & read ans ----- on local terminal sleep 864000 | ssh -T server command.sh > foo


3

The Host directive can take multiple hosts, for example: Host *.domain.tld specific-host.tld 10.*.*.* User foo Port 2222 This would set user and port for all hosts matching the star pattern, the explicit host specific-host.tld, or, assuming you type IP numbers, any host whose first IPv4 byte is 10. Then you can add Host / HostName pairs to give nicknames ...


1

Try this on when launching qemu -redir tcp:2222::22 $ ssh -p 2222 localhost The tcp:2222::22 flag in the qemu launch command maps the 2222 port of the host machine to port 22 (the default ssh port) on the virtual machine. Then, simply sshing to the 2222 port on your localhost (the host machine) will redirect any traffic into the ssh 22 port in the ...


0

You might want to investigate mosh which is like ssh modified for unreliable connections. From the website: Mosh (mobile shell) Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes. Mosh is a replacement for SSH. It's more robust and ...


3

The reason this is failing is that, by default, ssh does not create a terminal (a pty) on the target machine. This means that su cannot prompt for a password, so it fails. (sudo would also fail to prompt, for the same reason, unless given the -S flag - as pointed out by @Scott.) You can tell ssh to create a terminal (pty) on the remote system, so that su ...


0

Is it possible to use sudo before the command you want to execute? Like instead of: su whatever command do: sudo whatever command


0

As I am not the only one encountering these entries, it seems to be the mailman upgrade that is responsiable for that. Thanks for sharing your experiences.


0

It's nothing harder than connecting to the Linux machine, setting DISPLAY variable to connect to the running X server and running an image viewer. Example: $ export DISPLAY=:0 $ ristretto <IMAGE> This assumes that USER has a right to connect to the X server instance running on LINUX machine. If he doesn't, X server owner must use xhost command ...


1

Also, FYI, in GUI version of Vim: gui is for formatting (as opposite of cterm) guifg is for foreground color (as opposite of ctermfg) guibg is for background color (as opposite of ctermbg)


0

I don't know the BBB but as said heemayl you can use screen (or tmux which I find more user friendly). Those tools allows you to connect to a remote machine, do what you want (starting a script for example), detach the session and reconnect to it later. The advantage of tmux is that it allows to create easily several sessions on the machine and slice them ...


3

You can have some kind of watchdog script running that requires a signal via the remote connection every n (milli)seconds and have it do something when not receiving the signal. See How to introduce timeout for shell scripting? for an example of an expect-script that prints a message on timeout; you can alter it to create a safe shutdown. The watchdog echo ...


0

If you have SELINUX enforcing, and your home directory is not under the /home directory, that is your problem. Targeted SELINUX settings assume all user home directories are under /home, so xauth doesn't work correctly because the SELINUX type on your home directory is not correct. I wish I could recommend a fix, but the one I found did not work. I set ...


0

These commands are for a task scheduler. There are several different ones, but this looks like the format for torque, which I am very familiar with. Torque - http://docs.adaptivecomputing.com/torque/5-1-0/help.htm Here is the torque 5 documentation. You may be running 2.x, 4.x or 5.x ...


1

The network is most likely blocking external requests on port 22. You do still have some options. Only proceed if you can verify you aren't violating university policy. Use a VPN Team viewer has a feature that will let you create a private vpn. If you can run a client on you lab pc, this is the simplest option. ...


1

Can some one explain me what the following code means if possible line-by-line. The commands beginning with "#PBS" are directives for the batch job summiting resource manager. Your cluster should have an administrator who can point you at the PBS documentation. Or, here's some I found on the internet: ...


1

Your ddclient is getting an invalid address for your home machine(s). You have to configure your ddclient to get your external home address, and you will very likely have to configure port forwarding on your cable modem or other external-facing device to get this to work.


1

You can use the option -i to specify to ssh which identity file it should use. Also have you checked with ssh - v what really happen? I mean the keys are really not used or are they used but doesn't match?


3

In order to fully utilize the system it presents all services the same resources and the kernel will try to keep all of them running with the same priority. You could set the nice level of the sshd process to the highest level. See here: http://serverfault.com/questions/355342/prioritise-ssh-logins-nice That won't solve your issue with memory. You would ...


0

If you use SSH, the user's shell as specified in /etc/passwd will be executed upon login. Set it to /bin/bash and you're done. You can set this with this command (as root): usermod -s /bin/bash <username>


0

Appending this line to sshd_config helped in my case (PyCharm and Ubuntu 14.04 via Docker): KexAlgorithms=diffie-hellman-group1-sha1


0

That sounds like a firewall or proxy block on that specific port is in place. Try tcptraceroute, it should help pinpoint where you are being blocked. tcptraceroute serveraddress 22 (Assuming the ssh server is on standard port 22.) Additionally use the ssh switch -vvv and examine the output. Pipe the output through tee, because there will be a lot. ...


2

This sounds like a firewall problem to me. Try using ssh with the -v flag for debugging output. This will give you a better clue as to what the problem may be. Also try to telnet to your ssh server on port 22 like this: telnet yourserver 22 You should get a response back with the ssh version number.


4

I am just trying to see if I am missing something here Something that you may take into account is that usually, as a sysadmin, you will have your own workstation and, in this workstation, you will have your user profile with your identity (i.e. your private key). And, if you are using several workstations, ideally, your user environment files will be ...


1

Using password authentication on your systems is bad practice for multiple reasons: As Atsby said, being able to connect from any computer also enables any computer to potentially connect to your systems, even compromised ones. Sticking to trusted machines is in your best interests. With password authentication enabled, a remote attacker can always bypass ...



Top 50 recent answers are included