Tag Info

New answers tagged

0

Since you are fine with letting untrusted users add their public keys to the authorized_keys file of the git user, then you might as well let them know the password for git.


0

Simply give read and execute access to /var/www/ and read write and execute access to ucp cd /var/www/ chmod 777 ucp cd ../../ chmod 555 /var or even complicated by making execute access to /var/www but in this case you have to make sure that user will type a complete path to reach at ucp cd /var/www chmod 777 ucp cd ../../ chmod 111 /var Note:- ...


0

Found an answer to my own question. Cron does not set the environment variable USER. Thus, one solution is to run mbsync from inside a script like this: #!/bin/sh USER="YOURUSERNAME"; export USER mbsync gmail


0

Depending on the version passwd you can try passwd -f #Forces the user to change password at the next login by expiring the password for name. passwd -e, #--expire Immediately expire an account's password. This in effect can force a user to change his/her password at the user's next login.


1

Changing the login shell does not necessarily prevent users from authenticating (except in some services that check if the user's shell is mentioned in /etc/shells). People may still be able to authenticate to the various services that your system provides to unix users, and may still be authorized to perform some actions albeit probably not run arbitrary ...


1

The X application needs a screen to connect to and normally (if you connect via ssh using -X that is your local screen). What you can do instead is use Xvnc and create a virtual screen for you X application to connect to and then, after logging back in, use a vncviewer to observe what is happening on this virtual screen. This functions in a similar way as ...


1

You can use chsh command: ~# chsh myuser Enter new shell details when requested: Login Shell [/bin/sh]: /bin/nologin Or shorter version: ~# chsh myuser -s /bin/nologin


0

What error did /etc/init.d/sshd reload give? This is a correct method to make sshd pick-up config changes.


0

I was getting this due to my ISP's nameservers in /etc/resolv.conf. These nameservers are often overloaded and if reverse DNS lookup fails sshd will drop the connection. I solved the problem by using more reliable nameservers, e.g. 8.8.8.8.


1

You don't need to install Expect on the server. Write an Expect script instead of running expect from a shell script. Have the Expect script itself spawn the SSH client, connect to the server and then loop through the numbers. To save yourself some effort you can record a session where you log in to the server and try some number with autoexpect. Save the ...


3

First step is to generate a private-public key pair on the machine you copy from: ssh-keygen You can go with the defaults, and make sure you don't provide a password for usage. This can take a bit of time. Second step, after the key generation has finished, is to copy the public key to the server using: ssh-copy-id username@server with the appropriate ...


1

There is sslh. It can multiplex the connections depending on what type of client is asking. So if a webbrowser comes along it will forward it to nginx and if a ssh client tries to connect forward it to the sshd. The README.md will hook you up with a nice explanation on how it has to be configured.


0

I ran into a similar problem and followed the steps using the debug mode. /usr/sbin/sshd -d This showed the following result debug1: trying public key file /root/.ssh/authorized_keys debug1: fd 4 clearing O_NONBLOCK Authentication refused: bad ownership or modes for directory /root debug1: restore_uid: 0/0 debug1: temporarily_use_uid: 0/0 (e=0/0) debug1: ...


0

There is no workaround. In order to mount the encfs filesystem, the server has to get ahold of your password somehow. If you don't supply your password, there's no way the filesystem can be mounted!


2

SSHd does not ban IP addresses. Whenever it encounters an authentication failure, it adds an entry to its log, and keeps going. Other pieces of software, however, may read these logs afterwards and ban IPs according to their rules. The most common daemon used for such a task is fail2ban. Fail2ban works with jails. Each jail is associated to a service, a log ...


0

Sound like a config issue with the "/etc/ssh/sshd_config". Change the below line from PermitRootLogin no To PermitRootLogin yes And restart the ssh service


0

I have the same issue and SSH with -X or -Y gives same result. Here is the reason and "answer" in form of a workaround. The reason is that the menu background aka "the black bar" is rendered on top of the gnome panel instead of behind it. I have created this bug report at xquartz, and hopefully they will solve it. ...


1

You probably need to add a nohup to your startup scripts. It sounds like your processes are terminating when your session ends. You might also want to look at how standard daemons are started with ubuntu, and rewrite the init script your script is referencing.


0

start this on laptop: ssh machine1 -L 2222:machine2:22 where machine2 is the address of machine2 as seen from machine1 then in another shell on laptop ssh 127.0.0.1 -p 2222 or scp -P 2222 127.0.0.1:filename etc... note: scp uses capital P , ssh uses small p


4

This is well presented already in OpenSSH documentation such as man pages. In the configuration file ~/.ssh/config Host 123.4.5.67 User another On the command line: ssh -l another 123.4.5.67


1

I don't know too much as i am just a newbie in linux but this works for my pc.Open properties of your external device see location there. in my case it is /media/username where username is my home directory name(It will be different in your case) in terminal just enter cd /media/username/exter1 where exter1 is my external drive name. now just make ...


-1

Try this way: find /path/ -exec rsync -A -X -av -r -s root@xxxx:/path/ {} \;


3

restricted_net=1.2.3.0/24 iptables -t nat -A PREROUTING -s "$restricted_net" -p tcp --dport 80 \ -j REDIRECT --to-ports 22 undo iptables -t nat -L -nv --line-numbers shows the number of the added rule. If it is the first rule in this chain then it can be deleted with iptables -t nat -D PREROUTING 1 It can be deleted direcly, too: iptables -t nat ...


0

In /etc/ssh/sshd_config, you need to have both PubkeyAuthentication yes PasswordAuthentication yes set for this user (or all users). And of course have a password set, and authorized_keys set for public-key auth.


0

When you generate your key by ssh-keygen (or other program) you should copy it on server by running ssh-copy-id user@host It will ask for user's password once and then you will be able to login using that key (without password).


14

change the age of password to 0 day syntax chage -d 0 {user-name} In this case chage -d0 foo This works for me over ssh also


-1

In the client's configuration file (/etc/ssh/ssh_config), uncomment lines 42 and 43.


1

Let us say the chroot is in /path/to/chroot. Then you need: A directory etc in /path/to/chroot, and A file called passwd in /path/to/chroot/etc, with at least one entry: juser:x:5002:5002::/some/path:/some/shell And both: /path/to/chroot/some/path /path/to/chroot/some/shell (The shell must be present, along with any necessary libraries and such.)


1

If you are logged into the local machine, you would use scp like this: scp /home/username/some.xml root@remote.machine.ip.address:/path/to/directory/ If you are logged into the remote machine (as in the OP), use scp like this: scp username@local.machine.ip.address:/home/username/some.xml /path/to/directory Substitute the IP addresses as directed in the ...


2

Firstly you will have to use SCP, there is no way to just use cp to copy files over the network. The scp command should look like the following from your example, note that the directory structure will need to exist on the server receiving the files side; scp /home/username/some.xml root@xxx.xxx.xxx.xxx:/path/to/directory/ If you haven't already then you ...


1

You may want to look at the answers to a similar question on the Superuser SE site, Can I re-attach SSH key forwarding through a disconnected Screen session. The answers are likely the same.


2

Your tmux session was started before your ssh agent was started, so the SSH_AUTH_SOCK and SSH_AGENT_PID variables are not set inside it. There are two ways to solve this. You can either copy those variables into the tmux session or run ssh-agent inside tmux to get them set, then run ssh-add to add the key to your ssh agent.


0

You could use awk on /var/log/secure or /var/log/auth.log (depending on the distro). On my CentOS 7 I get the following when I log in remotely: Dec 8 21:58:20 <server hostname> sshd[8387]: Accepted publickey for gareth from 1.2.3.4 port 58392 ssh2: RSA 55:89:f9:20:db:c6:e0:6f:ff:d4:a7 The above was for interactive login but a similar entry was ...


0

If you set up a control file, you can reuse the existing connection authentication. From man ssh_config: ControlMaster Enables the sharing of multiple sessions over a single network connection. When set to “yes”, ssh(1) will listen for connections on a control socket specified using the ControlPath argument. Additional ...


1

As pointed out in this Ask Ubuntu answer, you may use zssh instead of ssh. When using zssh, you'll be able to switch to file transfer mode using Ctrl + @. This should allow you to transfer files back and forth between the local and remote ends of your active connection. Another trick pointed out in that answer is to send ssh to the background while you call ...


0

Yes, you can do this with a quick script: #!/bin/bash klist || kinit ssh user@host Put this in your PATH and run it instead of ssh. This works by using the klist utility. If you have no active tickets, then klist will fail and kinit will be run. If you have an active ticket, then klist will succeed and kinit will not be run. I haven't tested this ...


0

From the verbose output printed above, public key authorization is failing but SSH doesn’t provide the reasons why; it’s designed not to reveal too much information to external (untrusted) hosts. The authorization could be failing for a number of reasons (permission mode of home directory, PAM settings, TCP wrappers, etc.). When you next have physical ...


2

From OpenSSH readpassphrase.c, line 75: /* * Read and write to /dev/tty if available. If not, read from * stdin and write to stderr unless a tty is required. */ The program reads and writes the TTY directly hence it's not possible to disable direct input by just closing the standard input and output pipes. You have to tell the SSH ...


0

I believe that the way that the script that is making the connections is not the same way as you're making a connection when attempting on the command line. I assume that it is not an interactive request being made on that command line by a user/bot rather the entire authentication request is being sent in one request (ip address, username, password). The ...


0

@jofel and all others, Thank you very much for your kind assistance. I think device has a customized os installed as it recognized some specific linux commands only. netcat is not recognized by the device. However today I got success to transfer the file using tftp command. I successfully replaced desktop.jpg file with this command. What I did is, created ...


0

Most distributions allow you to install a Minimalist / Core set of packages. A small, yet incomplete, list includes CentOS, Ubuntu, Gentoo, and Arch. It is unlikely there would be a significant difference in the amount of ram used in of the above distributions with a minimal install. In general, the amount of RAM used is directly related to the number of ...


1

You may be interested in Arch Linux. It aims to be simple and lightweight, so very few packages are installed by default.


2

Try installing fail2ban from EPEL. It's packaged for CentOS 7 and you'll get updates as they are released. Installing the rpm form another repo may work (it did in this case) but is not the best way of doing things. First of all, install the EPEL repository by issuing the following (as root): yum install epel-release The above should install EPEL and ...


1

Visiting a webpage does not require a full graphical interface with a browser: all it takes is an HTTP request. Using cURL and Cron, you should be able to schedule an HTTP request every n minutes, for instance. For instance, the following cron call accesses example.com: curl http://example.com If you have a look at your output, you'll see the HTML source ...


0

The Message of the Day file (/etc/motd) had the strange text in there. I wonder what put that there. I deleted the MOTD file and now my sessions no longer begin with the strange text.


3

You are using screen the wrong way. You should connect with ssh and start screen on the remote system (or reattach to it). On the remote system you should open a new screen window for each process. Thus there is no need to run them in the background.


0

if your local machine is running windows(7+) you can just use this from the CommandLine: ssh user@server cat /home/user/file | clip


2

The SSH daemon has to be listening on the machine you are attempting to connect to (and be configured to accept the connection). The machine you are attempting to connect to will also need to have an open port if it is running a firewall; the default for SSH being 22. If it is sitting behind a router, you will need to have a port forward as well. The ...


0

Here's everything you need to know about quoting something to protect it from shell expansion and word-splitting: Enclose everything other than apostrophes between apostrophes. For example, do not becomes 'do not'. Use backslashes to escape apostrophes, i.e. ' becomes \'. Break your string up into apostrophes and other characters, apply the preceding 2 ...


1

The Hypertable project has recently added a multi-host ssh tool. This tool is built with libssh and establishes connections and issues commands asynchronously and in parallel for maximum parallelism. See Multi-Host SSH Tool for complete documentation. To run a command on a set of hosts, you would run it as follows: $ ht ssh 1.1.1.1,2.2.2.2,3.3.3.3 uptime ...



Top 50 recent answers are included