LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hostname for SSH (https://www.linuxquestions.org/questions/linux-newbie-8/hostname-for-ssh-642025/)

llagunocap 05-13-2008 10:06 PM

Hostname for SSH
 
How do I set up or find out the hostname of my server? I want to set up SSH for my server, have IP address but I understand a hostname is required to set up SSH.

Thanks.

jus71n742 05-13-2008 10:33 PM

I would guess running an ifconfig and finding out that way what your host name is then open a terminal and input yourusername@hosname like mine for the school computers is
Code:

ssh username@labpcname.cs.school.edu

blacky_5251 05-13-2008 10:36 PM

The "hostname" command will tell you the name of your server. Which distro are you running? My server's hostname isn't in any of my SSH config files, so I suspect you're heading down a wrong path :confused:

What errors are you getting when you try to SSH to your server? Is sshd running on your server?

danboland 05-14-2008 12:03 AM

You don't need a hostname for ssh.

What setting are you trying to set?

ncsuapex 05-14-2008 09:02 AM

If you don't have a static IP(and I'm not talking about 192.168.1.x, unless you're just SSHing from the local network) I mean a static internet IP, then using the hostname to SSH into the server won't work when the internet IP changes...

There are work arounds for this but you have to tell us what you're trying to do here.

llagunocap 05-15-2008 08:30 AM

I am new on this and starting from zero. I wanted to set up remote access to the terminal session. I am running Fedora 9.

I figured out the hostname issue and checked sshd is running in the server, thank you. I was also able to ssh from another machine within the network using both hostname and IP Address - I'll try the connection from outside the network later on.

One question, I am using SSH Secure Shell to connect from a Windows machine, how do I close or disconnect the connection from the command line?

Thank you.

danboland 05-15-2008 09:15 AM

just type 'exit'. Also ctrl^d also sometimes closes different terminals (not sure if thats intended though).


a hostname or ip address is only needed in the sshd config when you want it to bind to a specific address. For instance, my server currently has two ip address assigned to it. I can make it so only one can be used for ssh. This can be very useful for security.

llagunocap 05-15-2008 11:27 AM

Thank you. I created user accounts using the graphical interface (System/Administration/Users and Groups). How do I grant system permission to a user accessing via ssh? I need a user to acces remotedly and install an application. Thank you again.

danboland 05-15-2008 11:08 PM

Depending on what distro you are using it should be allowed by default.
If there are restrictions and the person can't connect then this setting could be in a few places. First make sure if there is a group that allows ssh that this member is a part of it. (if you can ssh, look at your group settings)

On my server, i sue this in my sshd_config:
[code]
AllowUsers user1 user1 user2 user3
AllowUsers user1, user2, user3
{/code]

billymayday 05-15-2008 11:16 PM

Typically you'd give them tha ability to sudo, or they would su to the root account.

For the former, look at /etc/sudoers - edit it with the visudo command

llagunocap 05-16-2008 07:57 AM

Thank you. I looks like it is working fine now for all the users.


All times are GMT -5. The time now is 12:09 AM.