SSH refuses connection on CentOS after changing permissions on /etc [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm really a newbie in the Linux World. I've made change on a CentOS 5.4 server with this command :
sudo chmod -R ugo+rw /etc
Now when I try to connect with Putty from a Windows computer, I get this error :
server unexpectedly closed network connection
I assume the SSH service is running because I've currently another SSH session, that was open before the change, that is already alive. (connected as root)
Thanks in advance for any help.
Best regards,
Guy

It is /var/log/secure where you should see the errors.
The files in /etc/ssh/ can't be writable by the others. And some of them can't be even readable by others (private keys). Fix it such as:
chmod 600 /etc/ssh/ssh_host_*_key
chmod 644 /etc/ssh/ssh_host_*_key.pub /etc/ssh/ssh_config /etc/ssh/moduli
chmod 600 /etc/ssh/sshd_config

You just broke system-wide permissions and you're not allowed to login from security reasons. Try checking logs from /var/log/messages and /var/log/auth.log
grep 'sshd' /var/log/auth.log
You won't fix it easily.

Related

Why should I execute these commands? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I found these commands in a tutorial to setup selenium on linux. I'm not sure what they do, or why they are needed.
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
The post in question is here:
https://www.ultralinux.org/post/how-to-install-selenium-python-in-linux/
The first command make the superuser the owner of chromedriver. This is a good idea for programs that are installed in /usr/bin, to prevent ordinary users from modifying them (I assume the file is only writable by the owner, which is the usual default).
The second command adds execute permission for the user, group and others. This ensures that anyone can run the program.

SSH - Permission denied (publickey) for created user [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I can ssh to a digitalocean server using:
ssh root#1.1.1.1 (with the correct IP address)
however, after adding a user:
adduser git
...
is this information correct?
Y
...
I am not able to SSH with this new user
ssh git#1.1.1.1
Permission denied (publickey).
Why is my public key correct for root but not for git?
Update
If it matters, I am using digitalocean.
I know the problem, what your facing, you need to check the privilege of your key.
Change the user right permission. I do had an identifical problem, I can able to clone git via https not via ssh.
chmod utility will solve your issue:
This command will solve your problem.
chmod 777 <id_rsa_key(file)>
Some other frequently used examples are:
777 anyone can do anything (read, write, or execute)
755 you can do anything; others can only read and execute
711 you can do anything; others can only execute
644 you can read and write; others can only read

Not login to system due to changing permission [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am using Linux system but by mistake I fired a chmod command as follows:-
chmod -R 777 /
after that I restart my System. But when I try to login, the system is login but after 2-3 seconds again to login window. Please help me to solve this problem.
Just get your important files and configs backup them. format the partition which the OS installed, then reinstall again, sorry there is no easy way to correct these permissions.

How are all files and directories created as root:root in smb mount ( RHEL)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
We have smb mount point in one of our RHEL server. By logging as normal user, any file or directory created by the user is shown as root:root. What configuration has been made to force user and group shown as root:root always ? I have checked /etc/samba/smb.conf, no configuration has been found. And also all file and directory getting created by normal user has full 777 permission. Appreciate any quickest help.
The userid/gid "owning" a particular mounted SMB partition are determined by its mounting configuration.
You may want to check this Q&A: https://unix.stackexchange.com/questions/68079/mount-cifs-network-drive-write-permissions-and-chown

Detect incoming ssh connection [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm working on a network with many Linux machines.
In one of them I have a file that I suspect was pushed by another machine.
The machines can access each other using ssh connections.
Is there anyway I can tell which machine pushed the file?
I tried looking for ssh logs but the /var/log/secure/ directory doesn't exist.
Depending on the distro and your logging settings, you may have some luck with /log/auth.
Try grep sshd /var/log/auth.log
Depends on your distro, you can check following files from your distro.
/var/log/secure
/var/log/auth.log
/var/log/syslog
/var/log/daemon.log

Resources