# root login problem



## zodehala (Aug 21, 2009)

after install freebsd. i can access using admin but can not access using root. i have to put some files in root dir.


i am using putty and privateshell.


----------



## mk (Aug 21, 2009)

zodehala said:
			
		

> after install freebsd. i can access using admin but can not access using root. i have to put some files in root dir.
> i am using putty and privateshell.


by default ssh login as root is disabled. add user in wheel group, allow ssh login to this user and then su/sudo to execute as root.
allowing directly root logins over ssh lead to potential security problems


----------



## zodehala (Aug 21, 2009)

mk said:
			
		

> by default ssh login as root is disabled. add user in wheel group, allow ssh login to this user and then su/sudo to execute as root.
> allowing directly root logins over ssh lead to potential security problems



but how can i change some file in root dir


----------



## LateNiteTV (Aug 21, 2009)

like mk said, add your user to the wheel group and login with your user. then use su or sudo to do what you need to do as root.


----------



## SIFE (Aug 21, 2009)

first you have to be root user then you can change file you want ,does the box owned by you or you only normal user .


----------



## zodehala (Aug 22, 2009)

LateNiteTV said:
			
		

> like mk said, add your user to the wheel group and login with your user. then use su or sudo to do what you need to do as root.



how? (i am new to FreeBSD)


----------



## MG (Aug 22, 2009)

zodehala said:
			
		

> how? (i am new to FreeBSD)



Edit your /etc/group file and change the 'wheel' line from


```
wheel:*:0:root
```

to


```
wheel:*:0:root,user1,user2
```

Existing users user1 and user2 can 'su' to get root permissions 
You need root permissions to do this.


----------



## Alt (Aug 22, 2009)

Do not edit them manually =)

Do an (sure under root)


> pw groupmod wheel -m user1


Where user1 is your username


----------



## zodehala (Aug 24, 2009)

Alt said:
			
		

> Do not edit them manually =)
> 
> Do an (sure under root)
> Where user1 is your username



i did you said 

```
su 
pw groupmod wheel -m admin
```

but whenever i send file to server as admin (username is admin ) following error


----------



## Alt (Aug 24, 2009)

Kidding?


----------



## MG (Aug 24, 2009)

What do /var/log/auth.log and /var/log/messages say?


----------



## SirDice (Aug 24, 2009)

zodehala said:
			
		

> but whenever i send file to server as admin (username is admin ) following error


You need to make sure your admin user has write permission in that directory. This has nothing to do with root.


----------



## zodehala (Aug 24, 2009)

SirDice said:
			
		

> You need to make sure your admin user has write permission in that directory. This has nothing to do with root.



how ?


----------



## CodeBlock (Aug 24, 2009)

http://www.freebsd.org/doc/en/books/handbook/permissions.html

That should be a good start


----------



## zodehala (Aug 25, 2009)




----------



## SirDice (Aug 25, 2009)

Login using ssh, su or sudo to root and change the ownership of /usr/home/ssp to admin.

`# chown -R admin:admin /usr/home/ssp`


----------



## Alt (Aug 25, 2009)

You see on screenshot that owner is root, not your user ?
And owner group is equal as yours, so you must set W right to group not only owner


----------



## DutchDaemon (Aug 25, 2009)

Using SSH, not that GUI, of course ..


----------



## zodehala (Aug 25, 2009)

```
localhost# chown -R admin:admin /usr/home/ssp/sippy_web
chown: admin: Invalid argument
```


----------



## SirDice (Aug 25, 2009)

zodehala said:
			
		

> ```
> localhost# chown -R admin:admin /usr/home/ssp/sippy_web
> chown: admin: Invalid argument
> ```



What does *id -a* tell you?

While you're at it, change the hostname in /etc/rc.conf to something other then localhost.


----------

