openssh-portable | complete implementation of the SSH protocol | Cryptography library

 by   openssh C Version: V_9_3_P1 License: Non-SPDX

kandi X-RAY | openssh-portable Summary

kandi X-RAY | openssh-portable Summary

openssh-portable is a C library typically used in Security, Cryptography applications. openssh-portable has no bugs, it has no vulnerabilities and it has medium support. However openssh-portable has a Non-SPDX License. You can download it from GitHub.

OpenSSH is a complete implementation of the SSH protocol (version 2) for secure remote login, command execution and file transfer. It includes a client ssh and server sshd, file transfer utilities scp and sftp as well as tools for key generation (ssh-keygen), run-time key storage (ssh-agent) and a number of supporting programs. This is a port of OpenBSD's OpenSSH to most Unix-like operating systems, including Linux, OS X and Cygwin. Portable OpenSSH polyfills OpenBSD APIs that are not available elsewhere, adds sshd sandboxing for more operating systems and includes support for OS-native authentication and auditing (e.g. using PAM).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              openssh-portable has a medium active ecosystem.
              It has 2386 star(s) with 1575 fork(s). There are 122 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              openssh-portable has no issues reported. There are 94 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of openssh-portable is V_9_3_P1

            kandi-Quality Quality

              openssh-portable has 0 bugs and 0 code smells.

            kandi-Security Security

              openssh-portable has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              openssh-portable code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              openssh-portable has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              openssh-portable releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of openssh-portable
            Get all kandi verified functions for this library.

            openssh-portable Key Features

            No Key Features are available at this moment for openssh-portable.

            openssh-portable Examples and Code Snippets

            No Code Snippets are available at this moment for openssh-portable.

            Community Discussions

            QUESTION

            (struct *) vs (void *) -- Funtion prototype equivalence in C11/C99
            Asked 2019-Jul-31 at 14:48

            I was trying to implement GLOB_ALTDIRFUNC last night, and tripped into an interesting question.

            While maybe slightly semantically different, are (void *) and (struct *) types equivalent?

            Example code:

            ...

            ANSWER

            Answered 2019-Jul-31 at 12:38

            From the C99 standard, 6.7.5.1 Pointer declarators:

            For two pointer types to be compatible, both shall be identically qualified and both shall be pointers to compatible types.

            So void * and DIR * aren't compatible.

            From 6.7.5.3 Function declarators (including prototypes):

            For two function types to be compatible, both shall specify compatible return types. Moreover, the parameter type lists, if both are present, shall agree in the number of parameters and in use of the ellipsis terminator; corresponding parameters shall have compatible types.

            So struct dirent *(*)(void *) (the type of gl_readdir) nd struct dirent *(*)(DIR *) (the type of readdir) aren't compatible.

            From 6.3.2.3 Pointers:

            A pointer to a function of one type may be converted to a pointer to a function of another type and back again; the result shall compare equal to the original pointer. If a converted pointer is used to call a function whose type is not compatible with the pointed-to type, the behavior is undefined.

            So

            Source https://stackoverflow.com/questions/57288730

            QUESTION

            Is it possible to create an empty file using scp?
            Asked 2018-Nov-29 at 12:24

            In *nix, I can create an empty file using cp:

            ...

            ANSWER

            Answered 2018-Nov-29 at 12:24

            As @willh99 commented, creating an empty file locally, and then performing scp is the most feasible solution.

            So far I came up with this:

            Source https://stackoverflow.com/questions/53522286

            QUESTION

            Cannot open /proc/self/oom_score_adj when I have the right capability
            Asked 2018-Jun-21 at 13:00

            I'm trying to set the OOM killer score adjustment for a process, inspired by oom_adjust_setup in OpenSSH's port_linux.c. To do that, I open /proc/self/oom_score_adj, read the old value, and write a new value. Obviously, my process needs to be root or have the capability CAP_SYS_RESOURCE to do that.

            I'm getting a result that I can't explain. When my process doesn't have the capability, I'm able to open that file and read and write values, though the value I write doesn't take effect (fair enough):

            ...

            ANSWER

            Answered 2018-Jun-20 at 17:05

            This one was very interesting to crack, took me a while.

            The first real hint was this answer to a different question: https://unix.stackexchange.com/questions/364568/how-to-read-the-proc-pid-fd-directory-of-a-process-which-has-a-linux-capabil - just wanted to give the credit.

            The reason it does not work as is

            The real reason you get "permission denied" there is files under /proc/self/ are owned by root if the process has any capabilities - it's not about CAP_SYS_RESOURCE or about oom_* files specifically. You can verify this by calling stat and using different capabilities. Quoting man 5 proc:

            /proc/[pid]

            There is a numerical subdirectory for each running process; the subdirectory is named by the process ID.

            Each /proc/[pid] subdirectory contains the pseudo-files and directories described below. These files are normally owned by the effective user and effective group ID of the process. However, as a security measure, the ownership is made root:root if the process's "dumpable" attribute is set to a value other than 1. This attribute may change for the following reasons:

            • The attribute was explicitly set via the prctl(2) PR_SET_DUMPABLE operation.

            • The attribute was reset to the value in the file /proc/sys/fs/suid_dumpable (described below), for the reasons described in prctl(2).

            Resetting the "dumpable" attribute to 1 reverts the ownership of the /proc/[pid]/* files to the process's real UID and real GID.

            This already hints to the solution, but first let's dig a little deeper and see that man prctl:

            PR_SET_DUMPABLE (since Linux 2.3.20)

            Set the state of the "dumpable" flag, which determines whether core dumps are produced for the calling process upon delivery of a signal whose default behavior is to produce a core dump.

            In kernels up to and including 2.6.12, arg2 must be either 0 (SUID_DUMP_DISABLE, process is not dumpable) or 1 (SUID_DUMP_USER, process is dumpable). Between kernels 2.6.13 and 2.6.17, the value 2 was also permitted, which caused any binary which normally would not be dumped to be dumped readable by root only; for security reasons, this feature has been removed. (See also the description of /proc/sys/fs/suid_dumpable in proc(5).)

            Normally, this flag is set to 1. However, it is reset to the current value contained in the file /proc/sys/fs/suid_dumpable (which by default has the value 0), in the following circumstances:

            • The process's effective user or group ID is changed.

            • The process's filesystem user or group ID is changed (see credentials(7)).

            • The process executes (execve(2)) a set-user-ID or set-group-ID program, resulting in a change of either the effective user ID or the effective group ID.

            • The process executes (execve(2)) a program that has file capabilities (see capabilities(7)), but only if the permitted capabilities gained exceed those already permitted for the process.

            Processes that are not dumpable can not be attached via ptrace(2) PTRACE_ATTACH; see ptrace(2) for further details.

            If a process is not dumpable, the ownership of files in the process's /proc/[pid] directory is affected as described in proc(5).

            Now it's clear: our process has a capability that the shell used to launch it did not have, thus the dumpable attribute was set to false, thus files under /proc/self/ are owned by root rather than the current user.

            How to make it work

            The fix is as simple as re-setting that dumpable attribute before trying to open the file. Stick the following or something similar before opening the file:

            Source https://stackoverflow.com/questions/50863306

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install openssh-portable

            You can download it from GitHub.

            Support

            The official documentation for OpenSSH are the man pages for each tool:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/openssh/openssh-portable.git

          • CLI

            gh repo clone openssh/openssh-portable

          • sshUrl

            git@github.com:openssh/openssh-portable.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link